跳到主要内容

叠加 PDFsn8n

叠加 PDFs 是一个 PDF4me 节点操作 n8n 放置一个 PDF 叠加在另一个之上,将两者合并到同一个位置。 pages 而不是附加它们。使用此功能,无需添加任何页面,即可在生成的内容上盖上设计好的信头,应用证书边框,或将已批准的模板覆盖在收到的文档上。

此节点的功能

PDF4me:叠加层 PDFs 需要两个 PDFs,一个 根据 它充当背景和 它位于顶部,并返回一个文档,其中两者都显示在同一位置。 pages每个文件都有自己的输入类型,因此基础数据可以来自之前的节点(二进制数据),而图层数据则可以从其他节点获取。 URL与合并不同,页面数量不会增加,因此它是信头、边框和模板印章的理想工具。

相关博客文章(1)

验证您的身份 API 要求

每一个 PDF4me 节点 n8n 需要有效 用于连接的凭证创建或选择一个可以容纳您的 PDF4me API 关键在于确保工作流程能够安全地验证叠加请求。

您不容错过的重要事实

叠加层未合并
合并追加项 pages 所以计数加起来了。叠加操作会将两个文档堆叠在同一层上。 pages页数保持不变。
两个文件,两种独立的输入类型
根据 PDF 输入类型和层 PDF 输入类型可以单独设置,因此一个文件可以是二进制数据,而另一个文件可以来自…… URL
秩序改变了哪些内容会保持可见。
该图层位于基层之上。纯色背景的图层可能会遮挡下方的内容,因此请先在一组示例图层上测试两种顺序。
n8n 中的 PDF4me 节点设置为“操作叠加 PDF”,基础 PDF 输入类型和图层 PDF 输入类型均为二进制数据,基础 PDF 二进制字段数据、图层 PDF 二进制字段数据、输出文件名 overlayed_output.pdf 和二进制数据输出名称均为数据。

PDF4me 叠加 PDFs 参数面板 n8n两种输入类型均设置为二进制数据

叠加 vs 合并 vs 水印

三种将额外内容引入到……的方法 PDF各自生成不同的文档。

方法对……的影响 pages最佳匹配
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

Overlay 的参数有哪些? PDFs 需要?

必需的: 操作、两种输入类型、与每种输入类型匹配的源字段以及输出文件名。二进制数据输出名称和“高级选项”下的任何内容均具有可用的默认值。

范围必需的它的作用例子
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

输出字段

一次成功的运行返回一个 n8n 携带组合的物品 PDF

场地类型它包含什么
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.

如何设置叠加层 PDFsn8n

  1. 添加 PDF4me 致你 n8n 工作流程并选择 叠加 PDFs 行动。
  2. 用于连接的凭证请选择您的 PDF4me 凭证或点击 创建新凭证 并粘贴你的 API 钥匙。
  3. 根据 PDF 输入类型PDF 输入类型它们是独立的,因此每个文件的到达方式可能不同。
  4. 填写匹配的来源字段,例如 根据 PDF 二元场PDF 二元场两者均默认为 data
  5. 输出文件名 (必须以……结尾) .pdf)。
  6. 执行节点并路由组合后的流量 PDF暴露于 二进制数据输出名称进入下一步。

典型配置

工作流程示例Common n8n workflow patterns using Overlay PDFs.
生成文件的信头
  1. 该文档由不带任何品牌标识的模板生成。
  2. 叠加 PDFs 使用经批准的信笺抬头 PDF 取自 URL 作为该层。
  3. 品牌成品未经设计师修改就直接寄出。
动态内容的证书框架
  1. 课程完成数据生成一个简单的 PDF 收件人姓名。
  2. 叠加 PDFs 将设计好的证书边框覆盖在上面。
  3. 每份证书都会通过电子邮件发送给收件人。
审核文件上的批准印章
  1. 文件完成工作流程中的审批步骤。
  2. 叠加 PDFs 应用预先设计并批准的印章层。
  3. 盖章后的副本归档到记录系统中。
批量模板应用程序
  1. “循环遍历项目”节点遍历包含供应商传入文档的文件夹。
  2. 叠加 PDFs 应用同一层 PDF 一个 URL 给每个人。
  3. 每份文件都以一致的格式进入档案馆。

实用技巧

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.

速查表

场地价值
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

常见问题

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.

相关操作

在其他平台上执行相同任务

获取帮助