Fill PDF form
pdf_fillFill AcroForm fields in any PDF and save the completed form or return it inline. Values are validated against existing field definitions, and the source file stays unchanged.
Instructions
Fill AcroForm form fields in a PDF and save or return the result. Field names must exist in the PDF (use pdf_inspect first). All values are strings; checkboxes take "true"/"false"; dropdown/radio/optionlist values must be one of the field's options; text values must respect the field's maxLength from pdf_inspect. The source PDF is never modified. Returns the filled PDF written to output_path, or inline as an application/pdf resource when output_path is omitted; an existing file at output_path is overwritten. Encrypted PDFs are rejected with decrypt advice (common for government blanks with an empty user password), and a rejected fill writes no file at all.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fields | Yes | Field name → string value (from pdf_inspect's fillTemplate) | |
| flatten | No | Bake values into page content and drop the AcroForm so fields are no longer editable | |
| pdf_path | Yes | Template PDF source: an absolute file path, an https:// URL, or a data:application/pdf;base64,… URI. Use a URL or data URI when this server runs remotely (Smithery, hosted gateways) where local paths do not exist. | |
| output_path | No | Absolute path to write the result. Omit when running remotely: the PDF is then returned inline as an application/pdf resource for the client to save. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bytes | Yes | Size of the produced PDF in bytes | |
| output_path | No | Absolute path written, when output_path was supplied | |
| resource_uri | No | pdfops:// uri of the inline application/pdf resource, when output_path was omitted |