Skip to content

page.set_rotation() Over Rotating Some Pages #300

Closed Answered by mara004
MAbdElRaouf asked this question in Q&A
Discussion options

You must be logged in to vote

Rotation is just a programmatic value to be applied on top of the base coordinate system. It doesn't necessarily align with visuals.
set_rotation() quite simply sets the /Rotation entry in the PDF's page dictionary. In that sense, it's behaving correctly, even if, in this case, the result does not align with human visual expectations.

From what you've written I'd guess that set_rotation(90) for page numbers [1,2] and set_rotation(0) for [3,4] would result in no visual rotation.

I'm not aware of a straightforward way to automatically handle cases where visual and programmatic rotation don't match.
You'd probably have to do layout analysis, which is complex and requires much more computatio…

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@MAbdElRaouf
Comment options

@mara004
Comment options

@mara004
Comment options

@MAbdElRaouf
Comment options

@mara004
Comment options

Answer selected by mara004
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #299 on February 25, 2024 16:37.