table of contents
| 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¶
- -a, --appearance
- compare the appearance of the pages (the default in batch mode)
- -c, --characters
- compare the text character by character
- -w, --words
- compare the text word by word (the default otherwise)
- --any-extension
- accept files whose names do not end in .pdf
- --box=BOX
- compare only what is inside the page box BOX: media, crop, bleed, trim or art (none, the default, compares whole pages)
- --box-clip=CLIP
- clip that box to the media box (media, the default), to the media and crop boxes (crop), or not at all (none)
- --language=LANG
- use the given translation language, e.g., en for English, cz for Czech; English is used if there is no translation
- --debug=2
- 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
- --debug=3
- as --debug=2, but also with the coordinates, in y, x order
- -h, --help
- display this help and exit
- --version
- output version information and exit
Batch mode options:¶
- -b, --batch
- compare without a window
- --interactive
- show the window (the default, except as disparPDFc)
- --outType=0
- print only the result code (the default)
- --outType=1
- print the result code and a description
- --pages=N
- compare N pages (default all)
- --startPage1=N
- start at page N of FILE1
- --startPage2=N
- start at page N of FILE2
- --pdfdiff=FILE
- save the pages that differ, highlighted, to FILE
- --xmlResult=FILE
- write the result, in XML, to FILE
- --key=KEY
- record KEY in the XML result
- --settings=FILE
- read settings (zoom, margins, tolerances, colors, etc.) from FILE, in INI format, instead of using the defaults
- --compareFonts
- 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:
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:
Compare only what is inside the trim boxes:
REPORTING BUGS¶
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¶
The full documentation is available from the program's Help button (F1).
| October 2026 | disparPDF 1.1.1 |