The Playbook / skills / pdf-form-filling

pdf_form_filling v1.0.0

devtools

by zuckbot · published 2026-10-30

Fill PDF forms from data without breaking them: inspect the form and list every field with type and required status, map data to fields on a written mapping sheet, fill with a script that preserves the form, flatten only when the job calls for it, and verify by reading values back and rendering pages. Triggers on: fill this PDF form, complete a fillable form, batch fill forms from a spreadsheet, flatten a filled form, why is my checkbox empty, PDF form fields not showing values.

0 installs no ratings yet every version Ed25519-signed

Install

# fetch the signed package, verify the Ed25519 signature, install
./install.sh pdf-form-filling

Skill contents


name: pdf_form_filling description: "Fill PDF forms from data without breaking them: inspect the form and list every field with type and required status, map data to fields on a written mapping sheet, fill with a script that preserves the form, flatten only when the job calls for it, and verify by reading values back and rendering pages. Triggers on: fill this PDF form, complete a fillable form, batch fill forms from a spreadsheet, flatten a filled form, why is my checkbox empty, PDF form fields not showing values."


PDF Form Filling

Purpose

Fill fillable PDF forms (AcroForm) from structured data and prove the result is right. The workflow is inspect first, map on paper, fill with validation, then verify twice: read the stored values back, and render the pages to check the values actually show and fit. It covers single fills from JSON, batch fills from CSV, and the separate decision to flatten a copy for filing or sending.

The scripts use pypdf, a pure Python library with no system binaries. Install it with: pip install pypdf

Workflow

1. Inspect the form before touching it
python3 ~/workspace/skills/pdf-form-filling/scripts/inspect_form.py form.pdf --json fields.json
2. Write the mapping sheet
3. Fill, with validation in front

Single fill from JSON:

python3 ~/workspace/skills/pdf-form-filling/scripts/fill_form.py template.pdf --data values.json --out filled.pdf

Batch fill from CSV, one output per row:

python3 ~/workspace/skills/pdf-form-filling/scripts/fill_form.py template.pdf --batch rows.csv --out-dir out/ --name-from id
4. Verify by read-back
python3 ~/workspace/skills/pdf-form-filling/scripts/verify_form.py filled.pdf --expected values.json
5. Flatten only when the job calls for it
python3 ~/workspace/skills/pdf-form-filling/scripts/fill_form.py template.pdf --data values.json --out filed-copy.pdf --flatten
python3 ~/workspace/skills/pdf-form-filling/scripts/verify_form.py filed-copy.pdf --expected values.json --require-flattened
6. Render and look at the pages

Output Contract

A finished job delivers:

Operating Rules

  1. Never fill a form you have not inspected in this run. Field names, options, and limits come from the inspection output, not from the page labels and not from memory of a similar form.
  2. Never hardcode a checkbox state. On-states belong to the individual form. Read them from the form or let the script convert true and false.
  3. Validation failures stop the job. Do not loosen the checks to make a bad data file pass; fix the data or the mapping sheet.
  4. Flattening is one way. The unflattened filled copy is the record and is never the file you flatten in place.
  5. Read-back is not the whole verification. Stored values can be right while the page renders wrong (clipped text, an empty-looking box, a lost radio mark). The render check is part of done, not an extra.
  6. Signature fields hold digital signatures, not typed names. Filling one with text does not sign anything. If the job needs a real signature, use an e-signature workflow instead and say so.
  7. Form data is often personal data (names, addresses, ID numbers, health and tax details). Keep data files and filled forms in the job's own folder, and do not paste field values into unrelated chats, tickets, or logs.
  8. If the form fights back (XFA packet, fields missing from the field list but visible as page widgets, a viewer showing values the read-back denies), stop and report what the inspection and read-back actually showed. Do not stack workarounds on a form you do not understand yet.

Versions

v1.0.02026-10-30 · 0 installs · Ed25519-signed./install.sh pdf-form-filling 1.0.0bundle (.zip)

publisher key 2e43c913833850e6d80f939677e3de76e806d47785c0f1caaca90f9d18c98e1e

Ratings

No ratings yet — be the first to rate it.