Text Extracted in the Wrong Order from Invoices and Tabular PDFs
When you process structured PDFs like invoices with ReadDocumentAdvanced(), IronOCR can return text in an order that doesn't match the visual layout. A header printed at the top of the page, for instance, may come back after lines that sit below it.
The root cause is missing position data. ReadDocumentAdvanced() returns structured output such as tables and cells, but the text inside each cell arrives as a plain list with no coordinates. Without an X or Y for each word, IronOCR can't tell which word appears first on the page, so the order within a cell is unreliable.
The older ReadDocument() method does carry the position of every word (X, Y, width, and height) through OcrResult.Words, which lets you sort words back into reading order. ReadDocumentAdvanced() had no equivalent before version 2026.5.
Layout detection compounds the problem. IronOCR uses automatic region detection to find text areas on a page, and in complex layouts that mix headers, body text, and tables, it can group or order those regions in ways that stray from the visual reading order, which is exactly what happens on invoices.
Solution
Recommended: upgrade to IronOCR 2026.5 or later. This release adds word-level position data (X, Y, width, and height) to ReadDocumentAdvanced() results. With coordinates available on each word, you can sort words into the correct reading order inside table cells.
- Version found: 2025.9.7
- Version resolved: 2026.5

