Refactor plain text and "words" extraction when option sort=True is used:
We previously simply sorted output by ascending bottom and left coordinate. This change collects words (and respectively text portions) that are approximately on the same line. Apart from extremely malformed pages, words and text are returned in "natural" reading sequence.
This change also suppresses line breaks generated by MuPDF just because of large horizontal distances, as it e.g. often happens between table cell content of the same row.
This change does not alter the user's API and is only activated if Page.get_text(sort=True) or Page.get_text("words", sort=True) is used.
Refactor plain text and "words" extraction when option sort=True is used: We previously simply sorted output by ascending bottom and left coordinate. This change collects words (and respectively text portions) that are approximately on the same line. Apart from extremely malformed pages, words and text are returned in "natural" reading sequence.
This change also suppresses line breaks generated by MuPDF just because of large horizontal distances, as it e.g. often happens between table cell content of the same row.
This change does not alter the user's API and is only activated if
Page.get_text(sort=True)
orPage.get_text("words", sort=True)
is used.