A reader of my Factur-X validator launch post described a failure mode better than I could:
A lot of invoices that fail later didn't start broken in the XML. The spreadsheet that built them already dropped leading zeros on the invoice or order number, or mixed decimal commas, so the XML is well-formed while the visible PDF still shows the original value.
The file is valid in every way the standards care about, and wrong in the only way a human clerk will notice.
One file, two layers
Factur-X (ZUGFeRD 2.x) is a PDF/A-3 with a CII XML invoice attached inside. The two layers are produced independently: the XML carries the data that gets processed, the page carries what a human sees. In theory they're two renderings of one document; in practice they're two artifacts that share a database row.
What the standards check — and don't
"The invoice validates" usually means XSD (well-formed CII) plus EN 16931 Schematron (business rules inside the XML: buyer name present, line amounts add up, amount due consistent). PDF/A-3 conformance is a separate container check, often done with veraPDF.
None of the three compares the XML to the printed page. EN 16931 doesn't know the page exists; PDF/A validation doesn't know the invoice content exists. A file where the XML says INV-0042 and the page says 42 can pass all of it.
How the drift happens
Typical spreadsheet-to-XML pipeline: 0042 becomes 42 when a cell is formatted as a number; French 1 234,50 becomes 1234.50; the XML builder recomputes totals while the template prints the sheet's formulas; the template gets edited and the XML isn't regenerated from the same snapshot. Each of these is internally consistent XML. The pair is not.
"Just compare the page text" is the hard part
Extracting text gives positioned glyphs, not labelled fields. Is this string BT-1? Is 1 234,50 equal to 1234.50? Which of the three totals is amount due? Where did the value go on page 2? Every answer is layout-specific, and across a few real templates it becomes a pile of heuristics.
So my validator is honest about its boundary: it reads the embedded XML, never the page.
What it does do
Every failure now carries the rule ID, the XPath, and the offending value, so you can find the cell that produced it without opening the XML:
{
"valid": false,
"errors": [{
"ruleId": "BR-CO-16",
"severity": "ERROR",
"xpath": "/rsm:CrossIndustryInvoice/.../ram:DuePayableAmount",
"message": "…",
"value": "-250.33"
}],
"warnings": []
}
A receiving-side checklist
If you receive Factur-X invoices (in France, since September 2026, that's everyone):
- Extract the XML and validate it (XSD + EN 16931).
- Check PDF/A-3 conformance if your archive requires it.
- For invoice number, issue date, total incl. VAT and VAT breakdown, compare XML to page. Eyeballing beats nothing.
- On mismatch, ask for a reissue from the same source data, not a patched PDF.
Step 3 is the part software doesn't do reliably. That's not a standards gap; it's an engineering one.
Try it
Browser: https://factur-x-api.com/validateur-factur-x — drop a PDF or XML, get the rule list.
API:
curl -X POST https://factur-x-api.com/api/validate \
-H "X-API-Key: facturx_..." \
-F "file=@invoice.pdf"
It accepts the PDF or the bare XML. Keys come from https://factur-x-api.com/tarifs; the free tier covers a handful of validations per month, and the key endpoint sits behind a Turnstile check because of bot signups.
One ask
If you have a redacted PDF + XML pair where the printed values diverge, send it over. One real example decides whether page-text comparison is a feature or a rabbit hole — I'd rather learn that from an actual file than from synthetic ones.
Context: since September 2026 French companies must be able to receive e-invoices; issuing started with large companies, SMEs follow in September 2027, and invoices move through certified platforms (PDP). That's why receiving-side breakage shows up first.
Top comments (0)