+1
日增长
8,909
stars
650
forks
81
watchers
289
prs
1,151
issues
77
releases
README
pdfcpu: PDF tooling for Go and the command line pdfcpu is a PDF processing library and command-line tool written in Go. It supports validation, optimization, encryption, signing, document assembly, content extraction, and other common PDF operations. pdfcpu supports PDF versions through PDF 2.0 (ISO 32000-2). PDF 2.0 validation support is basic and continuously improving. Horst Rutter, the maintainer of pdfcpu, is a member of the PDF Association. --- Installation | Command-line interface | Go API | | --- | --- | | CLI Installation instructions | API Installation instructions | --- Usage CLI Validate a PDF: pdfcpu validate input.pdf Merge two PDFs: pdfcpu merge merged.pdf in1.pdf in2.pdf Go API See API documentation for usage examples. Local images in create and form input Local images in create, form fill, and JSON/CSV form multifill are confined to an allowed directory. API callers must set conf.LocalImageRoot to enable them. The CLI defaults to its working directory and localImageRoot in config.yml selects another root. See local image access for configuration examples, path restrictions, migration instructions and security limitations. --- Features Validate, optimize, split, trim, and merge PDFs Extract and manipulate images, fonts, and metadata Encrypt and decrypt PDFs Resize and rotate pages Add and remove stamps and watermarks Validate signature integrity, report signature evidence, and remove signatures Manage attachments and portfolios Examples Selected examples: --- Commands Complete list of supported commands: | | | | |---|---|---| | annotations | attachments | booklet | | bookmarks | boxes | certificates | | change owner password | change user password | collect | | config | create | crop | | cut | decrypt | encrypt | | extract | fonts | form | | grid | images | import | | info | keywords | merge | | ndown | nup | optimize | | pagelayout | pagemode | pages | | permissions | portfolio | poster | | properties | resize | rotate | | signatures | split | stamp | | trim | validate | viewerpref | | watermark | zoom | | --- Motivation pdfcpu aims to provide comprehensive PDF processing capabilities implemented in Go for both individual files and automated batch processing. It focuses on correctness, robustness and independence from external dependencies. --- Focus - comprehensive PDF processing functionality - minimal external dependencies - predictable and stable behavior --- Documentation Project documentation: https://pdfcpu.io Changelog: https://pdfcpu.io/changelog Contributing guidelines Security policy CLI Command help: pdfcpu [command] --help Go API Package documentation: https://pkg.go.dev/github.com/pdfcpu/pdfcpu API documentation: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/api Examples: https://github.com/pdfcpu/pdfc
Top issues
#45PDF Export to Image24 comments · 2018-09-28#122Text extraction20 comments · 2019-10-29#567api: Install problem v0.4.018 comments · 2023-03-02#4replacing text in a PDF18 comments · 2017-10-08#34PDF/A conversion/validation17 comments · 2018-08-21#909Watermark/multiple text water mark and repeat text13 comments · 2024-07-05#1030import: free scaling of images12 comments · 2024-12-09#832support for tagged PDFs (PDF/UA, PDF/A)12 comments · 2024-03-15
Discussions
#1490pdfcpu v0.16.0 release candidate — feedback welcome1 comments · 2026-09-20#1478Is it possible to use the library to change URL of hyperlinks in the file?1 comments · 2026-09-09#1471Document resize & page orientation1 comments · 2026-09-01#1458pdfcpu v0.14.0 released0 comments · 2026-08-09#1453v0.14.0-rc.11 comments · 2026-07-28#1433pdfcpu v0.14.0 is coming next week — migration may be required2 comments · 2026-07-15#1408Upcoming Release v0.13.02 comments · 2026-05-27#1372v0.12.0 Update1 comments · 2026-03-31
Latest release
v0.16.4 v0.16.4 2026-10-27pdfcpu v0.16.4 This is a security update for crafted PDFs and form or create data that could cause excessive CPU or memory use or terminate a process. Additive Go API Changes: types.DecodeStreamFunc and types.NewLazyObjectStreamObjectWithDecoder. Existing constructors and signatures remain unchanged. Requires Go 1.26 or later. Release binaries were built with Go 1.27.3, which includes security fixes for crypto/x509. 1) Unbounded object traversal — GHSA-2623-w998-vcr4: Long chains of PDF objects could exhaust the Go stack and terminate the process during optimization while