OCR accuracy is the wrong figure to ask an invoice PDF for
· This page is provided in English.

Almost every supplier invoice arrives as a PDF carrying a text layer, so no character recognition happens and an accuracy figure for it describes nothing. The readings that go wrong go wrong over columns, decimal separators and continuation lines, and a different check is what catches those.
Price Double Check does this reading for a living: an invoice and a price list arrive by email, and the reply lists the lines where the two documents disagree. A figure misread by one digit is therefore a finding that is not there, or a finding that was never true. Everything below came out of thirty real documents from two accounting packages in one supplier chain.
The text layer was already in the file
All seventeen invoices in that folder carried a text layer. They were read with pdftotext in its layout mode, which keeps the horizontal spacing of the page, and the columns stayed where they were put. Nothing was recognised from an image, because there was no image to recognise anything from.
| What arrived | What read it | What it needed |
|---|---|---|
| PDF with a text layer | pdftotext in layout mode | Nothing. All 17 invoices |
| xlsx workbook | A spreadsheet reader | Rounding at the moment of reading |
| xls workbook | An older spreadsheet reader | The same |
| Apple .numbers | No reader available | An export, or an honest refusal |
| A scan with no text layer | Page images | The only place recognition arises: one 33-page contract |
The last row is the whole of the recognition problem in that set, and it was a contract rather than an invoice. A PDF does not record which column a number belongs to. It records where on the page that number is drawn, and the column is something a reader reconstructs from the spacing.
What actually went wrong
These are the readings that were wrong on the first pass, each of them from a real document. Not one of them is a character read as another character.
- A quantity and a price separated by a run of spaces: 1 then 15,00, read as one figure, 115.00. The pattern had to be tightened before it stopped happening.
- A price stored in a workbook as 1.1760000000000002 instead of 1.176. Comparing two files without rounding at the moment of reading produced 43 price changes that did not exist.
- A comma for the decimal point on one country's documents and a full stop on another's, with one invoice using a full stop and five decimal places in the quantity column.
- A line number printed not at the head of its line but on the wrap of the line before, in front of the rest of a description.
- A freight line with no quantity and no unit at all, which means the numbers have to be read from the right-hand end backwards rather than by column position.
- A subheading sitting inside the body of the table and attaching itself to the first description under it.
- Three different unit tokens in one table, and a misspelled unit inside the totals row of another.
- Diacritics broken in the text layer itself, so that an Estonian word for the VAT amount arrived with a question mark where its vowel should be.
- A tab character inside a code cell, in front of the digits, which is enough to keep one product from ever joining its price-list row.
- A price printed hard against the end of a description with no space between them, and a continuation line made of nothing but numbers.
Every item on that list is a layout problem or a number-format problem. A recognition score, however high, would have been silent about all of them, and the first one — 115.00 in place of a quantity and a price — would have passed a spell check and a plausibility check both.
The figure that is worth quoting
There is one measurement that catches a misreading without knowing anything about the document's layout: add up the lines and compare the sum with the total printed at the foot of the page. If they differ, the reading is wrong, whatever it looks like.
On the validation set that gate held everywhere. All 17 invoices across the folder, and all 11 in the two chains in scope, reconciled to their own printed totals to the cent. Of 382 invoice lines in scope, 327 matched their price-list row exactly, 41 were genuine price differences, and 14 did not join: 7 freight lines, which have no reference price anywhere, and 7 lines across six products that appear on no price list at all. Among those lines, 101 arrived with no printed code at all and got one back from a crosswalk built out of the supplier's own documents further up the chain. Lines misread: none.
Those are the numbers a buyer can act on, because each one is a statement about this month's documents rather than an average over somebody else's. The 115.00 was caught by exactly this gate and by nothing else: the line looked ordinary, and the total at the foot of the invoice refused to agree with it.
What a structured invoice settles and what it leaves
The layout problems above are an artefact of the page, and they go when the page goes. In a structured invoice the unit price is a field with a name, so there is no column to reconstruct, no separator to guess and no continuation line to stitch back together. That is a real gain and it is arriving by law across the Union, as the mandates reach a buyer one country at a time.
What it does not settle is the figure in the field. A document can be valid, signed, delivered through a network and still carry a price that is not the price agreed. The comparison against the list the buyer was given is the same piece of work before and after the format changes, and receiving the structured version without an ERP does not perform it for you.
In short
- What a recognition accuracy figure measures
- How often characters are read correctly out of an image of a page. It is a real measurement about scanned documents and it has no bearing on a PDF that was produced by an accounting package, because that file already contains its text.
- When recognition is genuinely needed
- When the document is a photograph or a scan with no text layer, which in this set was one contract out of thirty documents. A scanned invoice is worth asking the supplier to resend, because the file they printed from has the text in it.
- What to ask of a reader instead
- That it reconcile each document to its own printed total before it says anything, that it round at the moment of reading rather than at the end, and that it report the lines it could not join rather than quietly dropping them.
Forward one invoice and the price list it should have been billed on, and the reply comes back with the lines that disagree and the documents that would not reconcile named as such. What the reply contains is set out on the home page.