Compare two PDF files page by page. Detect visual differences with configurable sensitivity, auto-alignment and parallel processing. Built for CI/CD pipelines.
Goroutines and channels orchestrate rendering and comparison workers with no overhead.
Zero runtime dependencies. One self-contained executable for Linux, macOS and Windows.
Go's garbage collector keeps memory usage minimal even when processing hundreds of pages.
Native machine code. No JVM, no interpreter — starts in milliseconds and stays fast.
Precise, configurable and fast.
Renders each page at configurable DPI (150–300+) and compares images pixel by pixel using a color-distance threshold you control.
Detects and compensates global page shifts automatically. Configurable search offset and diff threshold to trigger alignment.
Files A and B always render in parallel. Configure render workers per file (-rw) and comparison workers (-j) independently.
Generates a PDF report highlighting every changed region. Output path configurable with -o.
Compare only the pages you need. Supports ranges like 1-10 or mixed lists like 1,3,7-12.
Report language auto-detected from the LANG env var. Supports English, Portuguese (pt-br) and Spanish.
pdfcomparer -a FILE_A -b FILE_B [options]
| Flag | Type | Description |
|---|---|---|
-a | string | First PDF file (original) |
-b | string | Second PDF file (modified) |
| Flag | Type | Description |
|---|---|---|
-o |
string | Output report PDF (default: diff_report.pdf) |
-lang |
string | Report language: en, pt-br, es (default: auto from LANG env) |
| Flag | Type | Description |
|---|---|---|
-t |
float |
Color distance threshold 0.0–1.0 (default: 0.05) 0.01 = very subtle differences | 0.10 = only obvious differences |
-min-diff-pct |
float |
Minimum diff% to consider a page different (default: 0.0) Use 3.0 with -align=true to suppress anti-aliasing noise |
-aa-blur |
int |
Box blur radius before comparing (0 = disabled) 1 = removes 1-px anti-aliasing | 2 = suppresses gradients up to 3 px |
| Flag | Type | Description |
|---|---|---|
-dpi |
int |
Render resolution (default: 150) 150 = fast, good for text | 300 = high quality, catches pixel-level image diffs |
-pages |
string | Page range, e.g. "1-10" or "1,3,7-12" (default: all) |
-rw |
int |
Render workers per file; A and B always render in parallel (default: 2) e.g. -rw 4 spawns 4 pdftoppm processes per file (8 total) |
-j |
int | Comparison workers (default: 4) |
| Flag | Type | Description |
|---|---|---|
-align |
bool | Auto-align: detect and compensate global shift when page diff is high (default: true) |
-align-thr |
float | Rough diff% above which alignment is attempted (default: 3.0) |
-max-offset |
int | Max pixel offset to search when aligning (default: 50) |
| Flag | Type | Description |
|---|---|---|
-machine-id |
— | Print this machine's license ID and exit (send it to obtain a usage license) |
-license |
string |
Path to the .lic file Or set PDFCOMPARE_LICENSE, or place pdfcompare.lic next to the binary |
-license-info |
— | Show the licensee information and exit |
Basic comparison
High quality, first 50 pages
Maximum parallelism
Suppress anti-aliasing noise
Get machine ID for licensing
Check license info
Per-machine license. All features included from day one.
To purchase, run pdfcomparer -machine-id and send the ID to
[email protected]