把 Word / PDF 快速处理成带文字水印的 PDF
Turn Word / PDF files into watermarked PDFs on macOS
中文 · English · Live Site · Download Release
这是一个面向 macOS 的轻量工具,用来把 Word / PDF 文件快速处理成带文字水印的 PDF。
它适合这些场景:
- 内部资料分发
- 业务文档 / 项目说明 / 提案输出
- 给 PDF 增加“仅供内部使用”“样稿”“审阅版”等文字水印
- 批量处理多个文档
仓库同时提供三种使用方式:
- 命令行:适合自动化和批量处理
.command启动器:适合本机双击运行- 拖拽式
.app:适合日常图形化使用
- 支持输入格式:
.doc.docx.dot.dotx.rtf.pdf - 输入是 PDF 时,直接叠加文字水印
- 输入是 Word / RTF 时,先调用 LibreOffice 转成 PDF,再叠加水印
- 支持中文和英文水印
- 支持一次处理多个文件
- 输出文件生成在原文件旁边,命名为
*_带水印.pdf - Release 里的
.app已内置 Python 依赖,下载即可直接使用打包好的 App 外壳
- 打开 Releases 页面: https://github.com/491034170/word-pdf-watermark-macos/releases
- 下载最新的
word-pdf-watermark-macos-<version>.zip - 解压后得到
Word转PDF加水印.app - 双击打开,或直接把文件拖到 App 上
说明:
- Release
.app已随包携带pypdf和reportlab - 如果你的 macOS 环境里没有
python3,请先安装 Python 3 - 如果你要处理 Word / RTF,请先安装 LibreOffice
python3 -m pip install -r requirements.txt
python3 word_pdf_watermark.py 文件1.docx 文件2.pdf基础用法:
python3 word_pdf_watermark.py 文件1.docx 文件2.pdf指定水印:
python3 word_pdf_watermark.py --watermark "仅供内部使用" 文件.docx无图形界面模式:
python3 word_pdf_watermark.py --no-ui --watermark "项目资料" 文件.pdf仓库内置:
scripts/Word转PDF加水印.command
它会自动定位仓库根目录下的 word_pdf_watermark.py,适合本机双击运行。
chmod +x scripts/build_applet.sh
./scripts/build_applet.sh生成产物:
dist/Word转PDF加水印.app
这个 .app 会把以下内容一起打包到 App 资源目录里:
word_pdf_watermark.pyrequirements.txtLICENSE- vendored Python dependencies:
pypdf,reportlab
chmod +x scripts/build_release_bundle.sh
./scripts/build_release_bundle.sh v1.0.0生成内容:
dist/Word转PDF加水印.app
dist/word-pdf-watermark-macos-1.0.0.zip
dist/SHA256SUMS.txt
如果你要在本地重新生成 README 视觉素材或跑自测:
python3 -m pip install -r requirements-dev.txt
./scripts/smoke_test.shGitHub Actions 工作流位于:
.github/workflows/ci.yml
它会在 push、pull_request 和手动触发时执行这些检查:
- CLI 帮助检查
- PDF smoke test
- README 演示素材生成
.app打包验证- Release zip 构建验证
- macOS
- Python 3
- LibreOffice(仅在 Word / RTF 转 PDF 时需要)
脚本会自动尝试以下 soffice 路径:
/opt/homebrew/bin/soffice/Applications/LibreOffice.app/Contents/MacOS/soffice
.
├── .github/
│ └── workflows/
│ └── ci.yml
├── assets/
│ └── Word转PDF加水印.icns
├── docs/
│ └── images/
│ ├── demo.gif
│ ├── hero.png
│ ├── sample-input.png
│ ├── sample-output.png
│ └── workflow.png
├── LICENSE
├── launcher.applescript
├── README.md
├── requirements-dev.txt
├── requirements.txt
├── scripts/
│ ├── Word转PDF加水印.command
│ ├── build_applet.sh
│ ├── build_release_bundle.sh
│ ├── generate_demo_assets.py
│ └── smoke_test.sh
└── word_pdf_watermark.py
word_pdf_watermark.py- 负责参数解析、文件选择、Word 转 PDF、水印叠加和结果输出
launcher.applescript- 负责拖拽式 macOS App 的图形入口
scripts/build_applet.sh- 编译
.app并把脚本与 Python 依赖复制进 App bundle
- 编译
scripts/build_release_bundle.sh- 生成
.zip发布包和 SHA256 校验文件
- 生成
scripts/generate_demo_assets.py- 生成 README 所用的封面图、流程图和 GIF 演示素材
scripts/smoke_test.sh- 用于本地与 CI 的基础 PDF 水印 smoke test
.github/workflows/ci.yml- 在 GitHub Actions 上执行 macOS 自测流程
- PDF 输入直接加水印
- 中文水印正常显示
- 输出文件落在原文件同目录
- 打包后的 App bundle 可调用随包依赖执行 Python 脚本
本项目使用 MIT License。
Word PDF Watermark is a lightweight macOS utility for turning Word / PDF files into watermarked PDFs.
It supports three entry points:
- CLI for automation and batch processing
.commandlauncher for double-click local usage- drag-and-drop
.appfor a friendlier macOS workflow
- Supported inputs:
.doc,.docx,.dot,.dotx,.rtf,.pdf - PDF inputs are watermarked directly
- Word / RTF inputs are converted through LibreOffice before watermarking
- Chinese and English watermark text are both supported
- Multiple files can be processed in one run
- Output files are written next to the source file as
*_带水印.pdf - Release
.appbundles the required Python libraries (pypdf,reportlab) - The packaged
.appalso carries the projectLICENSE
- Open Releases: https://github.com/491034170/word-pdf-watermark-macos/releases
- Download the latest
word-pdf-watermark-macos-<version>.zip - Unzip it to get
Word转PDF加水印.app - Launch it directly or drag files onto the app icon
Notes:
- The release
.appvendors Python package dependencies - You still need
python3available on your Mac - LibreOffice is required only when converting Word / RTF files to PDF
python3 -m pip install -r requirements.txt
python3 word_pdf_watermark.py file1.docx file2.pdfpython3 word_pdf_watermark.py --watermark "Internal Use Only" file.docxpython3 word_pdf_watermark.py --no-ui --watermark "Review Copy" file.pdfchmod +x scripts/build_applet.sh
./scripts/build_applet.shOutput:
dist/Word转PDF加水印.app
chmod +x scripts/build_release_bundle.sh
./scripts/build_release_bundle.sh v1.0.0Outputs:
dist/Word转PDF加水印.app
dist/word-pdf-watermark-macos-1.0.0.zip
dist/SHA256SUMS.txt
If you want to regenerate the README visuals or run local validation:
python3 -m pip install -r requirements-dev.txt
./scripts/smoke_test.shThe GitHub Actions workflow lives at:
.github/workflows/ci.yml
It runs on push, pull_request, and manual dispatch, and verifies:
- CLI help output
- PDF smoke test
- README demo asset generation
.appbundle build- release zip packaging
- macOS
- Python 3
- LibreOffice for Word / RTF to PDF conversion
.github/workflows/ GitHub Actions CI workflow
assets/ app icon
docs/images/ README visuals and demo GIF
LICENSE MIT license
launcher.applescript app launcher source
requirements-dev.txt developer/CI dependencies
scripts/ build and helper scripts
word_pdf_watermark.py main conversion + watermark logic
- Direct watermarking for PDF input
- Chinese watermark rendering works correctly
- Outputs are written next to the source file
- Bundled app resources can execute with vendored Python dependencies
This project is released under the MIT License.

