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
Curtis Chau
Technical Writer

Curtis Chau holds a Bachelor’s degree in Computer Science (Carleton University) and specializes in front-end development with expertise in Node.js, TypeScript, JavaScript, and React. Passionate about crafting intuitive and aesthetically pleasing user interfaces, Curtis enjoys working with modern frameworks and creating well-structured, visually appealing manuals.

...

Read More
Ready to Get Started?
Nuget Downloads 6,125,430 | Version: 2026.7 just released
Still Scrolling Icon

Still Scrolling?

Want proof fast? PM > Install-Package IronOcr
run a sample watch your image become searchable text.