Forms · Go
Create and fill PDF forms in Go
Build interactive AcroForm fields from Go (text inputs, checkboxes, radio groups and dropdowns) with generated appearance streams, then fill and flatten them later. No NeedAppearances hack required.
Why Go needs this
Go's PDF story is fragmented: gofpdf is archived and unipdf is commercial, so production-grade output usually means a paid dependency or a brittle wrapper.
rust-pdf generates a full AcroForm with appearance streams baked in, so fields render correctly everywhere without relying on the viewer. Names support dotted hierarchy for grouped fields, and an existing form can be filled programmatically and flattened into static content.
- Text fields, checkboxes, radio groups and dropdowns with generated appearance streams.
- Hierarchical dotted field names for grouped data.
- Fill an existing form and flatten it into non-editable content.
Build a form in Go with rust-pdf
Install the package, then call the same idiomatic API every rust-pdf binding shares. The snippet below is real Go code from the reference docs.
doc, _ := rustpdf.New()
defer doc.Close()
_ = doc.AddPage()
_ = doc.TextField("applicant.name", 0, [4]float64{72, 700, 320, 720}, "", 0)
_ = doc.Checkbox("agree", 0, [4]float64{72, 660, 88, 676}, false)
_ = doc.Dropdown("plan", 0, [4]float64{72, 620, 240, 640},
[]string{"Starter", "Pro", "Enterprise"}, 1, 0)
_ = doc.RadioGroup("billing", 0, []rustpdf.RadioButton{
{Rect: [4]float64{72, 580, 88, 596}, Export: "monthly"},
{Rect: [4]float64{140, 580, 156, 596}, Export: "annual"},
}, 1)
_ = doc.Save("form.pdf")
This is part of the free tier in Go. No license required.
Full Go reference in the documentation.
Forms in Go: FAQ
Do the form fields render without NeedAppearances in Go?
Yes. rust-pdf generates an appearance stream for every field, so checkboxes, text and choices display correctly in all viewers without the NeedAppearances workaround.
Can I fill an existing form in Go?
Yes. Load the PDF, set text fields, checkboxes, radios and dropdowns by name, and optionally flatten the form so the values become permanent static content.
Is form authoring free?
Yes. Creating, filling and flattening AcroForm fields is part of the free tier in Go.
Create and Fill PDF Forms in Go
One Rust core, the same output across every language. Prototype for free, license the corporate features when you ship.