Overview
This node fills PDF forms by mapping keys in the PDF form to corresponding values provided in a JSON configuration. It is useful for automating the process of populating PDF forms with dynamic data, such as filling out contracts, applications, or any standardized PDF documents. The node supports handwritten-style fonts for text fields, enhancing the appearance of filled forms.
Use Case Examples
- Automatically fill out a PDF contract with client information from a CRM system.
- Generate completed application forms by mapping user input data to PDF form fields.
- Create personalized certificates by filling PDF templates with recipient names and details.
Properties
| Name | Meaning |
|---|---|
| Property Name | Name of the binary property which holds the PDF document to be used as input. |
| Property Name Out | Name of the binary property where the filled PDF document will be stored as output. |
| Configuration JSON | JSON object used to map the keys in the PDF form to the corresponding values to fill in the form fields. |
Output
Binary
Contains the filled PDF document as binary data under the specified output property name.
JSON
json- Original JSON data from the input item, unchanged.binary- Binary data of the filled PDF document, ready for further processing or download.
Dependencies
- pdf-lib library for PDF manipulation
- fontkit for font embedding
- Node.js fs/promises and path modules for font file handling
Troubleshooting
- Ensure the input binary property contains a valid PDF file; otherwise, the node will throw an error indicating the wrong MIME type.
- If font files fail to load, the node will throw an error specifying which font failed; verify font files exist in the expected directory.
- Malformed or incorrect JSON configuration for mapping keys to values can cause the form filling to fail or produce incorrect output.
- If the node is set to continue on fail, errors will be included in the output item; otherwise, execution will stop on the first error.