Fill / flatten an existing AcroForm
fill_formFill AcroForm fields in an existing PDF with text, choices, or booleans, and optionally flatten them into page content while preserving existing digital signatures.
Instructions
Fill and/or flatten the AcroForm of an EXISTING PDF (add_form creates one) as an incremental update — prior signatures stay valid for their revision. values: fully-qualified name → string (array for multi-select), boolean or export state for checkbox/radio. flatten:true stamps appearances and drops the interactive layer (with no values = pure flatten). Unknown names → FORM_FIELD_NOT_FOUND unless onUnknownField:'ignore'; signature fields cannot be filled (FORM_UNSUPPORTED). Encrypted sources: password.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| values | No | Map of fully-qualified field name → value. Text/choice: a string (array of strings for multi-select listboxes). Checkbox/radio: a boolean or the export-state string. Omit (or pass {}) with flatten:true for a pure flatten. | |
| flatten | No | When true, stamp appearances into page content and remove the interactive fields after filling. | |
| password | No | Password (user or owner) of an encrypted source. Never logged or echoed. | |
| pdfBase64 | Yes | Base64-encoded source PDF containing the AcroForm to fill. Use read_form_fields first to discover field names. | |
| nonWinAnsi | No | Behaviour when a value contains non-WinAnsi characters (appearance font is Helvetica/WinAnsi). 'throw' (default) rejects it; 'needAppearances' writes the value and sets /NeedAppearances so the viewer regenerates the appearance. | throw |
| outputMode | No | 'base64' (default) returns the PDF inline; 'file' writes it inside the PDFNATIVE_MCP_OUTPUT_DIR sandbox (SECURITY_VIOLATION when the sandbox is not configured). | base64 |
| outputPath | No | Required when outputMode='file'. Relative path inside the sandbox; must end with .pdf. | |
| onUnknownField | No | Behaviour for a value key that matches no field. 'throw' (default) → FORM_FIELD_NOT_FOUND; 'ignore' skips it. | throw |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | Yes | ||
| summary | No | Tool-specific summary, when produced. | |
| filePath | No | Sandboxed absolute path (file mode). | |
| sizeBytes | Yes | ||
| diagnostics | No | PDF/A diagnostics (when includeDiagnostics=true). |