You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rotating a page, e.g., using page.RotateClockwise() only updates the /Rotate attribute:
defrotateClockwise(self, angle):
""" Rotates a page clockwise by increments of 90 degrees. :param int angle: Angle to rotate the page. Must be an increment of 90 deg. """assertangle%90==0self._rotate(angle)
returnselfdefrotateCounterClockwise(self, angle):
""" Rotates a page counter-clockwise by increments of 90 degrees. :param int angle: Angle to rotate the page. Must be an increment of 90 deg. """assertangle%90==0self._rotate(-angle)
returnselfdef_rotate(self, angle):
currentAngle=self.get("/Rotate", 0)
self[NameObject("/Rotate")] =NumberObject(currentAngle+angle)
The expected behavior is that other attributes that depend on a page's origin should also be updated based on rotation. For example:
/mediaBox - The x, y dimensions of the page. If the page is rotated 90 degrees, the values in the mediaBox should swap places
/Annots.../Rect - The coordinates of a rectangular bounding box for an annotation. These coordinates are [x0, y0, x1, y1], with the origin being at the bottom left of the page. If the page is rotated, the origin with respect to the annotations according from the users perspective has changed and so should the coordinates.
Notes
I created this issue to capture a more general issue that is happening in more specific cases that haven't been resolved:
The text was updated successfully, but these errors were encountered:
thommiano
changed the title
Page rotation does not modify page attributes that depend on page orientation
Feature request: Modify page attributes that depend on page orientation after rotating page
Aug 6, 2021
MartinThoma
changed the title
Feature request: Modify page attributes that depend on page orientation after rotating page
ENH: Modify page attributes that depend on page orientation after rotating page
Jun 26, 2022
Rotating a page, e.g., using
page.RotateClockwise()
only updates the/Rotate
attribute:The expected behavior is that other attributes that depend on a page's origin should also be updated based on rotation. For example:
/mediaBox
- The x, y dimensions of the page. If the page is rotated 90 degrees, the values in the mediaBox should swap places/Annots
.../Rect
- The coordinates of a rectangular bounding box for an annotation. These coordinates are [x0, y0, x1, y1], with the origin being at the bottom left of the page. If the page is rotated, the origin with respect to the annotations according from the users perspective has changed and so should the coordinates.Notes
I created this issue to capture a more general issue that is happening in more specific cases that haven't been resolved:
The text was updated successfully, but these errors were encountered: