Long-term archiving · Go

Create PDF/A in Go

Generate archival-grade PDF/A from Go with one method call. rust-pdf embeds the sRGB ICC profile, adds the output intent, writes the XMP metadata and document ID, and enforces the rules, so the output validates under veraPDF, the reference validator.

Last updated: 2026-06-29

Why Go needs this

Archival mandates (e-invoicing, court filings, healthcare and finance records) increasingly demand PDF/A, a profile most Go libraries never implemented. The hard part is getting the ICC profile, output intent, XMP metadata and font embedding all correct at once; one missing piece and veraPDF rejects the file.

rust-pdf produces and validates PDF/A-1b, 2b, 2a, 3b, 3a and the PDF 2.0-based A-4 family, embedding and subsetting every font, sealing in the sRGB profile, and keeping the XMP in sync with the document info for you — so a long-lived document renders identically decades from now.

Because the binding is cgo, an archival service built on a Mac usually ships to a Linux container: set CGO_ENABLED=1 with a Linux toolchain, build in a multi-stage Dockerfile, and copy libpdf_ffi.so beside the binary. Then gate every release on a veraPDF check in CI, where deterministic output keeps the result stable.

  • Levels A-1b, A-2b, A-2a, A-3b, A-3a and A-4 (the PDF 2.0 part), with the accessible a-levels building a full tagged structure tree.
  • Fonts embedded and subset automatically, ICC profile and output intent added for you.
  • XMP metadata kept in sync with the document info, validated by veraPDF.

Create PDF/A in Go with rust-pdf

Install with go get, then call the same idiomatic API every rust-pdf binding shares. The snippet below is real Go code from the reference docs.

go get github.com/rustpdf/rustpdf-go

Go
doc, _ := rustpdf.New()
defer doc.Close()
_ = doc.PdfaLevel(rustpdf.A2b)
_ = doc.SetInfo(rustpdf.Info{Title: "Q3 Report", Author: "Acme Inc."})
f, _ := doc.AddFontFile("Roboto-Regular.ttf")
_ = doc.AddPage()
_ = doc.ShowText(f, 20, 72, 760, "Archival report", 0)
if err := doc.Save("report_pdfa.pdf"); err != nil {
	log.Fatal(err)   // *Error without a license granting PDF/A
}
Validated by: veraPDFqpdfmutool

Go basic generation is free. PDF/A is a corporate feature, unlocked by one offline license token. See pricing & licensing.

Full Go reference in the documentation.

PDF/A in Go: FAQ

Which PDF/A levels are supported in Go?

rust-pdf creates PDF/A-1b, 2b, 2a, 3b, 3a and 4 (the PDF 2.0-based part, including 4e and 4f). Use a basic b-level for visual fidelity, an a-level for an accessible tagged structure, or a 3-level when you need to embed source files such as an e-invoice XML.

How is conformance verified?

Output is validated with veraPDF, the open-source reference validator for PDF/A, plus qpdf and mutool for structure. The claim is backed by validators, not adjectives.

Do I need a license to create PDF/A in Go?

PDF/A is a corporate feature and requires an active license token. Basic generation in Go is free. One offline token unlocks PDF/A in every supported language.

How do I gate veraPDF validation in my Go CI?

Run go test to emit the PDF/A files, then add a CI step that shells out to veraPDF (for example verapdf -f 2b) and fails the build on any non-conformance. Because output is deterministic, the same input always yields the same validated bytes, so the gate never flaps.

Make your Go output last for decades

One Rust core, the same veraPDF-clean PDF/A in every language. Generate for free in Go; license the archival profile when you go live.