---
name: "pdf-acroform-automated-filler"
description: "Inspect and populate interactive PDF AcroForms and XFA form fields programmatically."
metadata:
  author: "py-pdf"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "fill pdf form fields python"
  - "inspect acroform fields pdf"
  - "flatten completed pdf form"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# AcroForm Interactive PDF Form Filler

Reads form field names and types from PDF templates, injecting structured dictionary data into text inputs, checkboxes, and radio buttons with pypdf or PyPDF2.

## When to Invoke
Invoke this skill whenever you need to:
- fill pdf form fields python
- inspect acroform fields pdf
- flatten completed pdf form

## Execution SOP & Rules
1. Inspect available form fields with reader.get_fields() to determine key names and types.
2. Update fields using writer.update_page_form_field_values(writer.pages[page_num], data_dict).
3. Set form flattening flags or re-render via Ghostscript to prevent subsequent tampering.
4. Ensure checkbox values match the export values defined in the template (e.g. '/Yes' or '/1').

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
