pdfcpu

PDF processing library and CLI written in Go for validating, merging, splitting, encrypting, stamping, signing and extracting content from PDFs.

pdfcpu is a PDF processing library and command-line tool written in Go. The CLI exposes subcommands for common PDF operations, for example pdfcpu validate input.pdf to check a file and pdfcpu merge merged.pdf in1.pdf in2.pdf to combine documents. It supports PDF versions up to PDF 2.0 (ISO 32000-2), though PDF 2.0 validation is described as basic.

The command set covers validating, optimizing, splitting, trimming, merging, cropping, resizing and rotating pages. It also covers encrypting and decrypting files, changing owner and user passwords, and setting permissions. Other commands handle stamps and watermarks, extracting images, fonts, and metadata, and managing attachments, portfolios, bookmarks, annotations, forms, and keywords. Signature support includes validating signature integrity, reporting signature evidence, and removing signatures. Layout and generation commands include nup, grid, booklet, poster, ndown, cut, create, and import. Per-command help is available through pdfcpu [command] --help.

The same functionality is available as a Go API (documented on pkg.go.dev), so Go developers can embed PDF processing in applications and batch pipelines. The project lists minimal external dependencies as a focus. Its users are developers and operators who need to script PDF manipulation or process PDFs programmatically. For bug reports on unprocessable files, the maintainers ask users to run pdfcpu validate -vv <file.pdf> and include the output.

Alternatives & related tools

add a badge to your README

Maintain pdfcpu? Show that it's featured on trmn. The badge links back to this page.

Featured on trmn
Markdown
[![Featured on trmn](https://www.trmn.sh/badge/pdfcpu.svg)](https://www.trmn.sh/tools/pdfcpu?utm_source=badge)
HTML
<a href="https://www.trmn.sh/tools/pdfcpu?utm_source=badge"><img src="https://www.trmn.sh/badge/pdfcpu.svg" alt="Featured on trmn" height="20"></a>