handbook.adra.dev

pdf-acroform-fill

Fill PDF AcroForm (fillable) fields programmatically with pypdf and UV — including insurance/government applications, claim grids, and mixed checkbox conventions. Use this skill whenever the user wants to populate, autofill, batch-fill, or merge data into a PDF form, map opaque field names to labels, extract field inventories from a template, or asks to fill a PDF opened in a browser. Also use when they mention Playwright/selenium + PDF (usually wrong tool). Trigger on phrases like fill PDF, fi…

First seen Apr 17, 2026

Installation

$ npx skills add https://handbook.adra.dev

Summary

  • Fill PDF AcroForm (fillable) fields programmatically with pypdf and UV — including insurance/government applications, claim grids, and mixed checkbox conventions.
  • Use this skill whenever the user wants to populate, autofill, batch-fill, or merge data into a PDF form, map opaque field names to labels, extract field inventories from a template, or asks to fill a PDF opened in a browser.
  • Also use when they mention Playwright/selenium + PDF (usually wrong tool).
  • Trigger on phrases like fill PDF, fillable form, AcroForm, pypdf, flatten form, checkbox won't check, and insurance/tax PDF templates — even if they don't say 'AcroForm'.

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from handbook.adra.dev · top by installs.

npx skills add https://handbook.adra.dev

Browse all from handbook.adra.dev

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 3,350 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 7 installs

SKILL.md

Goal

Produce a correctly filled PDF (new file) from a blank AcroForm template and structured user data, without relying on browser automation for the PDF viewer.

Do not use browser automation for in-browser PDFs

Chrome (and similar) render PDFs inside an internal viewer with no HTML form controls. Playwright/Cypress cannot reliably target AcroForm fields there.

Preferred path: download or use a local .pdf, then fill with pypdf via uv run.

Workflow

  1. Confirm the PDF is AcroForm

- Run field listing (see below). If get_fields() is empty and the doc still looks interactive, it may be XFA-only — say so and propose Adobe/manual or a specialized XFA tool; do not pretend pypdf will work.

  1. Inventory fields

- Use reader.get_fields() for writer-safe keys (e.g. dotted child names). - Walk page /Annots widgets for /TU (tooltip) → human label when /T is opaque. - Bundled helper from this skill (run from repo root or pass absolute path):

``bash uv run --with pypdf --with cryptography python skills/pdf-acroform-fill/scripts/listpdfform_fields.py /path/to/form.pdf ``

  1. Map data → field names

- Build a single dict of {fieldname: value}. - Checkboxes / radios: inspect /AP /N keys for the checked export value (/On, /Oui, etc.). Wrong export = box stays off. - Repeating rows: often encoded as parent field + indexed kids; use keys exactly as getfields() returns them. - Dates: ask or follow user preference (e.g. YYYY-MM-DD). Tooltip text hints are not always authoritative.

  1. Write the filled PDF

```python from pypdf import PdfReader, PdfWriter

reader = PdfReader("template.pdf") writer = PdfWriter() writer.append(reader) merged = {textfields, buttonfields} for page in writer.pages: writer.updatepageformfieldvalues(page, merged, auto_regenerate=False) writer.write("filled.pdf") ```

  1. Deliver

- Save filled.pdf to a clear path. - Prefer a small, repeatable script next to the project if the user will regenerate (template path, constants, item list). - Summarize non-obvious mappings (especially checkboxes and row indices).

When the user only has a URL

  • Fetch or ask them to download the PDF; then fill locally.
  • Do not promise Playwright will type into the embedded viewer.

Reference

See references/pypdf-filling.md for limitations and the write pattern.

Evals

Prompts for regression testing live in evals/evals.json. Extend with assertions when outputs are machine-checkable (field values in output PDF).