gpdf is a PDF library for Go with no dependencies outside the standard library. Lay out pages on a 12-column grid, embed Japanese, Chinese, and Korean fonts, and render a page in about 13 µs.
go.mod lists only Go itself. No cgo, no headless browser, no native binary to ship next to your service.
Rows and a 12-column grid flow onto pages. Tables split across page breaks and text wraps on its own.
TrueType fonts are subset to the glyphs you use, so Japanese, Chinese, and Korean look the same on every server.
Benchmarks
The same four documents built with gpdf, go-pdf/fpdf, signintech/gopdf, and maroto v2. Time and memory per document, lower is better.
Median of 5 runs, 100 iterations each. Apple M1, Go 1.25. The benchmark code lives in the gpdf repository.
See the benchmark codeGo-native architecture
Many PDF setups for Go reach outside the language: a headless browser in a sidecar, an HTML-to-PDF service over HTTP, or a binding to a native library. Each one adds a runtime to deploy, patch, and monitor.
gpdf is written in Go from the first line. It compiles into your binary, runs wherever Go runs, and its whole dependency tree is the standard library — there is nothing extra for your security team to audit.
One go get, one binary, the same output in development and production.
Your Go app
HTTP call or cgo bindingHeadless browser · JVM · native library
One more runtime to deploy, patch, and monitor.
Your Go app
go getgithub.com/gpdf-dev/gpdf
One binary · stdlib only · no cgo
Runs on
CJK, first-class
Most PDF libraries treat CJK as an afterthought. gpdf was built with it from day one.
Embed any TrueType font; only the glyphs you use are written to the file.
Mix Japanese, Chinese, Korean, and Latin text in one paragraph or table.
No tofu (□), no mojibake, no dependence on fonts installed on the server.


Archiving, security, and post-processing ship in the same module — still nothing but the Go standard library.
PDF/A-1b and PDF/A-2b output with XMP metadata, for documents that must stay readable for decades.
Owner and user passwords with permission control for printing, copying, and editing.
PKCS#7 signatures with RFC 3161 timestamps, applied to the finished PDF.
Running headers, footers, and page numbers that repeat on every page.
QR and Code 128 generated natively, next to PNG and JPEG images.
Combine PDFs or pull out page ranges without leaving Go.
Stamp overlays on existing PDFs and flatten filled AcroForm fields into static content.
Browse the examplesgpdf and the alternatives
What you deploy, what you pay for, and what you have to keep patched.
Pick the entry point that fits your stack. All three run through the same rendering engine.
go get github.com/gpdf-dev/gpdf. Works with Go 1.22 and later.
Fluent, type-safe Go: PageBuilder → RowBuilder → ColBuilder.
Describe documents as JSON and send them from any service or language.
Drive the JSON schema with text/template — one source for thousands of documents.
Invoices, receipts, and estimates you can copy and adapt.
Every example is a test that renders a real PDF, from tables to signatures.
Every example is compared byte for byte with a saved PDF before each release.
Generated files are validated against the PDF specification in CI.
CI runs the whole suite with the race detector on every supported Go version.
How do I show "Page X of Y" in a gpdf footer?
Nov 12, 2026
How do I set a custom paper size in gpdf?
Nov 10, 2026
FAQ
gpdf is an MIT-licensed PDF generation library written in pure Go with no external dependencies. It lays out pages on a 12-column grid and embeds TrueType fonts, including Japanese, Chinese, and Korean.
A single page renders in about 13 µs. In the published benchmarks gpdf is roughly 10 to 30 times faster than go-pdf/fpdf, signintech/gopdf, and maroto v2 on most documents.
Yes. Embed a TrueType font and gpdf writes only the glyphs you use. The output does not depend on fonts installed on the server.
Yes. gpdf is MIT licensed, so you can use, modify, and redistribute it in commercial products.
Go 1.22 and later. CI runs the test suite on Go 1.22 through 1.26.
One go get, then a few lines of Go.