pdfcpu validates, merges, splits, encrypts, and transforms PDFs through a Go API and a command-line interface with broad PDF operations.
Overview
pdfcpu is a Go-based PDF processor aimed at validation, optimization, assembly, content extraction, encryption, signing, and related tasks on individual files or in batch jobs. It supports PDF versions through PDF 2.0 with ongoing improvements to ISO 32000-2 validation.
The command-line tool exposes dozens of subcommands for annotations, attachments, bookmarks, forms, images, fonts, metadata, signatures, watermarks, N-up layouts, portfolios, permissions, and more. Typical workflows include validating a file, merging documents, or running optimize and extract operations without external PDF viewers.
Go programs import the library directly for server-side automation and embedded PDF control. Local image paths used in create and form workflows are restricted to configured roots for safety; the CLI defaults to the working directory with optional config.yml overrides.
The project emphasizes comprehensive PDF functionality, minimal external dependencies, and predictable behavior. Documentation covers CLI help, API examples, changelog, and security reporting. Compatibility triage often references whether Adobe Acrobat Reader or macOS Preview can open problematic files.
Key features
- Validate and optimize PDFs
- Merge, split, and trim
- Encrypt, decrypt, and sign
- Extract images, fonts, metadata
- Stamps, watermarks, and forms
- Large CLI command surface
- Go API for automation
- Local image path controls
Use cases
- Automated PDF batch pipelines
- Go service PDF manipulation
- CLI document assembly
- PDF validation in CI