Fill PDF
Read the real field names out of a PDF form, then complete the form from a JSON object of values.
What this tool does
Fill PDF has two modes, and the first one matters more than its name suggests. List the fields in this form opens the document with pdf-lib, walks the AcroForm and returns a table of every field it holds: the name the document uses internally, the type (text, checkbox, radio, dropdown, list, button or signature), whatever value is stored in it now, and for anything with a fixed set of choices, the exact option strings. Those internal names are what the other mode keys on, and they are frequently nothing like the labels printed beside the boxes.
Fill the fields from JSON takes a JSON object whose keys are those names. A string is written into a text field, or picks an entry in a dropdown, radio group or list box, and anything that is not already text is converted before it is written, so 42 arrives as its digits. A checkbox is ticked by true, by the string "true", by the number 1 or by "on", and cleared by everything else — the string "1" included, which is the one that catches people out. A key that matches no field is skipped and counted in the summary as a name not found; switch on Fail if a field name is not in the form and the run stops instead, quoting the names it could not match. Push buttons and signature fields accept no value, so a key pointed at one is reported the same way as a typo.
Flatten the form after filling is enabled by default, and it is blunter than the wording suggests: the values are stamped into the page and every interactive field in the document goes, the ones you never named as well as the ones you filled. The file comes back under its own name with -filled added, so tax-return.pdf becomes tax-return-filled.pdf. Clear the checkbox when the next person still has to type into it, or when you want to open the result and check it before committing. Several PDFs can be queued in one run and the same object is applied to each, with one output file per document; unless the strict setting is on an unmatched name never stops the run, and the summary counts each such name once however many of the documents were missing it.
The work is done in this browser tab and no copy of the document goes anywhere, which is the point when the form you are completing carries a passport number or a salary. The limits are worth reading before you rely on it. Radio groups and list boxes refuse an option the document does not define, but a dropdown does not: pdf-lib stores whatever string it is handed and leaves the option list untouched, so a misspelt choice is written in as a value the form never offered rather than reported back to you. Values are redrawn with pdf-lib's built-in Helvetica when the file is saved, so a field styled in another typeface changes appearance, and a character outside the WinAnsi set — most non-Latin scripts — ends the run with an encoding error rather than filling quietly. Nothing here executes the document's own form JavaScript, so calculated totals and validation rules never fire and what you supply is written verbatim. A scanned form is a picture of a form with no fields in it and is refused; a password-protected file cannot be read until Unlock PDF has removed the password; and a dynamic XFA form keeps its answers in an XML packet that pdf-lib does not write, so what Acrobat shows may not match what you set here.
How to use it
- Start in list mode. Choose the PDF with Mode left on List the fields in this form. The table gives you each field's real name, its type, the value it already carries and the exact options a dropdown or radio group is willing to accept. No file is produced by this mode.
- Write the values as a JSON object. Switch to Fill the fields from JSON and replace the sample with your own keys — field name on the left, value on the right. Input that is not valid JSON, or that is an array rather than an object, is rejected before any document is touched.
- Decide about flattening and strictness. Leave Flatten the form after filling on to fix the answers into the page, or clear it to hand on a form that still opens for editing. Fail if a field name is not in the form turns a mistyped key into a stopped run rather than a silent gap.
- Check what it reports, then open the file. The summary counts the fields filled and says whether the file was flattened, and a notFound badge names the keys that matched nothing. A radio group, a list box or a text field with a maximum length stops the run outright when the value will not go in, quoting the field and the value it refused.
Processing & privacy
Runs on your device. Your file is processed directly in this browser.
Common use cases
Finding out what a form really calls its fields
A box labelled Surname can be named topmostSubform[0].Page1[0].f1_02[0]. List mode prints the names as the document stores them, which is what a script filling the same form has to use.
Producing the same form for several people
Export each record as a JSON object of field names and run one after another. Nothing is retyped, and a change to the underlying data means refilling rather than re-reading the whole page.
Returning a completed application
Fill it in, leave flattening on, and the recipient opens fixed page content instead of live boxes that their reader might offer to re-edit or clear.
Inspecting a form somebody sent you
Values are read from the field dictionaries, so list mode shows what a field actually holds even when the viewer draws it blank because the field carries no appearance stream.
Questions
Does the document leave my machine?
Why is my field name reported as not found?
What happens to a value the field does not offer?
Can I fill a scanned form?
Should I leave flattening switched on?
Can it apply a digital signature?
Does it touch anything besides the fields I named?
Related tools
- Merge PDF — Combine several PDFs into one document in the order you choose.
- Split PDF — Split one PDF into separate documents by page range.
- Compress PDF — Reduce PDF file size while preserving the quality that matters.
- PDF to JPG — Export every page of a PDF as a JPG image.
- JPG to PDF — Turn one or many JPG photos into a single PDF.
- Protect PDF — Add a password and set permissions on a PDF.