pdf-form-filler
Fill PDF forms programmatically with text values and checkboxes. Use when you need to populate fillable PDF forms (government forms, applications, surveys, etc.) with data. Supports setting text fields and checkboxes with proper appearance states for visual rendering.
What this skill does
# PDF Form Filler
Programmatically fill PDF forms with text values and checkboxes. Uses pdfrw to set form field values while preserving appearance streams for proper PDF viewer rendering.
## Quick Start
Fill a PDF form with a dictionary of field names and values:
```python
from pdf_form_filler import fill_pdf_form
fill_pdf_form(
input_pdf="form.pdf",
output_pdf="form_filled.pdf",
data={
"Name": "John Doe",
"Email": "[email protected]",
"Herr": True, # Checkbox
"Dienstreise": True,
}
)
```
## Features
- **Text fields**: Set any text value (names, dates, addresses, etc.)
- **Checkboxes**: Set boolean values (True for checked, False/None for unchecked)
- **Appearance states**: Properly sets `/On` and `/Off` states for PDF viewer rendering
- **Preserves structure**: Doesn't strip form functionality—can be further edited
- **No dependencies**: Uses pdfrw (lightweight, pure Python)
## How It Works
1. Opens the PDF template
2. Iterates through form fields
3. Sets values for matching field names
4. Handles checkboxes by setting both `/V` (value) and `/AS` (appearance state)
5. Saves the filled PDF
## Field Name Matching
Field names should match exactly as they appear in the PDF form. Common patterns:
- German forms: `Herr`, `Frau`, `Dienstreise`, `Geschäftsnummer LfF`
- English forms: `Full Name`, `Email`, `Agree`, `Submit`
- Date fields: `Date`, `DOB`, `Start Date`
To discover field names in your PDF, use `list_pdf_fields()`:
```python
from pdf_form_filler import list_pdf_fields
fields = list_pdf_fields("form.pdf")
for field_name, field_type in fields:
print(f"{field_name}: {field_type}")
```
Field types:
- `text`: Text input field
- `checkbox`: Boolean checkbox
- `radio`: Radio button
- `dropdown`: Dropdown select
- `signature`: Signature field
## Example: Job Application Form
```python
fill_pdf_form(
input_pdf="job_application.pdf",
output_pdf="job_application_filled.pdf",
data={
"Full Name": "Jane Smith",
"Email": "[email protected]",
"Phone": "555-1234",
"Position": "Software Engineer",
"Years Experience": "5",
# Checkboxes
"Willing to relocate": True,
"Available immediately": False,
"Background check consent": True,
}
)
```
## Advanced Usage
### Partial fills
Only fill specific fields, leave others blank:
```python
data = {"Name": "Jane Doe"} # Only Name is set
fill_pdf_form("form.pdf", "form_filled.pdf", data)
```
### Dynamic field detection
Get all fields and prompt for values:
```python
from pdf_form_filler import list_pdf_fields
fields = list_pdf_fields("form.pdf")
data = {}
for field_name, field_type in fields:
if field_type == "text":
data[field_name] = input(f"Enter {field_name}: ")
elif field_type == "checkbox":
data[field_name] = input(f"Check {field_name}? (y/n): ").lower() == 'y'
fill_pdf_form("form.pdf", "form_filled.pdf", data)
```
### Batch fills
Fill multiple PDFs with the same data:
```python
import os
from pdf_form_filler import fill_pdf_form
data = {"Name": "John Doe", "Date": "2026-01-24"}
for filename in os.listdir("forms/"):
if filename.endswith(".pdf"):
fill_pdf_form(
f"forms/{filename}",
f"forms_filled/{filename}",
data
)
```
## Troubleshooting
### Checkboxes not showing visually
Some PDF viewers don't render checkboxes immediately. The value is set correctly (`/On` or `/Off`), but appearance isn't regenerated. Try opening in:
- Adobe Reader (will render automatically)
- Firefox (has better form support)
- evince or okular on Linux (usually works)
### Field names not found
Use `list_pdf_fields()` to confirm exact field names. PDF forms can be tricky:
- Some use unusual names (e.g., `Field_1` instead of descriptive names)
- Some have nested field structures
### Text appears cut off
Some PDFs have narrow text fields. Either:
1. Use shorter values
2. Reduce font size in the PDF template itself
3. Manual editing after filling
## Bundled Script
See `scripts/fill_pdf_form.py` for the full implementation using pdfrw.
Related in Writing & Docs
jax-development
IncludedUse this skill when the user is writing, debugging, profiling, refactoring, reviewing, benchmarking, parallelising, exporting, or explaining JAX code, or when they mention JAX, jax.numpy, jit, grad, value_and_grad, vmap, scan, lax, random keys, pytrees, jax.Array, sharding, Mesh, PartitionSpec, NamedSharding, pmap, shard_map, Pallas, XLA, StableHLO, checkify, profiler, or the JAX repo. It helps turn NumPy or PyTorch-style code into pure functional JAX, fix tracer/control-flow/shape/PRNG bugs, remove recompiles and host-device syncs, choose transforms and sharding strategies, inspect jaxpr/lowering/IR, and benchmark compiled code correctly.
nature-article-writer
IncludedDrafts, rewrites, diagnostically critiques, and style-calibrates primary research manuscripts for Nature and Nature Portfolio journals. Use when the user wants a Nature-style title, summary paragraph or abstract, introduction, results, discussion, methods, figure legends, presubmission enquiry, cover letter, reviewer response, or when a scientific draft sounds generic, jargon-heavy, structurally weak, or AI-ish and needs precise, broad-reader-friendly prose without inventing data, analyses, or references. Best for primary research articles and letters rather than reviews or press releases unless explicitly adapting one.
deckrd
IncludedDocument-driven framework that derives requirements, specifications, implementation plans, and executable tasks from goals through structured AI dialogue. Use when user says "write requirements", "create spec", "plan implementation", "derive tasks", "structure this feature", "break down into tasks", or "document this module". Also use for reverse engineering existing code into docs (/deckrd rev). Do NOT use for direct code writing — use /deckrd-coder after tasks are generated. Do NOT use when the user only wants to run or fix existing code without planning.
clinical-decision-support
IncludedGenerate professional clinical decision support (CDS) documents for pharmaceutical and clinical research settings, including patient cohort analyses (biomarker-stratified with outcomes) and treatment recommendation reports (evidence-based guidelines with decision algorithms). Supports GRADE evidence grading, statistical analysis (hazard ratios, survival curves, waterfall plots), biomarker integration, and regulatory compliance. Outputs publication-ready LaTeX/PDF format optimized for drug development, clinical research, and evidence synthesis.
handling-sf-data
IncludedSalesforce data operations with 130-point scoring. Use this skill to create, update, delete, bulk import/export, generate test data, and clean up org records using sf CLI and anonymous Apex. TRIGGER when: user creates test data, performs bulk import/export, uses sf data CLI commands, needs data factory patterns for Apex tests, or needs to seed/clean records in a Salesforce org. DO NOT TRIGGER when: SOQL query writing only (use querying-soql), Apex test execution (use running-apex-tests), or metadata deployment (use deploying-metadata).
accelint-ac-to-playwright
IncludedConvert and validate acceptance criteria for Playwright test automation. Use when user asks to (1) review/evaluate/check if AC are ready for automation, (2) assess if AC can be converted as-is, (3) validate AC quality for Playwright, (4) turn AC into tests, (5) generate tests from acceptance criteria, (6) convert .md bullets or .feature Gherkin files to Playwright specs, (7) create test automation from requirements. Handles both bullet-style markdown and Gherkin syntax with JSON test plan generation and validation.