Skip to content

PDF page rotation angle gives 90 degrees for visually straight readable page #1069

Discussion options

You must be logged in to vote

Our use case is to find the visual rotation angle or the text direction.

Let me strees again the point: it is no "anomaly" - but a very common thing.
As you already indicated, you need to take more than one information into account: the page rotation is one thing, another is the text orientation.
For the second aspect, you need to use a text extraction variant, which returns this information, too: page.get_text("dict").
Its output is an object of nested dictionaries. Inside there you will find a dictionary for every text line. A line dictionary has the key "dir", which contains the requested information. line["dir"] is a 2-tuple of (cosine, sine) of the angle, which the line text has wi…

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@swathy-z9q
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@swathy-z9q
Comment options

Answer selected by JorjMcKie
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants