3.4.  DiffPDF - Show Mismatches between Two PDF Documents

As described in Chapter 2: “Quickstart”, differences between a PDF under test and a reference document can be shown with the program 'DiffPDF'. That program will be started using the context menu of a PDF file. The menu item is only active when the reference file can be found. The reference file is searched for in a subdirectory called 'reference' below the directory of the PDF under test. The referene file has to have the same name as the PDF under test. The following image shows the context menu for the case when no reference PDF was found:

If a reference PDF exists, the application starts with the following image:

The main part shows both documents page by page. The left-hand side is the reference PDF, the right-hand side is the current PDF under test. The bottom right corner shows some textual information about both documents, the upper right corner provides some buttons for navigating from error to error.

With the button 'Save As...' the differences can be exported to a file. The result of such an export looks like this:

The application 'DiffPDF' can also be used independently from PDFUnit-Monitor.

PDFUnit creates a diff-image for every failed test. The diff-image shows the reference PDF on the left-hand side and the differences in red on the right-hand side. The diff-image files are placed by default in the root folder and have the names <document-name>.<date-time>.out.png. The output folder can be set using the property 'output.path.diffimages' in the config file PDFUNIT_MONITOR_HOME/lib/PDFUnit-<version>/pdfunit.config.