DiffPDF

DiffPDF is used to compare two PDF files—textually or visually.

This tool is no longer being developed or maintained. It has been superceded by our commercial GUI tool, DiffPDF, which provides more functionality and is faster on multicore machines.

DiffPDF can compare two PDF files. It offers three comparison modes: Words, Characters, and Appearance.

By default the comparison is of the words on each pair of pages, but comparing character by character is also supported (e.g., for logographic languages). And there's also support for comparing the pages by appearance (for example, if a diagram is changed or if a paragraph is reformatted, or a font changed). It is also possible to compare particular pages or page ranges. For example, if there are two versions of a PDF file, one with pages 1-12 and the other with pages 1-13 because of an extra page having been added as page 4, they can be compared by specifying two page ranges, 1-12 for the first and 1-3, 5-13 for the second. This will make DiffPDF compare pages in the pairs (1, 1), (2, 2), (3, 3), (4, 5), (5, 6), and so on, to (12, 13). Version 1.5.0 added the ability to save a PDF file that shows the pages that differ with their differences highlighted. Version 2.0.0 added support for margin exclusion and improved dock window handling. Version 2.1.0 added support for drag and drop, bug fixes, and French and German translations.

A couple of example PDF files are provided (boson1.pdf and boson2.pdf) so that you can try it out. PDF files can be loaded from the GUI (by pressing the File #1 and File #2 buttons, or by dragging and dropping files), or by specifying them on the command line. I use the tool regularly to compare different versions of my books (which are typically 500 or more pages), e.g., comparing a first printing with a second printing, to make sure that only the pages I intended to change have actually been changed.

If you want a command line tool (e.g., for automated testing), use DiffPDFc instead.

DiffPDF is licensed under the GNU General Public License v 2 open source license.

Linux users probably don't have to built DiffPDF themselves (although doing so is easy and gets you the most up-to-date version: see building). For Debian, Fedora, and Ubuntu it is available as the binary diffpdf package, so can be installed using the relevant package management tool—but make sure you get at least version 1.1.3! (Other Linux distributions may also have it, so be sure to check if you don't want to build it yourself.) Prepackaged versions are sometimes out of date, but Liviu Andronic has produced an up to date package for Ubuntu systems at launchpad.net/~landronimirc/+archive/diffpdf.

Dirk Loss has built a version for Mac OS X (64-bit; OS X 10.6+). It is available from dirk-loss.de/diffpdf-2.1.3.dmg or from here diffpdf-2.1.3.dmg (8.2MB; SHA1: 917a38af295e1e438da091469da261754892e5c7). (Some Mac users have had problems with the new packages—if this affects you, try this version dirk-loss.de/diffpdf-2.1.1.dmg or from here diffpdf-2.1.1.dmg (9.3MB; SHA1: bd28128c5a1e4017024c7919fa410a713a48aba7).)

Steven Lee has built a version for Windows. It is available from his blog http://soft.rubypdf.com/software/diffpdf or from here diffpdf-2.1.3-win32-static.zip (5.6MB; should work fine on both 32- and 64-bit Windows; SHA1: 87cc3de49466d3808fa04742aa1f8a884d42fd03). Note that there's no console output (but the command line options work; see the online help for what they are).

Elbert & Nicole have built a version for OS/2 (using Qt 4.7.3). It is available from ftp.netlabs.org/pub/qtapps/diffpdf-2.1.2-os2.zip.

DiffPDF

To build DiffPDF you will need a good C++ compiler (e.g., GCC), the Qt 4 libraries (Qt 4.8 recommended, although older versions back to 4.4 should also work), and the Poppler library (at least 0.20.1)—all these should be available as standard packages on most Linux and BSD systems. For Mac OS X you'll need to install Xcode for the compiler and then get Qt and Poppler separately. The source is diffpdf-2.1.3.tar.gz (90K; SHA1: 663ecb7666a4b7d6fbd1a37327fd1f895fae69b8). Building follows the standard pattern for Qt 4 applications and is explained in the README; the steps are reproduced here:

If you like DiffPDF, you might like to buy one of my books. I also provide training and consultancy in C++, Qt, Python, PySide, and PyQt.

Top