PDF File Difference Checking Tool: diff-pdf

Tadashi Shigeoka ·  Sat, March 23, 2019

I’ll introduce diff-pdf, a PDF file difference checking tool that can be used on macOS and Linux.

Premise) Want to Check PDF Differences

I needed to efficiently handle the task of “checking differences between the previous version and current version of a contract PDF file before stamping it.” While searching for PDF difference checking tools, I found diff-pdf and decided to try it out.

Installing diff-pdf

macOS Edition

brew cask install xquartz
brew install diff-pdf

Installation Error Example

brew install diff-pdf

...

diff-pdf: XQuartz 2.7.11 (or newer) is required to install this formula. X11Requirement unsatisfied!
You can install with Homebrew Cask:
 brew cask install xquartz
You can download from:
 https://xquartz.macosforge.org
Error: An unsatisfied requirement failed this build.

Checking Differences with diff-pdf

To check differences in PDF files with diff-pdf, run it with the —view option as follows:

diff-pdf --view before.pdf after.pdf

Cases Where diff-pdf is Useful

It didn’t seem suitable for document-type PDFs like contracts. The reason is that page breaks occur when text is added or deleted, making it difficult to visually check PDF differences.

Conversely, cases where diff-pdf is useful are PDF files like presentation slides. Since slide materials mostly contain text changes within the same page, diff-pdf can be very effective.

That’s all from the Gemba on wanting to efficiently check PDF file differences with diff-pdf.