
diff-pdf
CLI逐页可视化比对两个 PDF:用退出码报告是否有差异,可输出高亮差异的 PDF,或打开 GUI 对照查看,适合核对合同与生成文档的版本变化。作者已不再积极开发。
Note: this repository is provided as-is and the code is not being actively developed. If you wish to improve it, that's greatly appreciated: please make the changes and submit a pull request, I'll gladly merge it or help you out with finishing it. However, please do not expect any kind of support, including implementation of feature requests or fixes. If you're not a developer and/or willing to get your hands dirty, this tool is probably not for you.
Usage
diff-pdf is a tool for visually comparing two PDFs.
It takes two PDF files as arguments. By default, its only output is its return
code, which is 0 if there are no differences and 1 if the two PDFs differ. If
given the --output-diff option, it produces a PDF file with visually
highlighted differences:
$ diff-pdf --output-diff=diff.pdf a.pdf b.pdf
Another option is to compare the two files visually in a simple GUI, using
the --view argument:
$ diff-pdf --view a.pdf b.pdf
This opens a window that lets you view the files' pages and zoom in on details. It is also possible to shift the two pages relatively to each other using Ctrl-arrows (Cmd-arrows on MacOS). This is useful for identifying translation-only differences.
You can also use Ctrl+< and Ctrl+> (Cmd+< and Cmd+> on MacOS) show the left and right documents respecively. Ctrl+D to return back to the diff view.
See the output of $ diff-pdf --help for complete list of options.
Obtaining the binaries
Precompiled version of the tool for Windows is available as part of the latest release as a ZIP archive, which contains everything you need to run diff-pdf. It will work from any place you unpack it to.
Alternatively, if you use Chocolatey, you can install diff-pdf on Windows with:
$ choco install diff-pdf
On Mac, if you use Homebrew, you can use it to install diff-pdf with it:
$ brew install diff-pdf
On Mac, if you use Macports, you can install diff-pdf with:
$ port install diff-pdf
On Fedora and CentOS 8:
$ sudo dnf install diff-pdf
Precompiled version for openSUSE can be downloaded from the openSUSE build service.
Compiling from sources
The build system uses Automake and so a Unix or Unix-like environment (Cygwin or MSYS) is required. Compilation is done in the usual way:
$ ./bootstrap
$ ./configure
$ make
$ make install
(Note that the first step, running the ./bootstrap script, is only required
when building sources checked from version control system, i.e. when configure
and Makefile.in files are missing.)
As for dependencies, diff-pdf requires the following libraries:
- wxWidgets >= 3.0
- Cairo >= 1.4
- Poppler >= 0.10
CentOS:
$ sudo yum groupinstall "Development Tools"
$ sudo yum install wxGTK wxGTK-devel poppler-glib poppler-glib-devel
Ubuntu 24.04 / Debian 12 or newer:
$ sudo apt-get install make automake g++
$ sudo apt-get install libpoppler-glib-dev poppler-utils libwxgtk3.2-dev
Older versions of Ubuntu / Debian:
$ sudo apt-get install make automake g++
$ sudo apt-get install libpoppler-glib-dev poppler-utils libwxgtk3.0-gtk3-dev
macOS:
Install Command Line Tools for Xcode:
$ xcode-select --install
and install Homebrew or MacPorts to manage dependencies, then:
$ brew install automake autoconf wxmac poppler cairo pkg-config
or
$ sudo port install automake autoconf wxWidgets-3.0 poppler cairo pkgconfig
Note that many more libraries are required on Windows, where none of the libraries Cairo and Poppler use are normally available. At the time of writing, transitive cover of the above dependencies included fontconfig, freetype, glib, libpng, pixman, gettext, libiconv, libjpeg and zlib.
Compiling on Windows using MSYS + MinGW
-
First of all, you will need working MinGW installation with MSYS2 environment and C++ compiler. Install MSYS2 by following their instructions.
-
Once installed, launch the MSYS2 MinGW shell. It will open a terminal window; type
cd /c/directory/with/diff-pdfto go to the directory with diff-pdf sources. -
You will need to install additional MSYS components that are not normally included with MSYS, using these commands:
$ pacman -Syu $ pacman -S automake autoconf pkg-config make zip pactoys $ pacboy -S gcc:p poppler:p wxWidgets:p -
Build diff-pdf in the same way as in the instructions for Unix above:
$ ./bootstrap # only if building from git repository $ ./configure $ make -
To build a ZIP archive will all DLLs, run
$ make windows-dist
Installing
On Unix, the usual make install is sufficient.
On Windows, installation is not necessary, just copy the files somewhere. If you built it following the instructions above, all the necessary files will be in the created ZIP archive.
相關資源

pdf2docx
CLI把 PDF 转成可编辑的 Word 文档,尽量还原段落、表格、图片和版面,也能单独抽取表格,适合修改只拿到 PDF 版的合同、公文和试卷。需 Python 环境;只适用于电子版 PDF,扫描件需先 OCR。Artifex 已不再主动维护,靠社区修复。
ArtifexSoftware/pdf2docx3.5k
PDF Viewer
PluginAnthropic 官方插件:在本地交互式查看器里打开 PDF,由 Claude 分批提议高亮、批注与审批印章,逐项引导填写表单、放置签名图片并导出标注副本。需要 Node.js 18+,签名不是数字证书签名。
anthropics/knowledge-work-plugins29.9k
Claude Office Skills
Skill130 多个办公技能合集,覆盖合同审查、NDA 起草、职位描述与录用通知、发票报销、会议纪要、邮件及 Excel、PPT、PDF 处理;文书类复制即用,Airtable、Slack 等自动化类需另接服务,合同与财务结果需律师或会计复核。
claude-office-skills/skills526
Nutrient DWS MCP Server
MCPNutrient(原 PSPDFKit)官方 MCP:用自然语言合并 PDF、在 Office 与 PDF 间互转、OCR、加水印、涂黑脱敏个人信息、添加数字签名,并按字段提取发票、合同中的数据。文件会上传到 Nutrient 云端处理,需注册账号(可免费注册,按页消耗额度),本机需 Node.js。
PSPDFKit/nutrient-dws-mcp-server71
OCRmyPDF
CLI给扫描版 PDF 加上可搜索、可复制的文字层,可自动纠偏、旋转并优化体积,默认输出 PDF/A。基于 Tesseract,支持 100 多种语言,完全本地运行。
ocrmypdf/OCRmyPDF35.1k
anydoc
CLIFirecrawl 出品,在本地把 Word、PPT、Excel、PDF、EPUB、RTF 等文档毫秒级转成干净的 Markdown,保留标题、表格、脚注与公式,方便 agent 读合同、讲义、报表等附件。需安装 Node.js;扫描件可选用 Firecrawl 云端 OCR(会上传整份文件)。
firecrawl/anydoc22.9k