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 overlays one PDF document on top of another, effectively merging two PDFs by placing the "layer" PDF over the "base" PDF. This operation is useful when you want to add watermarks, stamps, or any additional content from one PDF onto another without altering the original files separately.

Common scenarios include:

  • Adding a company logo or watermark PDF layer onto official documents.
  • Combining form templates with filled data layers.
  • Overlaying annotations or signatures stored as separate PDFs onto base documents.

For example, you might have a base contract PDF and a signature PDF; this node can overlay the signature onto the contract to produce a single combined PDF.

Properties

Name Meaning
Base PDF Input Type How to provide the base PDF file. Options: Binary Data (from previous node), Base64 String (direct content), URL (link to PDF).
Layer PDF Input Type How to provide the layer PDF file. Options: Binary Data (from previous node), Base64 String (direct content), URL (link to PDF).
Base PDF Binary Field The name of the binary property containing the base PDF file (used if Base PDF Input Type is Binary Data).
Layer PDF Binary Field The name of the binary property containing the layer PDF file (used if Layer PDF Input Type is Binary Data).
Base PDF Base64 Content Base64 encoded content of the base PDF (used if Base PDF Input Type is Base64 String).
Layer PDF Base64 Content Base64 encoded content of the layer PDF (used if Layer PDF Input Type is Base64 String).
Base PDF URL URL pointing to the base PDF file (used if Base PDF Input Type is URL).
Layer PDF URL URL pointing to the layer PDF file (used if Layer PDF Input Type is URL).
Output File Name Desired filename for the resulting overlayed PDF file. Defaults to overlayed_output.pdf.
Advanced Options Optional JSON string to specify custom profiles or extra options for the API call, allowing fine-tuning of the overlay process. Example usage includes setting output data format or other API-specific parameters.

Output

The node outputs a JSON object containing the overlayed PDF file. The main output is typically in binary form representing the combined PDF document. The output binary data can be used downstream in workflows for saving, sending, or further processing.

If the advanced options specify output formats like base64, the output may also include the PDF content encoded accordingly.

Dependencies

  • Requires access to an external PDF processing API service that performs the overlay operation.
  • Needs proper API authentication configured in n8n (e.g., an API key credential).
  • Network access to fetch PDFs if URLs are provided as input.
  • No internal dependencies beyond standard n8n environment and the external PDF API.

Troubleshooting

  • Common issues:

    • Providing incorrect binary property names will cause the node to fail to find the input PDF files.
    • Invalid or inaccessible URLs will result in download errors.
    • Malformed base64 strings will cause decoding failures.
    • Missing or invalid API credentials will prevent successful API calls.
  • Error messages:

    • "Binary property not found": Check that the binary field names match those in the incoming data.
    • "Failed to fetch PDF from URL": Verify the URL is correct and accessible.
    • "Invalid base64 content": Ensure the base64 string is properly encoded without extra characters.
    • API errors related to authentication or quota limits: Confirm API key validity and usage limits.

Resolving these usually involves verifying inputs, ensuring credentials are set up correctly, and checking network connectivity.

Links and References

Discussion