π¬π§ English | π«π· FranΓ§ais
A simple and local PDF file comparison tool built with Python.
The tool extracts the textual content of two PDF documents, lightly normalizes the data, then displays the differences detected between the two versions.
No AI, no external API, and no file upload to any third-party service.
pdf-comparator/
βββ pdf-compare.py β Main PDF comparison script
βββ requirements.txt β Required Python dependencies
βββ LICENSE.md β MIT License
βββ README.md β English documentation
βββ README_FR.md β French documentation
β
βββ docs/
βββ images/
β βββ Palks_Studio.png β Palks Studio logo
β βββ pdf_comparator.png β PDF Comparator presentation image
β
βββ EN/
β βββ old.pdf β Example original PDF in English
β βββ new.pdf β Example modified PDF in English
β βββ compare_pdf_en.mp4 β English demonstration video
β
βββ FR/
βββ ancien.pdf β Example original PDF in French
βββ nouveau.pdf β Example modified PDF in French
βββ compare_pdf_fr.mp4 β French demonstration video
The principle is intentionally simple:
PDF A βββΊ Text extraction βββ
ββββΊ Comparison βββΊ Differences
PDF B βββΊ Text extraction βββ
Differences are displayed directly in the terminal, showing added and removed lines.
Example:
--- old.pdf
+++ new.pdf
-Address: 12 Example Street
+Address: 24 Example Street
-Total: β¬1,200
+Total: β¬1,350
- Local comparison of two PDF files
- Text extraction across all pages
- Lightweight content normalization before comparison
- Detection of added and removed lines
- No artificial intelligence
- No external API
- No document transfer
- Minimal dependency
- Command-line usage
- Python 3
pypdf
Clone the repository:
git clone REPOSITORY_URL
cd pdf-comparatorInstall the dependency:
python -m pip install -r requirements.txtThe repository includes example files that can be used to test PDF Comparator directly.
Two sets are available in the docs/ directory, in English and French. Each version includes two PDF files containing differences, along with a short video showing their comparison using the tool.
These files provide a quick way to explore how the comparator works before using it with your own documents.
Run the comparator and provide the two PDF files:
python pdf-compare.py old.pdf new.pdfThe first file is considered the reference version, while the second file is the new version to compare.
If no textual difference is detected:
FR: Aucune diffΓ©rence dΓ©tectΓ©e.
EN: No differences detected.
Otherwise, the detected differences are displayed directly in the terminal.
PDF Comparator compares the textual 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 a scanned document without an exploitable text layer, cannot be compared correctly.
The tool does not perform any business interpretation of the content and does not attempt to determine the meaning of the detected differences.
Files are processed locally on the user's machine.
PDF Comparator does not use any remote service or external API, and documents are never sent to a server.
This project provides an intentionally lightweight solution for quickly identifying textual differences between two versions of a PDF document, without relying on an external platform or artificial intelligence system.
It can be used to review changes in documentation, reports, technical documents, or different versions of the same file.
This project is distributed under the MIT License.
Β© Palks Studio β see LICENSE.md
