README.md
pdfcpu is a PDF processing library written in Go.
It is compatible with all PDF versions. Support for PDF 2.0 (ISO-32000-2) is evolving and continuously improving.
Prebuilt binaries and installation instructions (Homebrew, Docker, packages):
Install pdfcpu as a Go module:
go get github.com/pdfcpu/pdfcpu
API documentation:
Validate against PDF 2.0 (ISO-32000-2):
pdfcpu validate input.pdf
Merge two PDFs:
pdfcpu merge out.pdf in1.pdf in2.pdf
See API documentation for usage examples.
Common operations and examples:
<p align="center"> <kbd><a href="https://pdfcpu.io/generate/grid"></a></kbd> <kbd><a href="https://pdfcpu.io/core/watermark"></a></kbd> <kbd><a href="https://pdfcpu.io/generate/nup"></a></kbd> <kbd><a href="https://pdfcpu.io/fonts/fonts"></a></kbd> <kbd><a href="https://pdfcpu.io/core/stamp"></a></kbd> <kbd><a href="https://pdfcpu.io/form/form"></a></kbd><kbd><a href="https://pdfcpu.io/generate/create"></a></kbd> <kbd><a href="https://pdfcpu.io/core/stamp"></a></kbd> <kbd></kbd> <kbd><a href="https://pdfcpu.io/core/watermark"></a></kbd> <kbd><a href="https://pdfcpu.io/generate/create"></a></kbd>
<kbd><a href="https://pdfcpu.io/generate/booklet"></a></kbd> <kbd><a href="https://pdfcpu.io/core/stamp"></a></kbd> <kbd><a href="https://pdfcpu.io/generate/grid"></a></kbd> <kbd><a href="https://pdfcpu.io/core/stamp"></a></kbd> <kbd><a href="https://pdfcpu.io/generate/booklet"></a></kbd>
</p>Complete list of supported commands:
pdfcpu aims to provide comprehensive PDF processing capabilities implemented in Go.
It focuses on correctness, robustness and independence from external dependencies.
pdfcpu [command] --helpPackage documentation: https://pkg.go.dev/github.com/pdfcpu/pdfcpu
API documentation: https://pkg.go.dev/github.com/pdfcpu/pdfcpu/pkg/api
Examples:
Contributions are welcome.
pdfcpu cmd -vv ...) and a sample PDF when reporting issuesCrashes may occur due to the wide variety of PDF producers and formats in use, including older or non-compliant files. In many cases this is related to validation issues or edge cases in the parser.
Even with relaxed validation, some files cannot be processed. These cases are essential for improving pdfcpu by extending validation and handling additional real-world PDFs.
If you encounter a crash, please report it.
Start by validating the file using the CLI:
pdfcpu validate -vv <file.pdf>
Include in your report:
-vv)If validation crashes for a PDF that opens in Adobe Reader or macOS Preview, it is likely we can extend relaxed validation and provide a fix.
If the file cannot be opened by both Adobe Reader and macOS Preview, we cannot support it.
Please include a sample PDF to reproduce the issue whenever possible.
Thanks 💚 to all contributors:
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->| [ | ||||||
| <sub><b>Horst Rutter</b></sub>](https://github.com/hhrutter) | [ | |||||
| <sub><b>haldyr</b></sub>](https://github.com/haldyr) | [ | |||||
| <sub><b>Vyacheslav</b></sub>](https://github.com/SimePel) | [ | |||||
| <sub><b>Erik Unger</b></sub>](https://github.com/ungerik) | [ | |||||
| <sub><b>Richard Wilkes</b></sub>](https://github.com/richardwilkes) | [ | |||||
| <sub><b>minenok-tutu</b></sub>](https://github.com/minenok-tutu) | [ | |||||
| <sub><b>Mateusz Burniak</b></sub>](https://github.com/matbur) | ||||||
| [ | ||||||
| <sub><b>Dmitry Harnitski</b></sub>](https://github.com/dharnitski) | [ | |||||
| <sub><b>ryarnyah</b></sub>](https://github.com/ryarnyah) | [ | |||||
| <sub><b>Sam Giffney</b></sub>](https://github.com/s01ipsist) | [ | |||||
| <sub><b>Carlos Eduardo Witte</b></sub>](https://github.com/cewitte) | [ | |||||
| <sub><b>minusworld</b></sub>](https://github.com/minusworld) | [ | |||||
| <sub><b>Witold Konior</b></sub>](https://github.com/jozuenoon) | [ | |||||
| <sub><b>joonas.fi</b></sub>](https://github.com/joonas-fi) | ||||||
| [ | ||||||
| <sub><b>Henrik Reinstädtler</b></sub>](https://github.com/henrixapp) | [ | |||||
| <sub><b>VMorozov-wh</b></sub>](https://github.com/VMorozov-wh) | [ | |||||
| <sub><b>Benoit KUGLER</b></sub>](https://github.com/benoitkugler) | [ | |||||
| <sub><b>Adam Greenhall</b></sub>](https://github.com/adamgreenhall) | [ | |||||
| <sub><b>moritamori</b></sub>](https://github.com/moritamori) | [ | |||||
| <sub><b>JanBaryla</b></sub>](https://github.com/JanBaryla) | [ | |||||
| <sub><b>TheDiscordian</b></sub>](https://github.com/TheDiscordian) | ||||||
| [ | ||||||
| <sub><b>Rafael Garcia Argente</b></sub>](https://github.com/rgargente) | [ | |||||
| <sub><b>truyet</b></sub>](https://github.com/truyet) | [ | |||||
| <sub><b>Christian Nicola</b></sub>](https://github.com/christiannicola) | [ | |||||
| <sub><b>Benjamin Krill</b></sub>](https://github.com/kben) | [ | |||||
| <sub><b>Peter Wyatt</b></sub>](https://github.com/petervwyatt) | [ | |||||
| <sub><b>Kroum Tzanev</b></sub>](https://github.com/kpym) | [ | |||||
| <sub><b>Stefan Huber</b></sub>](https://github.com/signalwerk) | ||||||
| [ | ||||||
| <sub><b>Juan Iscar</b></sub>](https://github.com/juaismar) | [ | |||||
| <sub><b>Eng Zer Jun</b></sub>](https://github.com/Juneezee) | [ | |||||
| <sub><b>Dmitry Ivanov</b></sub>](https://github.com/hant0508) | [ | |||||
| <sub><b>Rene Kaufmann</b></sub>](https://github.com/HeavyHorst) | [ | |||||
| <sub><b>Christian Heusel</b></sub>](https://github.com/christian-heusel) | [ | |||||
| <sub><b>Chris</b></sub>](https://github.com/freshteapot) | [ | |||||
| <sub><b>Lukasz Czaplinski</b></sub>](https://github.com/scoiatael) | ||||||
| [ | ||||||
| <sub><b>Joel Silva Schutz</b></sub>](https://github.com/joelschutz) | [ | |||||
| <sub><b>semvis123</b></sub>](https://github.com/semvis123) | [ | |||||
| <sub><b>guangwu</b></sub>](https://github.com/testwill) | [ | |||||
| <sub><b>Yoshiki Nakagawa</b></sub>](https://github.com/yyoshiki41) | [ | |||||
| <sub><b>Steve van Loben Sels</b></sub>](https://github.com/stevevls) | [ | |||||
| <sub><b>Yaofu</b></sub>](https://github.com/mygityf) | [ | |||||
| <sub><b>vsenko</b></sub>](https://github.com/vsenko) | ||||||
| [ | ||||||
| <sub><b>Alexis Hildebrandt</b></sub>](https://github.com/afh) | [ | |||||
| <sub><b>Sivukhin Nikita</b></sub>](https://github.com/sivukhin) | [ | |||||
| <sub><b>Joachim Bauch</b></sub>](https://github.com/fancycode) | [ | |||||
| <sub><b>kalimit</b></sub>](https://github.com/kalimit) | [ | |||||
| <sub><b>Andreas Erhard</b></sub>](https://github.com/xelan) | [ | |||||
| <sub><b>Matsumoto Toshi</b></sub>](https://github.com/toshi1127) | [ | |||||
| <sub><b>Carl Wilson</b></sub>](https://github.com/carlwilson) | ||||||
| [ | ||||||
| <sub><b>LNAhri</b></sub>](https://github.com/LNAhri) | [ | |||||
| <sub><b>vishal</b></sub>](https://github.com/vishal-at) | [ | |||||
| <sub><b>Andreas Deininger</b></sub>](https://github.com/deining) | [ | |||||
| <sub><b>Robert Raines</b></sub>](https://github.com/solintllc-robert) | [ | |||||
| <sub><b>Frank Anderson</b></sub>](https://github.com/frob) | [ | |||||
| <sub><b>Sven Lilienthal</b></sub>](https://github.com/SveLil) | [ | |||||
| <sub><b>Florian Kinder</b></sub>](https://github.com/fank) | ||||||
| [ | ||||||
| <sub><b>mdmcconnell</b></sub>](https://github.com/mdmcconnell) | [ | |||||
| <sub><b>Bradley Erickson</b></sub>](https://github.com/13rac1) | [ | |||||
| <sub><b>doronbehar</b></sub>](https://github.com/doronbehar) | [ | |||||
| <sub><b>joeyave</b></sub>](https://github.com/joeyave) |
This project is released with a Contributor Code of Conduct. By participating, you agree to abide by its terms.
Use of pdfcpu assumes compliance with all applicable copyrights for any processed PDF content, including embedded resources such as fonts and images.
Gopher artwork by Renee French
Apache License 2.0