How to fill PDF forms automatically without writing Python
Scripts that fill PDF forms with Python libraries look short in tutorials. In practice you dig out field names, handle checkbox export values, fight fonts for non-English names and make the values actually show in viewers. If what you need is the filled PDFs, not the script, use PDF Prefill.
How to do it
Upload the PDF form
Open pdfprefill.com and choose your PDF, or drop it on the page. PDF Prefill lists the form's fields with their labels, types (text, checkbox, radio button, dropdown) and pages. If the PDF has no fields to type into, it tells you so straight away.
Upload your data (Excel or a CSV from pandas)
Choose your spreadsheet: Excel (
.xlsx,.xls), CSV, TSV or OpenDocument (.ods). The first row must hold the column names; every row below it becomes one filled PDF. If the workbook has several sheets, pick the one you want.Check which column fills which field
PDF Prefill matches columns to fields by their names and labels, so a column called Address lands in the field labelled Address (number, street, and apt.). For each field you can pick another column, type one value for every PDF, or leave it blank. The right-hand column shows what row 1 will put in each field.
Preview, then download
Choose Preview the first PDF to see row 1 filled in. Then choose Fill: one row gives you a PDF, several rows give you a ZIP with one PDF per row. Name the files after a column, for example
{Name} - application, or number them with{#}. Tick Lock the values to flatten the PDFs so the values can no longer be edited and print the same everywhere.
The problems a script has to solve, already solved
- Cryptic field names: labels are read from the form, including the XFA layer of government forms.
- Values that don't show: each value is drawn into the field, so it appears in every viewer.
- Checkboxes and radio buttons: yes/no and the choice's text are mapped to the PDF's own values.
- Non-English names: a Unicode font is embedded for Latin, Greek and Cyrillic text.
- Limits: over-long values are cut with a warning instead of crashing the run.
- Owner-password PDFs (editing restricted) are opened and filled.
Coming from pandas?
Write your DataFrame with df.to_csv("data.csv", index=False) and upload the CSV. Values are
used exactly as written, so format dates and numbers in pandas the way they should appear on the form.
Your data stays on your computer
PDF Prefill reads and fills the files inside your browser. The PDF and the spreadsheet are never uploaded to a server, which matters when the rows hold names, addresses, tax numbers or dates of birth. We count page visits with Cloudflare Web Analytics, which uses no cookies and never sees your files.
Questions
Is there an API I can call from Python?
Not yet. An HTTP API is planned; write to hello@pdfprefill.com to hear when it opens.
Can I see the field names to use in my own code?
Yes. After you upload the PDF, every field's full name is listed under its label.