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.
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtList fields in a fillable PDF:
python main.py fields template.pdfCreate a starter CSV with the PDF field names as headers:
python main.py sample template.pdf --out people.csvFill 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- 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
--nametemplate can use any CSV column, plusrow_number.
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.
MIT