PDF4me icon

PDF4me

Comprehensive PDF and document processing: generate barcodes, convert files, extract data, manipulate images, and automate workflows with the PDF4ME API

Actions80

Overview

The node provides functionality to fill PDF forms using a given PDF template and form data. It supports filling either a single PDF document or generating multiple documents from a list of data objects. Users can supply the PDF template in various formats such as binary data, base64 string, or via a URL. This node is useful for automating the population of PDF forms with dynamic data, such as generating filled contracts, invoices, applications, or any standardized form that requires data insertion.

Practical examples include:

  • Automatically filling out customer information on contract templates.
  • Generating personalized certificates or letters by populating PDF forms with user data.
  • Batch processing multiple form entries to create individual PDFs for each record.

Properties

Name Meaning
PDF Input Data Type Choose how to provide the PDF template file. Options: Binary Data (from previous node), Base64 String (direct content), 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 PDF content when using Base64 String input type.
PDF URL URL to the PDF file when using URL input type.
Data Type Choose whether to fill a single document or generate multiple documents. Options: Single Document (fill one PDF with JSON data), Multiple Documents (generate many PDFs from a list of data).
Form Data (JSON) JSON object containing form field names and values for filling a single document.
Data List (JSON Array) JSON array containing multiple data objects for generating multiple documents.
Output Type Output type of the generated file, specified as a string (e.g., "pdf").
Input Data Type Input data type as a string (e.g., "json").
Meta Data Additional metadata for the PDF as a string.
Meta Data JSON Additional JSON metadata for the PDF as a string.
Output File Name Name for the output PDF file when filling a single document.
Output File Name Prefix Prefix for output file names when generating multiple documents.
Async Enable asynchronous processing (recommended for multiple documents). Boolean value.
Binary Data Output Name Custom name for the binary data in the node's output.

Output

The node outputs the filled PDF(s) as binary data attached to the output item(s). The binary data contains the generated PDF file(s) with the form fields populated according to the provided JSON data. For single document mode, the output includes one item with the filled PDF. For multiple documents mode, the output includes multiple items, each containing one filled PDF corresponding to an entry in the data list.

The binary data field name can be customized via the "Binary Data Output Name" property.

Dependencies

  • Requires access to the PDF template file, which can be provided as binary data, base64 string, or URL.
  • No explicit external API keys or services are mentioned in the code snippet; however, the node likely depends on internal PDF processing libraries or services bundled within the node implementation.
  • Proper configuration of input data format and correct JSON structure for form data is necessary.

Troubleshooting

  • Common issues:

    • Incorrect or malformed JSON in "Form Data (JSON)" or "Data List (JSON Array)" properties may cause errors during form filling.
    • Providing an invalid or inaccessible URL for the PDF template will result in failure to load the template.
    • Mismatch between form field names in the JSON data and actual PDF form fields may lead to unfilled fields.
    • Using incorrect binary property name when supplying PDF as binary data will cause the node to fail to find the template.
    • Large data lists without enabling asynchronous processing might cause performance issues or timeouts.
  • Error messages and resolutions:

    • Errors related to missing PDF template: Verify the input method and ensure the PDF file is correctly supplied.
    • JSON parsing errors: Validate JSON syntax before inputting.
    • Timeout or memory errors when processing multiple documents: Enable asynchronous processing or reduce batch size.

Links and References

(Note: These links are general references related to PDF form filling and n8n usage, as no direct external API documentation was found in the source.)

Discussion