Install
openclaw skills install @avocadoleaf-highfive/pdf-watermarkConvert PPT/PPTX to PDF and add customizable watermarks. Supports diagonal/grid/center layouts, adjustable font size, opacity, rotation, and color. Trigger words: 加水印、转PDF、PDF水印、导出PDF、水印工具、add watermark、convert to PDF、PDF watermark. Includes a mobile-friendly web UI for real-time parameter tuning.
openclaw skills install @avocadoleaf-highfive/pdf-watermarkConvert PPTX → PDF and add customizable diagonal watermarks to every page. 将 PPT/PPTX 转为 PDF 并添加自定义水印。
soffice, headless mode for PPTX→PDF conversion)
brew install --cask libreofficesudo apt install libreofficePyPDF2, reportlab
pip3 install PyPDF2 reportlab
fonts-noto-cjk or fonts-wqy-zenhei if missing)python3 {baseDir}/scripts/pptx_to_pdf_watermark.py input.pptx output.pdf [config.json]
python3 {baseDir}/scripts/pptx_to_pdf_watermark.py input.pdf output.pdf [config.json]
python3 {baseDir}/scripts/pptx_to_pdf_watermark.py --preview [config.json] preview.pdf
soffice --headless --convert-to pdf --outdir <output_dir> <input.pptx>
All parameters are optional. Without a config file, defaults are used. 所有参数可选,不提供 config.json 则使用默认值。
{
"text": "内部资料 请勿外传",
"fontSize": 60,
"opacity": 0.15,
"rotation": 45,
"color": [0.5, 0.5, 0.5],
"pattern": "diagonal",
"repeatX": 3,
"repeatY": 3,
"offsetX": 200,
"offsetY": 200
}
| Parameter | Description | Default |
|---|---|---|
text | Watermark text / 水印文字 | "内部资料 请勿外传" |
fontSize | Font size in pt / 字号 | 60 |
opacity | Transparency 0-1 / 透明度 | 0.15 |
rotation | Rotation in degrees / 旋转角度 | 45 |
color | RGB values 0-1 / 颜色 | [0.5, 0.5, 0.5] |
pattern | Layout: diagonal / grid / center / 布局模式 | "diagonal" |
repeatX | Grid horizontal count / 网格水平重复 | 3 |
repeatY | Grid vertical count / 网格垂直重复 | 3 |
offsetX | Diagonal spacing X / 对角线间距 | 200 |
offsetY | Diagonal spacing Y / 对角线间距 | 200 |
diagonal: Center + 4 offset copies (5 total). Best for standard pages.grid: Uniform X×Y grid across the page. Best for dense coverage.center: Single centered watermark. Best for minimalist style.A mobile-friendly web UI is included for real-time parameter tuning: 内置手机端调参界面,支持实时预览:
# Start local server
cd {baseDir} && python3 -m http.server 8088
# Open in browser
# Mobile UI: http://localhost:8088/watermark-mobile.html
# Desktop UI: http://localhost:8088/watermark-ui.html
Tune parameters in the UI, copy the generated JSON config, and pass it to the script. 在界面中调好参数,复制 JSON 配置,传给脚本即可。
To tune parameters from a phone outside localhost, use a tunnel service like cloudflared:
如需手机远程访问调参界面,可使用隧道工具:
brew install cloudflared # macOS
cloudflared tunnel --url http://127.0.0.1:8088
This is entirely optional. The script works standalone without the web UI. 此为可选功能,脚本本身无需 Web UI 即可独立运行。