Scroll to navigation

DISPARPDF(1) User Commands DISPARPDF(1)

NAME

disparPDF, disparPDFc - compare two PDF files textually or visually

SYNOPSIS

disparPDF [OPTION]... [FILE1 [FILE2]]
disparPDF --batch [OPTION]... FILE1 FILE2
disparPDFc [OPTION]... FILE1 FILE2

DESCRIPTION

Compare two PDF files and show their differences.

The files are optional and are normally chosen in the window. With --batch, they are compared without a window, and the result code (see below) is printed.

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, and to pair each page of one file with a page further on in the other, for when pages have been inserted or removed.

The differences can be saved as a PDF file, with the pages side by side and the differences highlighted.

With --box, only what is inside one of the page boundaries of ISO 32000-2 (the MediaBox, CropBox, BleedBox, TrimBox or ArtBox) is compared, and the pages are lined up on its corner, so that, for example, crop marks and bleed outside the trim box are ignored. A page without the box uses its default (the CropBox, or for the CropBox the MediaBox); the box is clipped to the MediaBox unless --box-clip says otherwise (--box-clip without --box is ignored, with a warning). Warnings, such as a missing box or boxes that differ between the files, go to standard error and into the --xmlResult file, and do not change the result code.

In batch mode the appearance of the pages is compared by default, and it needs no display. Settings such as the zoom, the tolerances and the margins to leave out can be given in an INI file (--settings), whose keys are those of the configuration file (see FILES).

disparPDFc is a link to disparPDF, which, run by that name, is in batch mode without --batch, and shows the window only when given --interactive.

OPTIONS

compare the appearance of the pages (the default in batch mode)
compare the text character by character
compare the text word by word (the default otherwise)
accept files whose names do not end in .pdf
compare only what is inside the page box BOX: media, crop, bleed, trim or art (none, the default, compares whole pages)
clip that box to the media box (media, the default), to the media and crop boxes (crop), or not at all (none)
use the given translation language, e.g., en for English, cz for Czech; English is used if there is no translation
write the text fed to the sequence matcher into files in the temporary directory (e.g., page1-1.txt and page1-2.txt) when highlighting
as --debug=2, but also with the coordinates, in y, x order
display this help and exit
output version information and exit

Batch mode options:

compare without a window
show the window (the default, except as disparPDFc)
print only the result code (the default)
print the result code and a description
compare N pages (default all)
start at page N of FILE1
start at page N of FILE2
save the pages that differ, highlighted, to FILE
write the result, in XML, to FILE
record KEY in the XML result
read settings (zoom, margins, tolerances, colors, etc.) from FILE, in INI format, instead of using the defaults
also compare the fonts the files use

Result codes, printed in batch mode and also the exit status (modulo 256):

0
the files are the same
1
the files differ
2
the files have different numbers of pages
3
a start page is beyond the end of its file
4
a file has fewer pages than --pages asks for
5
the same file was given twice
6
the files use different fonts (with --compareFonts)
-1
a command line error
-3, -4
FILE1 or FILE2 cannot be read
-5
a page cannot be read
-6, -7
the --pdfdiff or --xmlResult file cannot be written

In the window, press F1 for the full documentation, and click About for the copyright and license details.

AUTHORS

DiffPDF was written by Mark Summerfield (2008–2013). ConfrontaPDF, which added batch mode, is a fork of it by Luca Bellonda (2015), and disparPDF is a port of that to Qt 6 by Yuwsuke Kieda (2026).

FILES

~/.config/disparPDF/disparPDF.conf
Settings of the window (layout, zoom, margins, page box, highlighting, etc.) on Linux and the BSDs, in INI format. Batch mode does not use them; see --settings.
~/Library/Preferences/com.disparpdf.disparPDF.plist
The same on macOS, as a property list.

EXAMPLES

Compare the words of two files:

disparPDF old.pdf new.pdf

Compare them without a window:

$ disparPDFc a.pdf b.pdf
0
$ disparPDFc --outType=1 a.pdf c.pdf
1|documents differ at page: 1

Compare the words of two files without a window, saving the pages that differ to diff.pdf, and a detailed result, in XML, to result.xml:

disparPDF --batch --words --pdfdiff=diff.pdf --xmlResult=result.xml a.pdf b.pdf

Compare only what is inside the trim boxes:

disparPDFc --box=trim a.pdf b.pdf

REPORTING BUGS

https://github.com/yuw/disparPDF/issues

COPYRIGHT

Copyright © 2026 Yuwsuke Kieda; ConfrontaPDF © 2015 Luca Bellonda; DiffPDF © 2008–2013 Qtrac Ltd. License GPLv2+: GNU GPL version 2 or later <https://gnu.org/licenses/gpl.html>.

SEE ALSO

diff(1)

The full documentation is available from the program's Help button (F1).

October 2026 disparPDF 1.1.1