onepdf Go cookbook
Recipes
Create a PDF in GoGenerate a PDF invoice in Go with a line-item table, a repeating header, and a page-number footer. Download and run the complete Go example.Extract text from a PDF in GoRead a PDF as plain text in Go and get each word’s page coordinates. Includes a runnable example and a sample PDF with a text layer.Merge PDF files in GoCombine multiple PDF files in Go in the order you choose, then split the merged document by page range. Includes a runnable three-file example.Fill and flatten a PDF form in GoFill named AcroForm fields in Go, then flatten the PDF so the answers appear as page content. Run the example on US Courts form AO 440.
Security
Digitally sign a PDF in GoAdd a PAdES digital signature to a PDF in Go with onepdf-go, then verify it against an explicit trust anchor. Run the complete example locally.Redact a word from a PDF in GoFind a word in a PDF by its text bounds, remove it from the page, and save a redacted copy with onepdf-go. Includes a runnable Go example.Password-protect a PDF in GoEncrypt a PDF with an AES-256 open password in Go. Set separate reader and owner passwords and set printing and copying permissions with onepdf-go.