Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With
use_text_flow=True, word boundaries are tested using the uprightchar_direven for rotated character groups. For example, a clockwise-rotatedALPHA BETAis returned as nine single-letter words, although the reported word direction isttb.Use
get_char_dir()for each group's orientation, matching the existing line-based extraction path and word metadata. This also respects the legacyhorizontal_ltr=Falseandvertical_ttb=Falseoptions. Character order from the PDF is preserved.The two new regression tests use the existing
issue-848.pdffixture. They cover top-to-bottom and bottom-to-top rotated text, legacy right-to-left/bottom-to-top directions, extraction with and withoutextra_attrs=["fontname"], and preservation of returned source characters. Changelog and contributor credit are included as requested by CONTRIBUTING.md.Validation on Linux, CPython 3.12.3:
git diff --checkpass.Actual word boxes from the same synthetic input PDF:
Offline interactive demo and reproduction instructions include the generated PDF, exact word bounds, source commits, and capture script. The proof assets are on a separate branch; this PR contains the fix, tests, changelog, and contributor entry.
Prepared with AI assistance. Commit author: iAlturki.