---
title: "onepdf Go cookbook"
url: https://recursiveai.org/onepdf/go/cookbook/
description: "8 onepdf-go recipes, each with complete code."
version: "1.0.1"
---

# onepdf Go cookbook

## Recipes

- [Create a PDF in Go](https://recursiveai.org/onepdf/go/cookbook/create-pdf-in-go/index.md): Generate 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 Go](https://recursiveai.org/onepdf/go/cookbook/extract-text-from-pdf-in-go/index.md): Read 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 Go](https://recursiveai.org/onepdf/go/cookbook/merge-pdf-files-in-go/index.md): Combine 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 Go](https://recursiveai.org/onepdf/go/cookbook/fill-pdf-form-in-go/index.md): Fill 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 Go](https://recursiveai.org/onepdf/go/cookbook/sign-pdf-in-go/index.md): Add 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 Go](https://recursiveai.org/onepdf/go/cookbook/redact-pdf-in-go/index.md): Find 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 Go](https://recursiveai.org/onepdf/go/cookbook/encrypt-pdf-with-password-in-go/index.md): Encrypt 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.

## PDF/A

- [Convert a PDF to PDF/A in Go](https://recursiveai.org/onepdf/go/cookbook/convert-pdf-to-pdfa-in-go/index.md): Convert an existing PDF to PDF/A-2b in Go with pdfa.ConvertFile, then read the change list. Includes a runnable example and a PDF/A-3u variation.
