Skip to content

Commit

Permalink
[fix] Some document has integer mediabox data type, cast to float for…
Browse files Browse the repository at this point in the history
… better compatibility
  • Loading branch information
pebri86 committed Dec 20, 2024
1 parent 6ad4154 commit 2a8665e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyhanko/sign/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -1829,8 +1829,8 @@ def __init__(
pagetree_obj = include_on_page.get_object()
obj = pagetree_obj.get("/Rotate", 0)
media_box = pagetree_obj["/MediaBox"]
page_width = media_box[2] - media_box[0]
page_height = media_box[3] - media_box[1]
page_width = float(media_box[2] - media_box[0])
page_height = float(media_box[3] - media_box[1])
x1, y1, x2, y2 = rect
rotate = obj if isinstance(obj, int) else obj.get_object()
if rotate == 90:
Expand Down

0 comments on commit 2a8665e

Please sign in to comment.