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 additional content as a transparent overlay on an existing PDF without altering the original base content.

Common scenarios include:

  • Adding a company logo or watermark to official documents.
  • Overlaying signatures or stamps onto contracts or forms.
  • Combining multiple PDF layers for review or presentation purposes.

For example, you might have a base PDF invoice and want to overlay a "Paid" stamp PDF on top before sending it out.

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 Name of the binary property containing the base PDF file (used if Base PDF Input Type is Binary Data).
Layer PDF Binary Field 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 to the base PDF file (used if Base PDF Input Type is URL).
Layer PDF URL URL 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 Custom JSON profiles to adjust extra properties for the API call, allowing advanced customization of the overlay process.
Binary Data Output Name Custom name for the binary data field in the node's output. Defaults to data.

Output

The node outputs the overlayed PDF as binary data under the specified binary data output name (default data). The output contains the combined PDF file with the layer PDF content placed over the base PDF.

The output JSON typically includes metadata about the file, and the binary data represents the final PDF document ready for further processing or saving.

Dependencies

  • Requires access to the PDF4me API service to perform the overlay operation.
  • Needs an API key credential configured in n8n to authenticate requests to the PDF4me service.
  • Internet access is required if URLs are used to fetch the base or layer PDFs.

Troubleshooting

  • Common issues:

    • Incorrect binary property names may cause the node to fail to find the input PDF files.
    • Invalid or inaccessible URLs will result in errors fetching the PDFs.
    • Malformed base64 strings can cause decoding failures.
    • Missing or invalid API credentials will prevent successful API calls.
  • Error messages and resolutions:

    • "File not found in binary property" — Verify that the binary property names match those in the incoming data.
    • "Failed to fetch PDF from URL" — Check the URL accessibility and correctness.
    • "Invalid base64 content" — Ensure the base64 string is properly encoded without extra characters.
    • "Authentication failed" — Confirm that the API key credential is correctly set up and valid.

Links and References

Discussion