跳到主要内容

添加文字图章 PDFn8n

添加文字图章 PDF 是一个 n8n 节点 PDF4me 在文本上叠加自定义文本(机密、草稿、已批准或任何自定义字符串) PDF 页面可精确控制对齐方式、字体、颜色、不透明度和旋转角度。可用于保密标记、审批印章、草稿标签或自动文档品牌化,无需手动编辑。

此节点的功能

PDF4me:添加文字图章 PDF 将文本字符串渲染到每个目标页面的指定水平和垂直位置,并可控制字体大小、字体颜色、不透明度、旋转角度、边距以及背景/前景图层。接受源文件。 PDF 通过二进制数据, Base64 字符串,或 URL非常适合用于保密标签、草稿标记、批准印章、版权声明和斜角水印风格的品牌标识。

相关博客文章
目前尚无关于此功能的博客文章——敬请期待。
在此期间,您可以浏览 PDF4me 博客,查看适用于各平台的教程和工作流程。
访问博客

验证您的身份 API 要求

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

您不容错过的重要事实

真正需要填写的字段只有 6 个。
底层 PDF4me API 只需要 PDF 输入、输出文件名、文本、页数、水平对齐方式和垂直对齐方式。字体、颜色、不透明度、旋转角度、边距、背景和异步处理均有可用的默认值。
后台控件堆叠,而非可见性
Background true 会将水印渲染在现有页面内容的后面(水印效果很微妙);Background false(默认值)会将其渲染在顶部,非常适合用于可见的保密或批准标记。
旋转加调整不透明度,即可制作经典的斜角水印。
将旋转角度设置为 45,将不透明度降低到 30-50 左右,并启用背景,即可获得草稿和机密副本上使用的传统倾斜、半透明水印外观。
在 n8n 节点上配置“向 PDF 添加文本图章”操作,输入数据类型为二进制数据,输入二进制字段为数据,输出文件名为 document_with_text_stamp.pdf,文档名称为 document.pdf,文本内容为“机密”,页数为 1,水平对齐方式为居中,垂直对齐方式为居中,水平边距和垂直边距均为 0。

PDF4me 添加文字图章 PDF 节点参数面板 n8n

添加文本戳记需要哪些参数? PDF 需要?

必需的: 输入数据类型、输出文件名、文本、页数、水平对齐方式和垂直对齐方式。条件字段(输入二进制字段、Base64 文档内容、文件 URL)仅在选择其父级输入数据类型时才会显示。其他所有选项,包括文档名称、边距、不透明度、字体、旋转角度、背景、异步处理和二进制数据输出名称,均为可选,并具有默认值。

范围必需的它的作用例子
Input Data TypeRequiredFormat of the source PDF input. Choose Binary Data (from a previous node), Base64 String, or URL.Binary Data
Input Binary FieldConditionalName of the binary property on the incoming n8n item that holds the PDF. Required when Input Data Type is Binary Data. Defaults to data.data
Base64 Document ContentConditionalBase64-encoded PDF content. Required when Input Data Type is Base64 String.JVBERi0xLjQK...
File URLConditionalPublicly reachable HTTPS URL to the source PDF. Required when Input Data Type is URL.https://example.com/sample.pdf
Output File NameRequiredFilename for the stamped PDF output. Must include the .pdf extension.document_with_text_stamp.pdf
Document NameOptionalReference label for the source PDF, used for tracking only, not sent to the stamping engine.document.pdf
TextRequiredThe text string to stamp onto the page, such as a confidentiality label, draft marker, or custom watermark text.CONFIDENTIAL
PagesRequiredPages to stamp. Accepts a single page, a range, a mixed list, or an open range. All pages if left as "all".1 or 2-5 or 1,3,7-10
Horizontal AlignmentRequiredHorizontal position of the stamp on the page: Left, Center, or Right.Center
Vertical AlignmentRequiredVertical position of the stamp on the page: Top, Center, or Bottom.Center
Horizontal Margin (Mm)OptionalHorizontal margin in millimeters, applied from the aligned edge. Default 0.0
Vertical Margin (Mm)OptionalVertical margin in millimeters, applied from the aligned edge. Default 0.0
OpacityOptionalStamp transparency from 0 (invisible) to 100 (fully opaque). Default full opacity.50
Font SizeOptionalFont size in points, typically between 8 and 72.24
Font ColorOptionalStamp text color as a hex code.#FF0000
RotationOptionalRotation angle in degrees. 0 is horizontal, 45 is diagonal, 90 is vertical.45
BackgroundOptionalPlaces the stamp behind existing page content when true, or on top (foreground) when false. Default false.false
Async ProcessingOptionalProcesses large PDFs in the background when enabled, improving reliability for high-page-count documents.false
Binary Data Output NameOptionalName of the binary property the output item exposes. Default is data.data

高级选项

自定义配置文件(可选)
A JSON类似于预定义参数块,用于专门的冲压配置,例如 { "fontFamily": "Arial", "fontSize": 24, "fontColor": "#FF0000" }叠加在上面的各个字段之上。

输出字段

一次成功的运行返回一个 n8n 携带物品 JSON 元数据和带戳记的二进制文件 PDF

场地类型它包含什么
successBooleanTrue when the stamp was applied successfully. Use to route error-handling branches.
fileNameStringGenerated filename, matching Output File Name.
mimeTypeStringMIME type of the output, always application/pdf.
fileSizeNumberSize of the stamped PDF in bytes.
pageCountNumberNumber of pages processed with the text stamp.
Binary (data)BinaryThe stamped PDF under Binary Data Output Name (default data). Pass into Write Binary File, Email, or any cloud-storage upload.

如何设置添加文本图章 PDFn8n

  1. 添加 PDF4me 致你 n8n 工作流程并选择 添加文字图章 PDF 行动。
  2. 用于连接的凭证请选择您的 PDF4me 凭证或点击 创建新凭证 并粘贴你的 API 钥匙。
  3. 输入数据类型二进制数据 (默认), Base64 细绳, 或者 URL 并提供匹配的来源 PDF 场地。
  4. 输出文件名 (必须以……结尾) .pdf)并且可选 文档名称 用于跟踪。
  5. 进入 文本 (例如。 CONFIDENTIAL), 瞄准目标,并且 水平对齐 / 垂直对齐
  6. 可选择进行调校 水平边距垂直边距不透明度字体大小字体颜色旋转, 和 背景
  7. 使能够 异步处理 如有需要,可处理大型文档。执行节点并路由盖章。 PDF 进入下一步。

典型配置

工作流程示例Common n8n workflow patterns using Add Text Stamp to PDF.
对外分享前请加盖“机密”印章
  1. 当新文件进入“传出文档”文件夹时,Google 云端硬盘触发器就会触发。
  2. PDF4me 添加文字图章 PDF 文本设置为“机密”,水平对齐方式为居中,垂直对齐方式为顶部,字体颜色为红色。
  3. 盖章 PDF 已上传至“已审核”文件夹,并通过电子邮件发送给收件人。
生成的报告上带有斜角“DRAFT”水印
  1. 计划触发器会生成每周报告。 PDF 通过 PDF4me 生成文档。
  2. PDF4me 添加文字图章 PDF 使用文本 DRAFT、旋转 45、不透明度 30、背景为 true 运行,可获得微妙的对角水印。
  3. 带有水印的草稿会在最终批准前发布到 Slack 审核频道。
签字后在特定页面上盖上“已批准”印章
  1. 当经理在内部工具中将文档标记为已批准时,审批 webhook 就会触发。
  2. PDF4me 添加文字图章 PDF 运行文本为“已批准”,页面设置为仅签名页,垂直对齐方式为底部。
  3. 最终版 PDF 已存档 SharePoint 文件名中包含批准日期。
从托管的 PDF URL 进行批量盖章
  1. “循环遍历项目”节点遍历文档列表。 URL从数据库导出。
  2. PDF4me 添加文字图章 PDF 使用输入数据类型运行 URL, 文件 URL 每个项目单独设置,启用异步处理以提高可靠性。
  3. 每个加盖印章的输出都会以源记录 ID 作为文件名写入云存储。

实用技巧

Only 6 fields are required
Input, Output File Name, Text, Pages, Horizontal Alignment, and Vertical Alignment. Do not feel obligated to set every optional field.
Use Background true for subtle watermarks
Combine Background true with a lower Opacity (30-50) so the stamp does not obscure page content underneath.
Pages accepts open ranges
Use 2- to stamp from page 2 to the end, useful for skipping a cover page while stamping the rest.
Font Color must be a valid hex code
Values like #FF0000 work; unrecognized color names or malformed hex strings fail the request.
Enable Async Processing for large PDFs
Large or high-page-count documents benefit from asynchronous processing so the workflow execution does not time out.
Document Name is reference-only
It labels the source file for tracking; it does not affect stamping behavior or the output filename.

速查表

场地价值
ActionAdd Text Stamp To PDF
Input Data TypeBinary Data
Input Binary Fielddata
Output File Namedocument_with_text_stamp.pdf
TextCONFIDENTIAL
Pages1 (or "all")
Horizontal AlignmentCenter
Vertical AlignmentCenter
Opacity50 (lower for subtle watermark)
Rotation0 (45 for diagonal watermark)
CredentialsPDF4me API credential

常见问题

Which fields are actually required for Add Text Stamp to PDF?+
Only six: the PDF input (via Input Data Type), Output File Name, Text, Pages, Horizontal Alignment, and Vertical Alignment. Font, color, opacity, rotation, margins, background, and async processing are all optional with sensible defaults. See Adobe's stamp-placement guidance for how alignment and margins interact on a page.
Can I stamp only some pages instead of the whole document?+
Yes. Pages accepts a single page (1), a range (2-5), a mixed list (1,3,7-10), or an open range (2-). Leaving it unset processes every page.
How do I create a diagonal watermark-style stamp?+
Set Rotation to a non-zero angle such as 45 for a classic diagonal watermark, combine with a lower Opacity value and Background set to true so the stamp sits behind the page content instead of on top of it.
What is the difference between Background true and false?+
Background true places the stamp behind existing page content, ideal for subtle watermarks. Background false (the default) places it in the foreground, on top of existing content, ideal for visible approval or confidentiality marks.
Can I stamp large PDFs asynchronously?+
Yes. Enable Async Processing for large documents so the node processes in the background instead of holding the workflow execution open, improving reliability for batch or high-page-count PDFs.
Does the stamp text support dynamic values?+
Yes, map an n8n expression into Text (for example a customer name or timestamp from an upstream node) since the field accepts any string, the same way n8n handles dynamic values across the platform per the n8n expressions documentation.

相关操作

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

获取帮助