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 first groups characters into lines by vertical overlap, so tall and short glyphs on one baseline stay on the same line, then writes the lines top to bottom and the characters of each line left to right. Lines are separated by CR LF
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