mirror of
https://github.com/jsvine/pdfplumber.git
synced 2026-08-29 08:34:23 +08:00
Rework .extract_words and add use_text_flow param
Taking @samkit-jain's smart question about sort-order into account, this commit reworks `.extract_words`, making the sorting more explicit, and adding an option to *not* sort, via `use_text_flow=True`, which follows the original PDF's text flow, rather than presorting all characters top-down, left-right. To do so required rethinking the word-delineation logic, which in turn motivated a shift toward a more object-oriented approach (especially to keep track of settings without passing them from function to function). Now `.extract_text`'s logic is encapsulated in a new class, `TextExtractor`.
This commit is contained in:
Binary file not shown.
Reference in New Issue
Block a user