跳到主要内容

添加文字水印 Exceln8n

添加文字水印 是一个 PDF4me Excel 操作 n8n 该工具可在 .xlsx 工作簿中的工作表上添加自定义文本标签,例如“机密”或“草稿”。您可以使用它来标记敏感电子表格、在审阅前标记草稿或自动应用公司品牌标识,无需手动编辑。 Excel

此节点的功能

PDF4me Excel添加文字水印 在屏幕上渲染 WordArt 风格的文本水印 Excel 工作表可控制字体、字号(磅)、文本颜色、粗体和斜体样式、透明度、旋转角度以及九位放置网格。工作表选择功能可决定水印是出现在所有工作表上,还是仅出现在您指定的工作表上。非常适合用于添加保密标签、草稿标记、版权声明和自动化电子表格品牌标识。

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

验证您的身份 API 要求

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

您不容错过的重要事实

文本大小是一个磅值,而不是预设代码。
直接输入所需大小。例如,输入 20 会显示 20 磅的水印,响应会显示 textSize 20。将数值提高到 72 或更高,即可获得全宽斜角显示效果。
工作表选择关卡贯穿整个工作簿
“所有工作表”选项会选中所有工作表,并在响应中报告 worksheetSelection 0。切换到特定选择会按名称或从零开始的索引定位工作表,并报告 worksheetSelection 1。
透明度 0 表示实心,而非不可见。
水印透明度数值范围为 0 到 100,0 表示完全不透明,100 表示完全透明。默认值 0 会生成实心水印,因此当需要保持水印下方数据清晰可读时,请将其提高到大约 50。
PDF4me Excel 节点在 n8n 中设置为“添加文本水印”操作,Excel 文件输入方法为“来自上一个节点(二进制数据)”,二进制数据属性名称为“data”,水印文本为“CONFIDENTIAL”,字体为 Arial,字号为 20,启用粗体,禁用斜体,文本颜色为 #808080,透明度为 50%,旋转角度为 -45,位置居中,工作表选择为“所有工作表”,输出文件名为 excel_with_watermark.xlsx,源文档名称为 myExcelFile.xlsx,输出二进制数据名称为“data”。

PDF4me Excel 在“添加文本水印参数面板”中 n8n

添加文字水印需要哪些参数?

必需的: 手术, Excel 文件输入方式、与该方法匹配的输入字段、水印文本和输出文件名。样式字段(字体、字号、文本颜色、粗体、斜体、透明度、旋转角度、位置)均提供默认值,源文档名称和输出二进制数据名称为可选标签。

范围必需的它的作用例子
OperationRequiredSelects the PDF4me Excel action to run. Choose Add Text Watermark.Add Text Watermark
Excel File Input MethodRequiredHow the workbook reaches the node. From Previous Node (Binary Data) reads it from an upstream item; the dropdown also offers base64 and file URL alternatives.From Previous Node (Binary Data)
Binary Data Property NameConditionalName of the binary property on the incoming n8n item that holds the .xlsx workbook. Applies when the input method is binary data. Defaults to data.data
Watermark TextRequiredThe text stamped across the worksheet. Accepts any string, including expressions mapped from earlier nodes.CONFIDENTIAL
Font FamilyOptionalFont used to render the watermark, chosen from the dropdown of available families.Arial
Text SizeOptionalWatermark size in points, entered directly. The response echoes the same number back as textSize.20
BoldOptionalToggle that applies bold weight to the watermark text. Off by default.true
ItalicOptionalToggle that applies italic styling to the watermark text. Off by default.false
Text ColorOptionalWatermark colour, set through the colour picker or as a hex code.#808080
TransparencyOptionalTransparency from 0 (fully opaque) to 100 (fully invisible). Default 0.50
Rotation AngleOptionalRotation in degrees. 0 is horizontal, negative values tilt anticlockwise for the classic diagonal watermark.-45
PositionOptionalPlacement on the sheet, picked from a nine-cell grid running Top Left through Bottom Right. Returned as a numeric code in the response.Center
Worksheet SelectionOptionalAll Worksheets watermarks every sheet. Switching to a specific selection lets you target sheets by name or zero-based index.All Worksheets
Output File NameRequiredFilename for the watermarked workbook the node returns. Include the .xlsx extension.excel_with_watermark.xlsx
Source Document NameOptionalReference label for the incoming workbook. Echoed back as originalFileName for tracking; it does not change the output.myExcelFile.xlsx
Output Binary Data NameOptionalName of the binary property the output item exposes. Defaults to data.data

输出字段

一次成功的运行返回一个 n8n 携带物品 JSON 元数据加上带有水印的工作簿(以二进制数据形式)。

场地类型它包含什么
successBooleanTrue when the watermark was applied successfully. Use it to route error-handling branches.
fileNameStringFilename of the watermarked workbook, matching Output File Name.
fileSizeNumberSize of the returned workbook in bytes.
originalFileNameStringThe value supplied in Source Document Name, echoed back for tracking.
watermarkTextStringThe text that was stamped onto the worksheets.
fontFamilyStringFont family used to render the watermark.
textSizeNumberWatermark size in points, matching the Text Size input.
isBoldBooleanWhether bold weight was applied.
isItalicBooleanWhether italic styling was applied.
textColorStringWatermark colour as a hex value.
transparencyNumberTransparency level applied, from 0 to 100.
rotationAngleNumberRotation in degrees applied to the watermark.
positionNumberNumeric code for the placement cell used on the nine-position grid.
worksheetSelectionNumber0 when every worksheet was watermarked, 1 when a specific selection was targeted.
selectedWorksheetNamesArrayWorksheet names targeted, empty when all worksheets were processed.
selectedWorksheetIndexesArrayZero-based worksheet indexes targeted, empty when all worksheets were processed.
messageStringHuman-readable result message for the operation.
Binary (data)BinaryThe watermarked .xlsx under Output Binary Data Name (default data). Pass into Write Binary File, Email, or a cloud-storage upload.

N8N 行动反应

PDF4me 添加文字水印 操作返回一个响应,您可以在其中以多种格式查看该响应。 n8n

JSON 回复格式

[
{
"fileName": "excel_with_watermark.xlsx",
"fileSize": 219605,
"success": true,
"originalFileName": "myExcelFile.xlsx",
"watermarkText": "CONFIDENTIAL",
"fontFamily": "Arial",
"textSize": 20,
"isBold": true,
"isItalic": false,
"textColor": "#808080",
"transparency": 50,
"rotationAngle": -45,
"position": 1,
"worksheetSelection": 1,
"selectedWorksheetNames": [],
"selectedWorksheetIndexes": [],
"message": "Text watermark added to Excel file successfully"
}
]

如何在设置中添加文字水印 n8n

  1. 添加 PDF4me Excel 节点到你的 n8n 工作流程和设置 手术添加文字水印
  2. 用于连接的凭证请选择您的 PDF4me API 或者创建一个凭证并粘贴您的凭证 API 钥匙。
  3. Excel 文件输入法来自上一个节点(二进制数据) 并设置 二进制数据属性名称 通常情况下,归还给存放工作簿的财产。 data
  4. 进入 水印文字, 例如 CONFIDENTIAL
  5. 为水印添加样式 字体系列文本大小 (以要点计) 文本颜色大胆的, 和 斜体
  6. 调整可见性和位置 透明度旋转角度, 和 位置
  7. 工作表选择所有工作表 或针对特定表格。
  8. 输出文件名 以……结尾 .xlsx然后执行该节点并将带有水印的工作簿路由下去。

典型配置

工作流程示例Common n8n workflow patterns using Add Text Watermark for Excel.
对外分享前请贴上“机密”标签
  1. 当工作簿进入传出文件夹时,Google 云端硬盘触发器就会触发。
  2. PDF4me Excel 运行“添加文本水印”,水印文本为“机密”,文本颜色为红色,透明度为50。
  3. 带有水印的工作簿将通过电子邮件发送给收件人,并存档回云端硬盘。
预定报告上的斜体草稿标记
  1. 计划触发器根据数据库导出数据生成每周数据工作簿。
  2. 添加文本水印,水印文本为草稿,旋转角度为 -45,透明度为 50,位置居中。
  3. 草稿在最终定稿前会发布到 Slack 审核频道。
客户名称按记录盖章
  1. “循环遍历项目”节点遍历来自客户端的行。 CRM 出口。
  2. 水印文本是通过表达式映射的,因此每个工作簿都会带有该客户名称。
  3. 每个输出文件都会以客户端 ID 作为文件名写入云存储。
仅提供汇总表,保留原始数据。
  1. webhook 会从内部工具接收已完成的报告工作簿。
  2. 工作表选择的目标是汇总表,因此原始数据选项卡保持未选中状态。
  3. 结果已上传至 SharePoint 供分发。

实用技巧

Text Size is points, not a preset
Type the point size you actually want. There is no 1 to 4 preset scale, so 20 means 20 points and 100 means a full-width banner.
Raise Transparency before raising size
A large opaque watermark hides cell values. Set Transparency near 50 first, then increase Text Size for coverage.
Rotation -45 gives the classic look
Negative angles tilt anticlockwise. Pair Rotation Angle -45 with Position Center for the traditional diagonal watermark.
Worksheet indexes are zero-based
When targeting sheets by index, the first worksheet is 0, not 1. Mixing this up silently watermarks the wrong tab.
Output File Name needs the .xlsx extension
Omitting the extension can leave downstream nodes unable to detect the format when writing or emailing the file.
Source Document Name is reference-only
It is echoed back as originalFileName for tracking and does not affect the watermark or the output filename.

速查表

场地价值
OperationAdd Text Watermark
Excel File Input MethodFrom Previous Node (Binary Data)
Binary Data Property Namedata
Watermark TextCONFIDENTIAL
Font FamilyArial
Text Size20 (points)
Text Color#808080
Transparency50
Rotation Angle-45
PositionCenter
Worksheet SelectionAll Worksheets
Output File Nameexcel_with_watermark.xlsx
Output Binary Data Namedata
CredentialsPDF4me API credential

常见问题

Is Text Size a point value or a preset number?+
Text Size is a direct point value, not a preset code. Entering 20 renders the watermark at 20 points and the response echoes textSize 20. Larger values such as 72 or 100 produce the full-page watermark look used on confidential copies.
Can I watermark only some worksheets instead of the whole workbook?+
Yes. Worksheet Selection controls this. All Worksheets applies the watermark everywhere and the response reports worksheetSelection 0. Choosing a specific selection lets you target worksheets by name or by zero-based index, and the response reports worksheetSelection 1.
How do I get the classic diagonal watermark look?+
Set Rotation Angle to a value such as -45 for a tilted watermark, raise Transparency to around 50 so cell contents stay readable underneath, and set Position to Center so the text sits across the middle of the sheet.
What does Transparency 0 mean?+
Transparency runs from 0 to 100 where 0 is fully opaque and 100 is fully invisible. The default is 0, which renders a solid watermark. Values around 40 to 60 are the usual choice when the watermark must not obscure the data.
What is the difference between Output File Name and Source Document Name?+
Output File Name is the filename of the watermarked workbook the node produces. Source Document Name is a reference label for the incoming file and is echoed back as originalFileName in the response, so it is useful for tracking rather than for controlling output.
Does the watermark support dynamic text from earlier nodes?+
Yes. Watermark Text accepts any string, so you can map an n8n expression into it, for example a client name or a generated timestamp from an upstream node, using the syntax described in the n8n expressions documentation.
Why not just use the built-in Excel watermark feature?+
Excel has no dedicated watermark button. The manual route is inserting WordArt or a header image on every sheet by hand, which does not scale past a handful of files. Running the operation through n8n applies the same visual result to every workbook in a workflow without opening Excel, and it can be chained with other n8n workflow steps.

相关操作

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

获取帮助