Skip to content
caimaoyPublic

About

No description, website, or topics provided.

Resources

Stars

5 stars

Watchers

1 watching

Forks

Repository files navigation

xpdf

PDF 水印添加 / 去除命令行工具。

功能

  • 添加水印:基于 reportlab 生成水印 PDF,再通过 PyPDF2 合并到目标 PDF
  • 去除水印:基于 PyMuPDF 将页面栅格化,剔除浅色像素,再重组为 PDF

安装

依赖管理使用 uv。

uv sync --extra dev

使用

# 添加水印
uv run xpdf watermark add <input.pdf> "<水印内容>"

# 添加水印并指定输出文件
uv run xpdf watermark add <input.pdf> "<水印内容>" --output <output.pdf>

# 去除水印
uv run xpdf watermark remove <input.pdf>

开发

uv run pytest                  # 运行测试
uv run pytest --cov=xpdf tests/ # 覆盖率
uv run pre-commit run --all-files  # 全量 pre-commit 检查

About

No description, website, or topics provided.

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages