Fill PDF Form
AI-generatedSummary
Fill an existing PDF by adding custom text overlays at specified positions, font sizes, colors, rotations, and pages.
Inputs
- PDF Source (required) — Select whether to load the PDF from a URL or from binary data in the workflow.
- PDF URL (required) — When PDF Source is 'From URL', provide the URL of the PDF to fill.
- Binary Property (required) — When PDF Source is 'From Binary Data', specify the binary property name containing the PDF.
- Fields Mode (required) — Choose how to define the text fields: individually in the UI or via JavaScript code to generate them programmatically.
- Text Fields — When Fields Mode is 'Define in UI', add one or more text fields with properties: text, x and y coordinates (in points), font size, page number (0-indexed), color (hex), and rotation (degrees).
- Fields Code — When Fields Mode is 'Use JavaScript Code', provide JavaScript code that returns an array of field objects with text, x, y, fontSize, page, color, and rotation properties. The code runs with access to workflow inputs.
- Output Property Name — Name of the binary property to use for storing the resulting PDF with the filled text overlays. Defaults to 'data'.
Output shape
a single binary PDF file per input item
The output contains the original input JSON plus the binary property (default 'data') holding the modified PDF document with text overlays applied. The operation throws errors if loading or writing the PDF fails. Coordinates are in PDF points, origin at bottom-left. Page numbering is zero-based.
Examples
Example 1: Fill a PDF from a URL with two text overlays defined in the UI, specifying positions, font sizes, colors, rotations, and pages.
Set 'PDF Source' to 'From URL', specify 'PDF URL', select 'Fields Mode' as 'Define in UI', add text fields with required properties, and define output name or use default.
Example 2: Programmatically generate text overlays on a PDF loaded from binary and output the modified PDF.
Set 'PDF Source' to 'From Binary Data', specify the 'Binary Property' containing the PDF, select 'Fields Mode' as 'Use JavaScript Code' and provide code returning an array of field objects, then specify output property.