diff-pdf
visual PDF comparison tool
TLDR
Compare two PDFs visually
SYNOPSIS
diff-pdf [options] file1.pdf file2.pdf
DESCRIPTION
diff-pdf compares two PDF files visually, rendering each page and performing pixel-by-pixel comparison. Unlike text-based diff tools, it captures visual differences including formatting, fonts, images, and layout changes that wouldn't be visible in a text comparison.
The tool rasterizes each page from both PDFs and compares the resulting images. It can generate a difference PDF highlighting changes in red, or open an interactive viewer for side-by-side comparison. A fuzzy tolerance parameter allows small rendering variations to be ignored.
This is particularly useful for comparing versions of documents where content may be identical but visual presentation differs, or for quality assurance workflows verifying that document generation produces consistent output. The tool returns exit code 0 if files are identical, 1 if different, making it suitable for automated testing.
PARAMETERS
--output-diff file
Output visual difference to PDF file.--view
Open visual comparison in viewer.--per-pixel-fuzz value
Tolerance for pixel differences (0-1).--mark-differences
Highlight differences in output.-v, --verbose
Verbose output.
