Skip to content

unfortunatelyalex/formbatch-pdf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

formbatch-pdf

Batch-fill PDF forms from CSV files locally.

formbatch-pdf takes a fillable AcroForm PDF and a spreadsheet-style CSV file, then writes one completed PDF per row. It is useful for forms, certificates, letters, labels, onboarding packets, and other repetitive office documents that should not require uploading private data to a hosted service.

Install

python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

Usage

List fields in a fillable PDF:

python main.py fields template.pdf

Create a starter CSV with the PDF field names as headers:

python main.py sample template.pdf --out people.csv

Fill one PDF per CSV row:

python main.py fill template.pdf people.csv --out completed --name "{last_name}_{first_name}.pdf"

Helpful options:

python main.py fill template.pdf people.csv --strict-fields
python main.py fill template.pdf people.csv --skip-empty
python main.py fill template.pdf people.csv --flatten
python main.py --help

CSV Notes

  • The first row must contain column names.
  • Column names that match PDF field names are written into the form.
  • Extra CSV columns are ignored by default, or treated as errors with --strict-fields.
  • The --name template can use any CSV column, plus row_number.

Limitations

This tool supports standard fillable AcroForm PDFs. It does not create fields in scanned PDFs, and it does not support XFA-only forms. The --flatten option is a best-effort read-only lock for form fields, not full raster flattening.

License

MIT

About

Batch-fill PDF forms from CSV files locally.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages