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 / XML Comparator: Compare PDF and XML Data Locally

PDF / XML Comparator is an open-source tool designed to locally compare data contained in a PDF file and an XML file in order to identify values that are not found in one of the two representations.

PDF / XML Comparator is a local and open-source tool designed to compare data contained in a PDF file and an XML file.

It searches for values in both directions in order to highlight those that are present in one representation but are not found in the other.

The goal is to facilitate an initial human review of both files without relying on an API, external service or artificial intelligence system.

What's Included in PDF / XML Comparator?

Application & Comparison

  • Main Application main.py contains the interface and the comparator's main engine
  • PDF ↔ XML Comparison Bidirectional search for values contained in both representations
  • Local Processing Comparison performed on your machine, without APIs or file transfers

Documentation & Examples

  • Bilingual Documentation Complete README documentation available in English and French
  • Factur-X Examples Ready-to-test PDF + XML pairs in English and French
  • Video Demonstrations Two demonstrations directly show the comparison of the provided example files

How Does the Comparison Work?

PDF to XML

Values detected in the PDF are searched for within the data extracted from the XML file. When a value is not found, it is highlighted for verification.

XML to PDF

Values contained in the XML file are also searched for within the text extracted from the PDF.

Normalization and Report

Different representations of numbers, dates, spaces and non-breaking spaces are taken into account to reduce false differences. The application then separates PDF values not found in the XML from XML values not found in the PDF.

The extracted PDF text, XML data and comparison report remain visible in the interface to facilitate human review.

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

Using the Comparator with Factur-X Files

The repository contains examples in English and French consisting of a PDF file and its associated Factur-X XML file. They can be used to directly test how the comparator works.

This type of comparison can notably facilitate an initial review of the data contained in both representations of a Factur-X electronic invoice .

A Comparator, Not a Validator

A highlighted value is not necessarily an error. PDF / XML Comparator is not a compliance validator: it does not verify an invoicing standard, an XSD schema, Schematron rules, PDF/A compliance or the legal or accounting validity of a document.

Its purpose is to highlight differences that may require human verification. A specialized validation tool remains necessary when compliance verification is required.

See PDF / XML Comparator in Action

Demonstration of the local comparison between a PDF file and its associated Factur-X XML file.

The demonstration shows the bidirectional data comparison and the identification of values not found in one of the two representations.

▶ Watch the demonstration on YouTube

Installation and Usage

The project requires Python 3. The only external Python dependency currently required is pypdf.

  • Install the dependency: pip install pypdf
  • Launch the application: python main.py

In the interface, select the PDF file followed by the XML file, run the comparison and review the values highlighted in the report.

Limitations and Use Cases

PDF comparison relies on text that can be extracted from the document. A scanned image-based PDF, a document whose text cannot be extracted or certain complex PDF structures may therefore produce incomplete results.

The comparator searches for the presence of values and equivalent representations, but does not establish a business-level mapping between a specific area of the PDF and a specific XML element.

➜ 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 →