github pdfcpu/pdfcpu v0.6.0

latest releases: v0.8.0, v0.7.0
4 months ago

Hello! 💫

This release comes ready for you to play around with during the 🎄 holidays.
It is packed with new features and the first one 🔥 dealing with PDF 2.0 (ISO 32000:2) support.
Let's get right into it..

PDF 2.0 Support

We start with basic support for validation and you can play around with the validate and info commands.
The work around this is ongoing and will stretch over the next couple of releases.
Please 🙏🏻 report back any issues.

CLI

There are three new commands:

Manage the page layout which shall be used when the document is opened:

pdfcpu pagelayout list  inFile
pdfcpu pagelayout set   inFile value
pdfcpu pagelayout reset inFile

➡️ pdfcpu help pagelayout and pagelayout


Manage how the document shall be displayed when opened:

pdfcpu pagemode list  inFile
pdfcpu pagemode set   inFile value
pdfcpu pagemode reset inFile

➡️ pdfcpu help pagemode and pagemode


Manage the way the document shall be displayed on the screen and shall be printed:

pdfcpu viewerpref list [-a(ll)] [-j(son)] inFile
pdfcpu viewerpref set                     inFile (inFileJSON | JSONstring)
pdfcpu viewerpref reset                   inFile

➡️ pdfcpu help viewerpref and viewerpref

The split command now also allows for splitting along page boundaries:

pdfcpu split [-m(ode) span|bookmark|page] inFile outDir [span|pageNr...]

➡️ pdfcpu help split and split

The merge command allows for divider pages at file boundaries and zipping two files together:

pdfcpu merge [-m(ode) create|append|zip] [-s(ort) -b(ookmarks) -d(ivider)] outFile inFile...

➡️ pdfcpu help merge and merge


The permission command is now more useful:

pdfcpu permissions list [-upw userpw] [-opw ownerpw] inFile...
pdfcpu permissions set [-perm none|print|all|max4Hex|max12Bits] [-upw userpw] -opw ownerpw inFile

It now also allows for conveniently setting individual PDF access bits either via a binary or hexadecimal number.
➡️ pdfcpu help permissions and permissions

API

Thanks to @vsenko the stamp command in combination with PDF stamps has become more powerful.

  1. You can set the PDF attribute in your Watermark struct with a cached reader which should save you some memory.
  2. Multi stamping is the process where the pages of some input PDF file will be stamped one by one with the next page from a stamp PDF file, eg: pdfcpu stamp add -mode pdf -- "stamp.pdf" "" in.pdf out.pdf
    There is now a way to fine tune multi stamping eg: pdfcpu stamp add -mode pdf -- "stamp.pdf:2:3" "" in.pdf out.pdf
    will initiate multi stamping at page 2 of stamp.pdf and page 3 of in.pdf

Configuration

There are three changes to the configuration:

  1. headerBufSize was eliminated since PDF 2.0 comes with a flexible header location specification.
  2. permissions are now a 4 digit hex number instead of a negative integer.
  3. needAppearances is a flag you can set for form filling.

Since the pdfcpu configuration has changed you are encouraged to recreate your config.yml:

  1. Locate your config.yml using pdfcpu conf
  2. Remove/backup your config.yml
  3. Create a new config.yml from scratch by executing any pdfcpu cmd on the CLI eg. execute one more time pdfcpu conf
  4. Edit your configuration

If and only if you are having fun using pdfcpu...

pdfcpu is in need of financial supporters. There are membership fees, meetings and countless hours I am putting into this project.
Please 🙏 consider supporting me in any way you can by becoming a sponsor.
Go to your superior or team lead and have them compare the benefits/costs vs. commercial solutions.

Big Thanks

🙏 to all bug reporters and PRs.
Have fun 💚 with pdfcpu!

Changelog

Don't miss a new pdfcpu release

NewReleases is sending notifications on new releases.