Actions80
- Add Attachment To PDF
- Add Barcode To PDF
- Add Form Fields To PDF
- Add HTML Header Footer
- Add Image Stamp To PDF
- Add Image Watermark To Image
- Add Margin To PDF
- Add Page Number To PDF
- Add Text Stamp To PDF
- Add Text Watermark To Image
- AI-Invoice Parser
- AI-Process Contract
- AI-Process HealthCard
- Classify Document
- Compress Image
- Compress PDF
- Convert HTML To PDF
- Convert Image Format
- Convert JSON To Excel
- Convert Markdown To PDF
- Convert PDF To Editable PDF Using OCR
- Convert PDF To Excel
- Convert PDF To PowerPoint
- Convert PDF To Word
- Convert To PDF
- Convert URL to PDF
- Convert VISIO
- Convert Word to PDF Form
- Create Images From PDF
- Create PDF/A
- Create Swiss QR Bill
- Crop Image
- Delete Blank Pages From PDF
- Delete Unwanted Pages From PDF
- Split PDF By Barcode
- Disable Tracking Changes In Word
- Enable Tracking Changes In Word
- Extract Attachment From PDF
- Extract Form Data From PDF
- Extract Pages From PDF
- Extract Resources
- Extract Table From PDF
- Extract Text By Expression
- Extract Text From Word
- Fill PDF Form
- Find And Replace Text
- Flip Image
- Flatten PDF
- Generate Barcode
- Generate Document Single
- Generate Documents Multiple
- Get Document From Pdf4me
- Get Image Metadata
- Get PDF Metadata
- Split PDF By Swiss QR
- Get Tracking Changes In Word
- Image Extract Text
- Linearize PDF
- Merge Multiple PDFs
- Overlay PDFs
- Parse Document
- Protect PDF
- Read Barcode From Image
- Read Barcode From PDF
- Read SwissQR Code
- Remove EXIF Tags From Image
- Repair PDF Document
- Replace Text With Image
- Replace Text With Image In Word
- Resize Image
- Rotate Document
- Rotate Image
- Rotate Image By EXIF Data
- Rotate PDF Page
- Sign PDF
- Split PDF By Text
- Split PDF Regular
- Unlock PDF
- Update Hyperlinks Annotation
- Upload File To PDF4me
Overview
This node operation "Add Form Fields To PDF" allows users to insert interactive form fields into an existing PDF document. It supports adding text input boxes and checkboxes at specified positions on one or more pages of the PDF. This is useful for automating the creation of fillable PDF forms, such as surveys, contracts, or applications, where end-users can enter data directly into the PDF.
Practical examples include:
- Adding a text box for a user to enter their name or comments.
- Adding checkboxes for multiple-choice questions or agreement confirmations.
- Automating the generation of customized PDF forms with predefined fields for data collection.
Properties
| Name | Meaning |
|---|---|
| PDF Input Data Type | How the PDF file is provided: "Binary Data" (from previous node), "Base64 String" (base64 encoded content), or "URL" (link to PDF file). |
| PDF Binary Field | Name of the binary property containing the PDF file when using "Binary Data" input type. |
| PDF Base64 Content | Base64 encoded string of the PDF content when using "Base64 String" input type. |
| PDF URL | URL to the PDF file when using "URL" input type. |
| Initial Value | The initial value to set inside the form field (must be a string). |
| Position X | Horizontal position of the form field on the page. If alignment is Left, this is the gap from left edge; if Right, gap from right edge; ignored if Center alignment. |
| Position Y | Vertical position of the form field on the page. If alignment is Top, this is the gap from top edge; if Bottom, gap from bottom edge; ignored if Middle alignment. |
| Field Name | Name identifier for the form field (string). |
| Size | Size of the form field (integer). |
| Pages | Comma-separated list or ranges of page indices where the form field should be added (e.g., "1, 2, 3-7"). Leave empty to apply to all pages. |
| Form Field Type | Type of form field to add: "Text Box" (text input) or "Check Box" (checkbox). |
| Output File Name | Filename for the output PDF with the added form fields. |
| Async | Boolean flag to enable asynchronous processing. |
| Binary Data Output Name | Custom name for the binary data property in the node's output containing the modified PDF. |
Output
The node outputs the modified PDF file with the newly added form fields as binary data. The binary data is accessible under a customizable property name (default is "data"). The output JSON typically contains metadata about the operation and the binary data representing the updated PDF file ready for further use or download.
If the node processes multiple input items, it returns an array of outputs corresponding to each input.
Dependencies
- Requires access to the original PDF file either as binary data, base64 string, or via a URL.
- No explicit external API keys or services are indicated in the source code snippet.
- The node relies on internal bundled actions to perform PDF manipulation.
- Asynchronous processing can be enabled for potentially long-running operations.
Troubleshooting
- Common issues:
- Incorrect page indices format may cause no fields to be added or errors.
- Providing invalid or corrupted PDF input data will result in failure to process.
- Mismatch between the expected binary property name and actual input binary data property.
- Setting non-string values for "Initial Value" or "Field Name" may cause errors.
- Error messages:
- Errors related to missing or unreadable PDF input usually indicate incorrect input data or property names.
- Validation errors for required parameters like position coordinates or field size.
- Resolutions:
- Verify the input PDF data is correctly passed and matches the selected input type.
- Ensure page indices are properly formatted.
- Confirm that all required properties are set and valid.
- Enable "Continue On Fail" option to handle errors gracefully during batch processing.
Links and References
- PDF Form Fields Specification (Adobe PDF Reference)
- n8n Documentation for general node usage and binary data handling
- Tutorials on creating fillable PDFs with JavaScript libraries (e.g., pdf-lib, PDFKit) for conceptual understanding