function GetTextInReadingOrder(Order: TPdfReadingOrder): WString;
| Order | TPdfReadingOrder. roContentOrder follows the raw content stream, the same sequence iterating Character produces. roPhysicalLayout sorts characters by position, top to bottom and left to right |
| Result | WString. The page text in the requested order, empty when the page holds no text |
A content stream may draw text in any sequence - a generator can emit a footer before the body, or a column right to left. Content order preserves what the file says; physical layout reconstructs what a reader sees
Physical layout sorts on the centre of each character, descending by vertical position and ascending by horizontal position, so lines come out top to bottom and characters left to right within a line
For structure-driven order rather than geometry, a tagged document is better served by GetStructuredText or DocumentReadingUnits, which follow the declared reading order instead of inferring one