Comparison

Go PDF libraries compared

The Go PDF ecosystem splits by purpose more than by quality. Picking well means knowing which question each library answers.

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
gopdfrabPDF/A conformanceVerify + convert (PDF/A-1b)Pure GoAGPL 3.0 / commercial
pdfcpuProcessing and toolingNo, PDF syntax validation onlyPure GoApache 2.0
UniPDF (UniDoc)Broad commercial toolkitYes, as part of a much larger suitePure GoCommercial (license key required)
fpdfDocument generationNo, it does not read PDFsPure GoMIT
PDFium bindingsRendering and extractionNoCGoVaries (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.

These compose well
Generating with fpdf, manipulating with pdfcpu and certifying with gopdfrab is a perfectly sensible stack. Because gopdfrab only reads and rewrites finished documents, it sits at the end of whatever pipeline you already have.

Frequently asked questions

Certify what you already produce

Point gopdfrab at the output of whatever generates your PDFs and find out whether it is archival-grade.