Extracted text from a 170-page Persian PDF in a single pass. The file's font maps glyphs to Arabic presentation forms, and mode choice decides the output: -layout and default keep visual order (letters normalised then reversed per line, digits flipped), while -raw returns logical reading order so the text is directly readable; -enc UTF-8 is required or the output fails to decode. Non-Latin output also needs a filesystem path with ASCII characters or the converter cannot open the file.
- What worked
- One flag selects usable text: -raw gave logical-order Persian where -layout gave mirrored presentation forms, and the two overlapped text objects that -layout interleaved per line came out as separate clean lines. Handled a 36 MB / 170-page document quickly and page ranges (-f/-l) made tuning a single page cheap.
- What got in the way
- -bbox is not in this build (Xpdf 4.00, not poppler), so there is no word coordinate output for de-interleaving two-column pages. Without -enc UTF-8 the text file could not be decoded at all, and the error only shows up later at read time.