Skip to main content

Overlay PDFs using n8n action

PDF4me Overlay PDFs merges two PDF documents by overlaying one on top of another through n8n automation workflows. Process base and layer PDFs via n8n triggers, binary data, base64 strings, or public URLs to combine documents with page-specific overlay targeting, transparency support, preserved formatting, and layered content composition. This solution is ideal for watermark application, background addition, letterhead merging, stamp overlays, form overlays, and automated PDF layering workflows that require precise document combination with professional layer composition and seamless integration.

Setup

Add the PDF4me "Overlay PDFs" node to your n8n workflow and configure the required parameters. For initial setup instructions, see our n8n Integration Guide.

Prerequisites:

  • PDF4me API credentials
  • n8n workflow access

Configuration:

  1. Add PDF4me node to workflow
  2. Select "Overlay PDFs" action
  3. Configure input parameters (see below)
Overlay PDFs

Parameters

Complete list of parameters for the Merge two PDF files one over another as Overlay action. Configure these parameters to control PDF overlay merging.

Important: Parameters marked with an asterisk (***) are required and must be provided for the action to function correctly.

ParameterTypeDescriptionExample
Base PDF Input Type***StringBase PDF Input Format
• Choose the format for the base PDF file (background layer)
• PDF4me supports multiple input types
• Options: Binary Data, Base64 String, or URL
Binary Data
Base PDF Binary FieldStringBase PDF Binary Data Reference (Required if Binary Data)
• Specify the property name for accessing base PDF binary data
• Should match the binary data property name in your workflow
• Required when Base PDF Input Type is "Binary Data"
data
Base PDF Base64 ContentStringBase PDF Base64 Encoded Input (Required if Base64 String)
• Provide base PDF data as base64 encoded string
• PDF4me automatically decodes and processes the PDF content
• Required when Base PDF Input Type is "Base64 String"
UEsDBBQABgAI...
Base PDF File URLStringBase PDF Public URL Input (Required if URL)
• Provide a public/open permission URL to the base PDF file
• PDF4me downloads and processes the file from the provided URL
• Required when Base PDF Input Type is "URL"
https://abc.com/base.pdf
Layer PDF Input Type***StringLayer PDF Input Format
• Choose the format for the layer PDF file (overlay layer)
• PDF4me supports multiple input types
• Options: Binary Data, Base64 String, or URL
Binary Data
Layer PDF Binary FieldStringLayer PDF Binary Data Reference (Required if Binary Data)
• Specify the property name for accessing layer PDF binary data
• Should match the binary data property name in your workflow
• Required when Layer PDF Input Type is "Binary Data"
data
Layer PDF Base64 ContentStringLayer PDF Base64 Encoded Input (Required if Base64 String)
• Provide layer PDF data as base64 encoded string
• PDF4me automatically decodes and processes the PDF content
• Required when Layer PDF Input Type is "Base64 String"
UEsDBBQABgAI...
Layer PDF File URLStringLayer PDF Public URL Input (Required if URL)
• Provide a public/open permission URL to the layer PDF file
• PDF4me downloads and processes the file from the provided URL
• Required when Layer PDF Input Type is "URL"
https://abc.com/layer.pdf
Output File Name***StringOverlaid PDF Output Filename
• Specify the name for the generated overlaid PDF file
• Must include .pdf extension
• PDF4me ensures unique naming and format validation
overlayed_output.pdf
Binary Data Output Name***StringBinary Data Mapping
• Define the variable name for accessing generated overlaid PDF data
• Used in subsequent workflow actions
• Essential for workflow data flow
data

Advanced Options

The following parameters are available in the Advanced Options section and are optional:

ParameterTypeDescriptionExample
Custom ProfilesStringCustom Configuration Profiles
• Set additional options using custom profiles
• JSON-like format containing predefined parameters
• Supports outputDataFormat, preserveMetadata, etc.
• Optional for specialized requirements
{ "outputDataFormat": "base64", "preserveMetadata": true, "optimizeForPrinting": false, "compressionLevel": "medium" }

Output

Output Parameters

ParameterTypeDescriptionExample
successBooleanPDF4me overlay operation status indicator - Boolean flag indicating the success or failure of the PDF overlay process. PDF4me returns true for successful operations and false for any errors, enabling robust error handling in automated workflowstrue
messageStringPDF4me overlay operation status message - Human-readable status message providing details about the overlay process result. Includes success confirmation or error details for troubleshootingPDFs overlaid successfully
fileNameStringPDF4me generated overlaid PDF filename - The complete filename of the successfully generated overlaid PDF document with proper .pdf extension. PDF4me ensures unique naming and validates file format compliance for seamless integration with downstream processesoverlayed_output.pdf
mimeTypeStringPDF4me output MIME type - MIME type of the generated PDF file, always "application/pdf" for PDF documents. Useful for content type validation and proper file handling in web applicationsapplication/pdf
fileSizeNumberPDF4me overlaid PDF file size in bytes - The exact size of the generated overlaid PDF file in bytes, provided by PDF4me for storage planning, bandwidth optimization, and file transfer monitoring. Essential for enterprise document management and workflow automation125430
docNameStringPDF4me document name reference - The name of the processed overlaid document for reference and tracking purposes. This matches the fileName for consistency in document management workflowsoverlayed_output.pdf
overlayCompletedBooleanPDF4me overlay completion confirmation - Boolean flag confirming that the PDF overlay operation has been successfully completed. Useful for verifying that the overlay was applied correctlytrue
layersProcessedNumberPDF4me layers processed count - The number of PDF layers that were successfully processed and overlaid in the final document. Useful for tracking overlay completeness and document enhancement verification2

N8N Action Response

The PDF4me Overlay PDFs API returns a response that can be viewed in multiple formats. Choose the view that best fits your needs:

JSON Response Format

The raw JSON response from the API:

[
{
"success": true,
"message": "PDFs overlaid successfully",
"fileName": "overlayed_output.pdf",
"mimeType": "application/pdf",
"fileSize": 125430,
"docName": "overlayed_output.pdf",
"overlayCompleted": true,
"layersProcessed": 2
}
]

Use Cases

Document Enhancement and Branding

  • Overlay company logos, watermarks, or branding elements onto existing PDF documents
  • Add headers, footers, or decorative elements to enhance document appearance
  • Apply consistent visual branding across multiple documents by overlaying standard templates

Form and Template Integration

  • Overlay form fields or interactive elements onto existing PDF documents
  • Add signature blocks, approval sections, or other form components to documents
  • Integrate standardized templates with dynamic content for consistent document formatting

Document Annotation and Markup

  • Overlay annotations, comments, or markup layers onto PDF documents for review processes
  • Add revision marks, change tracking, or approval stamps to documents
  • Create layered documents with different levels of information or access permissions

Get Help