update _rotate function to account for /Rotate being set to an IndirectObject instead of an int

This commit is contained in:
Kyle Gengler 2017-03-28 06:58:36 -05:00
parent 2a9d76d124
commit c3231c7ded
No known key found for this signature in database
GPG Key ID: 0FB671F4E022BE17
1 changed files with 2 additions and 1 deletions

View File

@ -2226,7 +2226,8 @@ class PageObject(DictionaryObject):
return self
def _rotate(self, angle):
currentAngle = self.get("/Rotate", 0)
rotateObj = self.get("/Rotate", 0)
currentAngle = rotateObj if isinstance(rotateObj, int) else rotateObj.getObject()
self[NameObject("/Rotate")] = NumberObject(currentAngle + angle)
def _mergeResources(res1, res2, resource):