Fill the PDF
fill_pdfFill the PDF and return a download link (valid until the workspace expires).
`values` maps field id -> text (checkboxes: "yes"/"x"/"true" to tick).
`flatten=False` preserves existing form fields; it does not create fields
on scans. `fillable=True` creates interactive fields (subject to the
account's existing export entitlement) and takes precedence over flatten.
`editable`, `editable_widget_count` and `output_type` describe the actual PDF.
`editable` means at least one form widget is writable, not that all values are.
`warnings` lists text printed too small or cut off (with flatten=True
render_filled_preview reports them beforehand; with flatten=False editable
widgets are not measured). `output_mode` "watermarked" means the result
contains a JustFill watermark. A clean final output may consume one of the
account's existing fill entitlements; when none is available, the result
is watermarked.
Visual review gate & workflow routing:
- For ML-detected layouts (`source="ml"`), `fill_pdf` requires prior
`render_preview` and `render_filled_preview` calls (with matching `values`,
`flatten`, and `fillable` flags) on every populated page; otherwise it
returns `required_calls` without generating the PDF.
- Use `render_filled_preview` first to verify placement and text fit at no
cost; call `fill_pdf` only when ready to generate the downloadable PDF.
- Do not call `close_workspace` until the user has downloaded the file from
`download_url`.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| values | Yes | Non-empty mapping of `field_id` (from `open_pdf` or `list_fields`) to the string value to fill. Checkboxes tick on `'yes'`, `'x'`, or `'true'`. Must not contain restricted data (payment cards, PHI, government IDs, or authentication secrets). | |
| flatten | No | If `True` (default), flattens filled values into static page content. If `False`, preserves existing embedded AcroForm widgets as editable fields. | |
| fillable | No | If `True`, synthesizes interactive, editable AcroForm widgets for the fields in the output PDF (subject to account entitlement; takes precedence over `flatten`). | |
| workspace_id | Yes | Active workspace ID returned by `open_pdf` (`summary.workspace_id`). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||