Fill a PDF form
pdf_form_fillFill PDF form fields by name with text, checkboxes, radio groups, dropdowns, and lists; optionally flatten answers into the page.
Instructions
Fill PDF form fields by name (get names from pdf_form_fields): text as strings, checkboxes as true/false, radio groups and dropdowns by option text, lists as arrays. Optionally flatten (bake the answers into the page, no longer editable). Only changed fields are redrawn. Text the standard font cannot draw (Arabic…) is kept and viewers are asked to draw it, but cannot be flattened. Web version: https://s3eidat.github.io/pdf-fill/
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | The PDF: a local file path (absolute, or relative to the server's --root) or base64 data (raw or a data: URI). | |
| output | No | Where to write the result: a file path, or a folder ending in "/". Default: the server output folder (a temp folder unless --out-dir is set). | |
| values | Yes | Field name -> value, e.g. {"name": "Sara", "agree": true, "plan": "pro", "langs": ["Arabic"]}. | |
| flatten | No | Flatten the form after filling (fields become plain page content). | |
| returnBase64 | No | Also return the output as base64 in the result (only for small files). Default false. | |
| ignoreUnknown | No | Skip names that are not in the form instead of failing. |