Flatten Form
flatten_formFlatten interactive PDF forms to freeze filled values while removing editable fields. Preserve the visual appearance for distribution, with options for CJK text and tagged PDFs.
Instructions
Flatten an existing PDF's interactive form (AcroForm), keeping the filled appearance while removing interactivity. Use it to freeze values before distribution. If existing values contain CJK text, set fontPath or PDF_WRITER_FONT in case appearances must be regenerated. On tagged PDFs, Widget annotations disappear and Form structure elements are left dangling, so it refuses by default (allowBreakingTags: true to force).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fontPath | No | Font for appearance regeneration. Falls back to the PDF_WRITER_FONT environment variable, then the standard font. Not needed when existing appearances can be reused, but required for CJK forms that need regeneration. | |
| inputPath | Yes | Absolute path of the target PDF. | |
| outputPath | No | Destination file path (absolute). When omitted, a base64 string is returned instead. | |
| returnBase64 | No | When true, include a base64 string in the result in addition to saving. | |
| allowBreakingTags | No | Allow flattening even on a tagged PDF. Default false. | |
| allowBreakingSignatures | No | When the target is digitally signed (detected via /ByteRange), the default is an error. Set true to proceed, accepting that the signatures become invalid. |