Skip to main content

Overlay PDFs in n8n

Overlay PDFs is a PDF4me node action in n8n that places one PDF on top of another, combining both onto the same pages instead of appending them. Use it to stamp a designed letterhead over generated content, apply a certificate frame, or lay an approved template across an incoming document without adding a single page.

What this node does

PDF4me: Overlay PDFs takes two PDFs, a base that acts as the background and a layer that sits on top, and returns a single document where both appear on the same pages. Each file has its own input type, so the base can come from a previous node as Binary Data while the layer is pulled from a URL. Unlike merging, the page count does not grow, which is what makes it the right tool for letterheads, frames, and template stamps.

Related Blog Posts(1)

Authenticating Your API Request

Every PDF4me node in n8n requires a valid Credential to connect with. Create or select one that holds your PDF4me API key so the workflow can authenticate overlay requests securely.

Important Facts You Should Not Miss

Overlay is not merge
Merging appends pages so the count adds up. Overlaying stacks both documents on the same pages, leaving the page count unchanged.
Two files, two independent input types
Base PDF Input Type and Layer PDF Input Type are set separately, so one file can be Binary Data while the other arrives from a URL.
Order changes what stays visible
The layer sits on top of the base. A layer with a solid background can hide content underneath, so test both orderings on a sample pair first.
PDF4me node in n8n set to Action Overlay PDFs, with Base PDF Input Type and Layer PDF Input Type both Binary Data, Base PDF Binary Field data, Layer PDF Binary Field data, Output File Name overlayed_output.pdf, and Binary Data Output Name data

PDF4me Overlay PDFs parameters panel in n8n, with both input types set to Binary Data

Overlay vs Merge vs Watermark

Three ways to bring extra content into a PDF, each producing a different document.

ApproachEffect on the pagesBest fit
Overlay PDFsBoth documents appear on the same pages, page count unchangedBranding that already exists as a designed PDF, such as a letterhead or certificate frame
Merge PDFsDocuments follow one another, page counts add upContent that genuinely belongs in sequence as one longer document
Add watermarkSimple text or a single image drawn onto the existing pagesA short notice such as DRAFT or CONFIDENTIAL, where no designed PDF layer exists

What Parameters Does Overlay PDFs Need?

Required: Action, both input types, the source field matching each input type, and Output File Name. Binary Data Output Name and anything under Advanced Options carry working defaults.

ParameterRequiredWhat it doesExample
ActionRequiredSelects the PDF4me node action to run. Choose Overlay PDFs.Overlay PDFs
Base PDF Input TypeRequiredFormat of the background PDF. Choose Binary Data, Base64 String, or URL. Independent of the layer setting.Binary Data
Layer PDF Input TypeRequiredFormat of the PDF placed on top. Choose Binary Data, Base64 String, or URL. Independent of the base setting.Binary Data
Base PDF Binary FieldConditionalName of the binary property holding the base PDF. Required when Base PDF Input Type is Binary Data.data
Layer PDF Binary FieldConditionalName of the binary property holding the layer PDF. Required when Layer PDF Input Type is Binary Data.data
Base PDF Base64 ContentConditionalBase64-encoded content of the base PDF. Required when Base PDF Input Type is Base64 String.JVBERi0xLjQK...
Layer PDF Base64 ContentConditionalBase64-encoded content of the layer PDF. Required when Layer PDF Input Type is Base64 String.JVBERi0xLjQK...
Base PDF File URLConditionalPublicly reachable HTTPS URL to the base PDF. Required when Base PDF Input Type is URL.https://example.com/base.pdf
Layer PDF File URLConditionalPublicly reachable HTTPS URL to the layer PDF. Required when Layer PDF Input Type is URL.https://example.com/letterhead.pdf
Output File NameRequiredFilename for the combined PDF. Include the .pdf extension.overlayed_output.pdf
Binary Data Output NameOptionalName of the binary property the output item exposes. Defaults to data.data
Advanced OptionsOptionalCollection for extra processing settings, added with Add Option. Leave empty unless you have a specific requirement.No properties

Output Fields

A successful run returns one n8n item carrying the combined PDF.

FieldTypeWhat it contains
Binary (data)BinaryThe combined PDF with the layer placed over the base, under Binary Data Output Name (default data).
fileNameStringGenerated filename, matching Output File Name.
mimeTypeStringMIME type of the output, always application/pdf.
fileSizeNumberSize of the combined PDF in bytes.
docNameStringDocument name reference for the processed file, matching fileName.
overlayCompletedBooleanConfirms the overlay operation finished, useful as an explicit check that the layer was applied.
layersProcessedNumberCount of PDF layers combined into the final document.
successBooleanTrue when the operation completed, false on failure. Use it to branch error handling.
messageStringHuman-readable status message, carrying success confirmation or error detail.

How Do I Set Up Overlay PDFs in n8n?

  1. Add PDF4me to your n8n workflow and choose the Overlay PDFs action.
  2. In Credential to connect with, select your PDF4me credential or click Create New Credential and paste your API key.
  3. Set Base PDF Input Type and Layer PDF Input Type. They are independent, so each file can arrive differently.
  4. Fill in the matching source fields, for example Base PDF Binary Field and Layer PDF Binary Field, both defaulting to data.
  5. Set Output File Name (must end in .pdf).
  6. Execute the node and route the combined PDF, exposed under Binary Data Output Name, into the next step.

Typical Setups

Workflow ExamplesCommon n8n workflow patterns using Overlay PDFs.
Letterhead on generated documents
  1. A document is generated from a template with no branding.
  2. Overlay PDFs applies the approved letterhead PDF fetched from a URL as the layer.
  3. The branded result is sent out without a designer touching it.
Certificate frame over dynamic content
  1. Course completion data produces a plain PDF with the recipient name.
  2. Overlay PDFs places the designed certificate border over it.
  3. Each finished certificate is emailed to its recipient.
Approval stamp on review documents
  1. A document completes an approval step in the workflow.
  2. Overlay PDFs applies a pre-designed approved stamp layer.
  3. The stamped copy is filed to the record system.
Batch template application
  1. A Loop Over Items node iterates a folder of incoming supplier documents.
  2. Overlay PDFs applies the same layer PDF from a URL to each one.
  3. Every document enters the archive with consistent framing.

Practical Tips

Test both orderings before a batch run
Swapping which file is base and which is layer changes what stays visible. Prove it on one sample pair rather than discovering it across a hundred documents.
Design the layer with transparency in mind
A layer PDF with a solid white background will hide the base underneath. Frames, borders, and letterheads work best when the middle is genuinely empty.
Match page sizes where you can
A layer built at the same page size as the base lines up predictably. Mismatched geometry is the usual reason a stamp lands in the wrong place.
Mix input types to avoid extra nodes
Keeping a static letterhead at a URL while the base arrives as binary from the previous node saves fetching the template into the workflow separately.
Reach for merge when page count should grow
If the second document is meant to be read after the first rather than on top of it, Merge Multiple PDFs is the correct action.
Check overlayCompleted alongside success
The output carries an explicit overlay confirmation flag, which is a more specific signal than the generic success boolean alone.

Cheat Sheet

FieldValue
ActionOverlay PDFs
Base PDF Input TypeBinary Data
Layer PDF Input TypeBinary Data
Base PDF Binary Fielddata
Layer PDF Binary Fielddata
Output File Nameoverlayed_output.pdf
Binary Data Output Namedata
Advanced OptionsNo properties
CredentialsPDF4me API credential

Common Questions

What is the difference between overlaying PDFs and merging PDFs?+
Merging appends documents so the page count adds up and the files read one after another. Overlaying places the layer PDF on top of the base PDF on the same pages, so the page count does not grow and both sets of content appear together. Use overlay for letterheads, watermarks, and template stamps, and use merge when documents should follow each other.
Which file should be the base and which should be the layer?+
The base PDF is the background, and the layer PDF is placed on top of it, following the page content model described in the ISO 32000 PDF specification. For a letterhead applied to generated content, the content is usually the base and the branded template is the layer. If the layer has a solid background it can obscure what sits beneath, so test the order both ways on a sample first.
What happens if the two PDFs have different page counts?+
The two documents do not have to be identical, but the result is easiest to predict when they match or when the layer is a single page intended to repeat as a stamp. Run one representative pair through the node and inspect the output before committing a batch, since mismatched lengths are the most common cause of a surprising result.
Can the base and layer PDFs come from different sources?+
Yes. Base PDF Input Type and Layer PDF Input Type are set independently, so the base can arrive as Binary Data from a previous node in your n8n workflow while the layer is fetched from a URL, or any other combination.
Should I use Overlay PDFs or a watermark action for branding?+
Use a watermark action when you want simple text or a single image placed on the pages. Use Overlay PDFs when your branding already exists as a full PDF, such as a designed letterhead or a pre-approved certificate frame, because it preserves the layer document exactly as designed.

Same Task on Other Platforms

Get Help