pdfblah.com

← All guides

Fill a PDF form from a spreadsheet

Somebody in every office types the same form dozens of times a week: name, date, amount, repeat. The data already lives in a spreadsheet. form --fill-from is mail-merge for PDF forms: one filled PDF per row, filed by any column.

How to do it

pip install pdfblah

# 1. see what the form calls its fields
pdfblah form expense.pdf --list
# Employee  (text)  = ''
# Amount    (text)  = ''

# 2. a CSV whose headers match
# Employee,Amount
# Ada Lovelace,120.50
# Grace Hopper,99.00

# 3. one filled PDF per row, named by employee
pdfblah form expense.pdf --fill-from rows.csv -o filled/ --name "{Employee}.pdf"
filled 2 cop(ies) into filled/ (fields: Amount, Employee)

The details that behave

Tips