github pdfcpu/pdfcpu v0.13.0

latest releases: v0.15.0, v0.14.0, v0.14.0-rc.1...
3 months ago

A Release Featuring CLI Pipelines and Safer Defaults

Starting with this release, pdfcpu improves CLI usability with broader stdin/stdout pipeline support and stricter overwrite handling.

Check out the refreshed documentation at https://pdfcpu.io

Many commands now support - for stdin/stdout, making pdfcpu easier to use in shell pipelines. Explicit output files and non-empty output directories are no longer overwritten implicitly. Use the new global --force flag when overwriting is intentional.

Example:

pdfcpu optimize - out.pdf < in.pdf

or:

cat in.pdf | pdfcpu optimize - - > out.pdf

or a pipeline:

aws s3 cp s3://acme-contracts/master.pdf - \
      | pdfcpu optimize - - \
      | aws s3 cp - s3://acme-contracts/optimized/master.pdf

CLI Improvements

This release adds and refines several user-facing CLI features:

  • Broader stdin/stdout support using -
  • Global --force flag for explicit overwrite handling
  • annotations list --json
  • form list --json
  • certificates list --json
  • merge --bookmark-mode wrap|preserve
  • Improved version command behavior
  • Clarified help text around signature validation scope and trust boundaries

The new overwrite behavior is intentionally stricter. Existing scripts that relied on implicit overwrites may need to add --force.


Merge Bookmarks

The merge command now supports bookmark handling modes:

pdfcpu merge --bookmark-mode wrap out.pdf in1.pdf in2.pdf

Supported modes:

  • wrap
  • preserve

The default is wrap.

This release also improves bookmark tree preservation and handling of bookmark destination collisions.


JSON Output

JSON output is now available for selected listing commands:

pdfcpu annotations list --json in.pdf
pdfcpu form list --json in.pdf
pdfcpu certificates list --json

form list --json also supports multi-file form export JSON.


Certificate Trust Store Packaging

Standard builds now start with an empty trusted certificate directory.

Embedded EUTL certificate bundles are only included when building with:

-tags pdfcpu_eutl

certificates reset now resets the certificate directory to the build defaults.

This keeps standard builds smaller and avoids implying a bundled trust store unless it was explicitly selected at build time.


Experimental Windows 7 Build

An experimental Windows 7 x64 build is available in the release assets:

pdfcpu_0.13.0_Windows_x86_64_win7_experimental.zip

This build uses a patched Go toolchain and is not part of the regular supported release matrix. Feedback from Windows 7 SP1 x64 users is welcome (at #870), especially the output of:

cmd
ver
pdfcpu.exe version
pdfcpu.exe validate test.pdf

Robustness & Safer Processing

This release adds configurable parser and resource limits for:

  • stream bytes
  • decoded bytes
  • image pixels and bytes
  • object counts
  • xref entries
  • recursion depth

The corresponding limits are also part of the configuration. Users of older version will be prompted by the CLI to reset their configuration.

Additional cycle and depth checks were added for page trees, form fields, name trees, and object graph traversal.

Stream parsing and filter decoding have also been hardened against oversized, malformed, and overflowing inputs.

Very large or malformed PDFs that were previously attempted may now be rejected earlier.


Fixes and Improvements

This release includes targeted fixes and compatibility improvements for:

  • annotation geometry during resize, including Rect and QuadPoints
  • merge bookmark handling
  • form filling with user fonts
  • removing document properties and associated catalog XMP metadata
  • relaxed validation for selected malformed JavaScript action and structure-tree object-reference cases
  • booklet page count and content-buffer handling
  • FlateDecode predictor and EOF handling
  • output path handling in extraction, fonts, forms, split/cut, and attachment-related workflows
  • watermarks, stamps, validation, fonts, properties, and related command behavior

Dependencies were updated, including go-runewidth, x/crypto, x/image, and x/text.


Signature Validation Notes

Now usage, help text and docs describe the current signature validation scope and trust boundaries more clearly.

This release does not claim complete legal, eIDAS, LTV, or long-term trust validation.


Development

Behind the scenes, this release includes command plumbing refactoring in pkg/cli, updated tests around command dispatch, and an experimental Windows 7 build workflow.


Thanks

Everybody for testing, reporting issues, and feeding back real-world PDFs.
Your bug reports and edge cases continue to make pdfcpu more robust and useful.
Shoutouts to @harish for spending time on submitting a PR.


Changelog

Don't miss a new pdfcpu release

NewReleases is sending notifications on new releases.