FR / EN
🔥 20% off all resources through September 30 🇺🇸 Available for U.S. projects View offers →

BASE

Home Studio Approach

SERVICES

Custom Development Backend & Architecture Service provider analysis Research, analysis & investigation

INSTALLATION

Recruitment Data Collection Invoicing System Invoice Stamper

FREE TOOLS

Quote Generator Factur-X Generator SEO Analyzer Dependency Security Checker PDF Comparator PDF / XML Comparator

RESOURCES

Flask chatbot VS Code environment pack Documentation framework Static site

CONTENT

Electronic Invoicing 2026 Electronic Invoicing Investigation Why Build Without SaaS Data Security Technical Notes Interactive Experiences

SUPPORT

FAQ Contact Links

SUPPORT

FAQ Contact Links

Open Source PDF Comparator: Compare Two PDF Files Locally

PDF Comparator is an open-source tool designed to compare the text content of two PDF files locally in order to quickly identify added or removed lines.

PDF Comparator is a local and open-source tool designed to quickly compare the text content of two PDF files.

It extracts text from both documents, applies light normalization to their content, then displays the differences detected between the two versions.

The goal is to provide a simple way to identify textual changes made to a document without relying on an external platform, API or artificial intelligence system.

What's Included in PDF Comparator?

Application & Comparison

  • Main Script pdf-compare.py contains the PDF comparison logic
  • Text Comparison Detection of added and removed lines between two PDF files
  • Local Processing Comparison performed on your machine, without APIs or file transfers

Documentation & Examples

  • Bilingual Documentation Complete README documentation available in English and French
  • PDF Examples Original and modified PDF files ready to test in English and French
  • Video Demonstrations Two demonstrations show the comparison of the provided example files

How Does the Comparison Work?

Content Extraction

The pdf-compare.py script extracts the text content from the pages of both PDF files provided when it is executed.

Light normalization is then applied to the content before comparing the reference document with its new version.

Difference Detection

Differences are displayed directly in the terminal as added and removed lines.

If no textual difference is detected, the tool simply indicates this instead of producing an unnecessary report.

Processing is performed locally, without sending files to a third-party service or using an external API, an approach consistent with data security principles.

See PDF Comparator in Action

Demonstration of the local comparison of the text content of two PDF files.

The demonstration shows the extraction of text from both documents and the identification of added or removed lines between the two versions.

▶ Watch the demonstration on YouTube

Installation and Usage

The project requires Python 3 and the pypdf library.

  • Install the dependencies: python -m pip install -r requirements.txt
  • Compare two PDF files: python pdf-compare.py old.pdf new.pdf

The first file is the reference version. The second is the new version to compare.

Limitations and Use Cases

PDF Comparator compares the text content extracted from the documents. It does not visually compare page rendering, images, fonts, colors or graphical layout.

The quality of the comparison also depends on the text that can actually be extracted from the PDF. A document containing only images or originating from a scan without an exploitable text layer cannot be compared correctly.

The project is open source under the MIT license.

➜ View project on GitHub

Download project

Was this page useful to you?

← Back to Content

Cookies, you're used to them, right? Try the experience → Is your application working? See what protects it →