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 (binary data, base64 string, or URL) and provide form field values as JSON. This node is useful for automating the population of PDF forms such as applications, contracts, invoices, or any standardized documents requiring dynamic data insertion.

Practical examples include:

  • Automatically filling out customer information on contract templates.
  • Generating personalized certificates or letters in bulk from a dataset.
  • Populating invoice forms with transaction details fetched from other systems.

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), 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 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 (one filled PDF) or Multiple Documents (bulk generation).
Form Data (JSON) JSON object containing form field names and values for filling a single PDF document.
Data List (JSON Array) JSON array containing multiple data objects for generating multiple PDF 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 (typically "json").
Meta Data Additional metadata for the PDF as a string (optional).
Meta Data JSON Additional metadata for the PDF in JSON string format (optional).
Output File Name Name for the output PDF file when generating 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 property in the node's output.

Output

The node outputs one or more PDF files with the form fields filled according to the provided data. The output includes:

  • A JSON object representing the result metadata.
  • Binary data containing the generated PDF file(s).

For single document mode, the output contains one PDF file. For multiple documents mode, it outputs multiple PDFs, each 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 indicated in the source code snippet; however, the node likely depends on internal PDF processing libraries or services bundled within the node implementation.
  • No special environment variables or n8n configurations are explicitly required based on the static analysis.

Troubleshooting

  • Common issues:

    • Incorrect or missing PDF template input (e.g., wrong binary field name, invalid base64 string, or inaccessible URL).
    • Malformed JSON in form data or data list properties.
    • Mismatch between form field names in JSON and actual PDF form fields.
    • Large data lists causing timeouts or memory issues if asynchronous processing is disabled.
  • Error messages and resolutions:

    • Errors related to missing PDF input: Verify that the PDF template is correctly provided according to the selected input data type.
    • JSON parsing errors: Ensure that the JSON strings for form data or data list are valid and properly formatted.
    • Output file naming conflicts: Check that output file names or prefixes do not cause overwriting or invalid file names.
    • If asynchronous processing is disabled for multiple documents, consider enabling it to avoid performance bottlenecks.

Links and References

Discussion