Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/DilwoarH/pdf-visual-regression/llms.txt

Use this file to discover all available pages before exploring further.

Detect visual changes in PDFs with confidence

A Python CLI tool that performs precise page-by-page visual regression testing on PDF files using structural similarity algorithms and generates highlighted diff images.

Quick start

Get up and running in less than a minute

1

Install dependencies

Clone the repository and install the required Python packages:
git clone https://github.com/DilwoarH/pdf-visual-regression
cd pdf-visual-regression
pip install -r requirements.txt
2

Run your first comparison

Compare two PDF files to detect visual differences:
python pdf_visual_diff.py original.pdf updated.pdf
The tool will analyze each page and generate highlighted diff images showing exactly where visual changes occurred.
3

View the results

Check the output directory for your diff images:
ls diff_output/
Each difference is saved as a PNG with visual highlights marking changed regions.

Explore by topic

Find what you need in our comprehensive documentation

Installation

Set up your environment and install all dependencies

Basic comparison

Learn the fundamentals of comparing PDFs

Command reference

Complete CLI options and parameters

Configuration options

Customize threshold and output settings

Examples

Real-world usage patterns and scenarios

How it works

Understand the SSIM algorithm and architecture

Key features

Everything you need for visual regression testing

Page-by-page comparison

Compare each page independently and identify exactly which pages have changed

SSIM algorithm

Structural similarity detection reduces false positives from minor rendering variations

Visual diff images

Automatically generated images with highlighted regions show exactly what changed

Configurable thresholds

Adjust sensitivity to match your testing requirements

Ready to start testing?

Follow our quickstart guide to install dependencies and run your first PDF comparison in under a minute.

Get Started Now