← 返回 Skills 市场
PDF Watermark
作者
zss04124586
· GitHub ↗
· v1.0.4
380
总下载
1
收藏
4
当前安装
5
版本数
在 OpenClaw 中安装
/install pdf-watermark
功能描述
PDF文字水印工具 / PDF text watermark tool. 智能检测页面方向,自动调整角度和大小,支持中文,居中显示。Auto-detects page orientation, adjusts angle & size, supports Chinese, centered.
使用说明 (SKILL.md)
PDF 水印添加工具
为 PDF 文档添加文字水印,支持智能适配和中文内容。
使用流程
1. 获取必要信息
必须确认的信息:
- 📄 PDF 文件路径(本地路径或 URL)
- 📝 水印文字内容 - 如果用户未提供,必须主动询问: "请告诉我水印文字内容(如'内部资料'、'机密'、姓名日期等):"
可选参数(用户未指定时使用默认值):
- 透明度:默认 0.25(25%,不影响阅读)
- 角度:默认自动计算(竖版约30°,横版约25°)
- 字体大小:默认自动根据页面尺寸计算
2. 执行水印添加
使用脚本 scripts/add_pdf_watermark.py:
# 全自动模式(推荐)
python3 scripts/add_pdf_watermark.py \x3C输入PDF路径> "\x3C水印文字>" [输出PDF路径]
# 自定义参数
python3 scripts/add_pdf_watermark.py \x3C输入PDF> "\x3C水印文字>" \x3C输出PDF> \x3C角度> \x3C透明度> \x3C字体大小>
参数说明:
\x3C输入PDF路径>: 源文件路径或 URL"\x3C水印文字>": 要显示的水印文字(必须提供)\x3C输出PDF路径>: 可选,默认为原文件名_watermarked.pdf\x3C角度>: 可选,默认 "auto" 自动计算\x3C透明度>: 可选,0.0-1.0,默认 0.25\x3C字体大小>: 可选,默认 "auto" 自动计算
3. 智能特性
脚本会自动:
- 🔍 检测页面方向:竖版/横版/方版
- 📐 智能计算角度:竖版约30°,横版约25°,方版约35°
- 📏 自动调整字体:根据页面尺寸计算最佳字体大小(28-60px范围)
- 🎯 页面居中:水印始终位于页面几何中心
- 📝 中文支持:自动加载系统可用的中文字体(黑体/宋体/苹方等)
4. 处理远程文件
如果用户提供的是 URL,先下载文件:
curl -L "\x3CPDF_URL>" -o /tmp/temp_input.pdf
python3 scripts/add_pdf_watermark.py /tmp/temp_input.pdf "\x3C水印文字>" /tmp/output_watermarked.pdf
5. 发送结果
处理完成后,将带水印的 PDF 文件发送给用户。
示例
场景1:用户提供了所有信息
用户:给这个文件加水印 "内部资料-张三 2024/01/15",文件是 report.pdf
执行:python3 scripts/add_pdf_watermark.py report.pdf "内部资料-张三 2024/01/15" report_watermarked.pdf
场景2:用户未提供水印内容
用户:帮我给这个PDF加水印
回复:请告诉我水印文字内容(如"内部资料"、"机密"、姓名日期等):
用户回复后:再执行加水印操作
场景3:从URL下载
用户:给 http://example.com/doc.pdf 加水印 "机密文件"
执行:
curl -L "http://example.com/doc.pdf" -o /tmp/doc.pdf
python3 scripts/add_pdf_watermark.py /tmp/doc.pdf "机密文件" /tmp/doc_watermarked.pdf
注意事项
- 水印使用灰色半透明,确保不影响原文阅读
- 中文自动检测系统字体,优先使用黑体(STHeiti)
- 每页独立计算,混合方向页面也能正确处理
- 输出文件默认保存在工作目录
安全使用建议
This skill appears to be what it says: a local PDF watermarking script. Before installing/using it: (1) ensure Python packages pypdf and reportlab are installed (they are required but not documented); (2) only process PDFs you trust or have permission to modify — SKILL.md suggests using curl to download remote PDFs, so downloading untrusted files can be risky; (3) the script looks for system fonts in common locations to support Chinese text, which is normal; (4) run the script in a safe/test environment first to verify behavior and output naming; (5) no credentials are requested and the skill does not exfiltrate data based on the provided code, but always review and run code locally if you need to be certain.
功能分析
Type: OpenClaw Skill
Name: pdf-watermark
Version: 1.0.4
The skill is a legitimate utility for adding text watermarks to PDF documents. The Python script (scripts/add_pdf_watermark.py) uses standard libraries like pypdf and reportlab to process files and includes logic for font registration and smart positioning. There is no evidence of data exfiltration, malicious execution, or prompt injection; the use of curl in SKILL.md is strictly for downloading user-provided PDF URLs for processing.
能力评估
Purpose & Capability
The name/description match the included script and instructions. The skill asks only for an input PDF (path or URL) and watermark text and does not request unrelated credentials, binaries, or config paths.
Instruction Scope
SKILL.md stays within the stated purpose: it explains required inputs, optional parameters, how to run the included script, and how to download a remote PDF via curl before processing. It does not instruct reading unrelated files or exfiltrating data. One small omission: the README does not list required Python packages (pypdf, reportlab) that the script uses.
Install Mechanism
This is instruction-only (no install spec). The included script depends on Python packages (pypdf, reportlab) but the skill does not provide an install step or document those dependencies — operational gap rather than malicious behavior.
Credentials
No environment variables, credentials, or config paths are requested. The script probes standard system font paths locally to find a Chinese font, which is appropriate for the stated feature (Chinese support).
Persistence & Privilege
always is false and the skill does not attempt to modify other skills or system-wide agent settings. It runs ad-hoc and writes only the output PDF that the user specifies.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install pdf-watermark - 安装完成后,直接呼叫该 Skill 的名称或使用
/pdf-watermark触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.4
Natural bilingual description without explicit CN/EN markers
v1.0.3
Shortened description for better display - concise Chinese and English
v1.0.2
Fixed description formatting with proper Chinese/English sections and complete translations
v1.0.1
Added English description for bilingual support
v1.0.0
Initial release: Auto-detect page orientation (portrait/landscape), smart watermark positioning, Chinese text support
元数据
常见问题
PDF Watermark 是什么?
PDF文字水印工具 / PDF text watermark tool. 智能检测页面方向,自动调整角度和大小,支持中文,居中显示。Auto-detects page orientation, adjusts angle & size, supports Chinese, centered. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 380 次。
如何安装 PDF Watermark?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install pdf-watermark」即可一键安装,无需额外配置。
PDF Watermark 是免费的吗?
是的,PDF Watermark 完全免费(开源免费),可自由下载、安装和使用。
PDF Watermark 支持哪些平台?
PDF Watermark 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 PDF Watermark?
由 zss04124586(@zss04124586)开发并维护,当前版本 v1.0.4。
推荐 Skills