Go PDF libraries compared
There is no single best Go PDF library, because they do different things. Generating a PDF, manipulating an existing one, rendering it to pixels and certifying it against an archival standard are four separate problems, and most libraries solve exactly one of them well. gopdfrab solves the fourth.
At a glance
| Library | Primary purpose | PDF/A conformance | Build | License |
|---|---|---|---|---|
| gopdfrab | PDF/A conformance | Verify + convert (PDF/A-1b) | Pure Go | AGPL 3.0 / commercial |
| pdfcpu | Processing and tooling | No, PDF syntax validation only | Pure Go | Apache 2.0 |
| UniPDF (UniDoc) | Broad commercial toolkit | Yes, as part of a much larger suite | Pure Go | Commercial (license key required) |
| fpdf | Document generation | No, it does not read PDFs | Pure Go | MIT |
| PDFium bindings | Rendering and extraction | No | CGo | Varies (BSD core) |
Choosing by what you actually need
To generate PDFs, invoices and reports and labels, reach for fpdf, or a headless-browser HTML-to-PDF pipeline if your layout is already HTML. gopdfrab cannot help. It has no drawing API.
To manipulate them, merging, splitting, stamping, encrypting or optimising, pdfcpu is the mature open-source answer and has a good CLI to go with the library. To render a page or pull text out of one, the PDFium bindings give you the same engine Chrome uses, with the CGo cost that implies.
To certify archival conformance, to answer "will this document still be readable and legally sound in twenty years", you need something that implements ISO 19005 specifically. It is a narrow, unglamorous problem, and it is the only thing gopdfrab does.
To do all of the above from one vendor with commercial support, UniPDF is the established option. It is a genuinely broad toolkit. The trade is that it is commercial software requiring a license key at runtime, where the others are libraries you simply import.