Skip to content

Commit

Permalink
[fix] cms_embedder to handle rotate object
Browse files Browse the repository at this point in the history
  • Loading branch information
pebri86 committed Dec 20, 2024
1 parent c5cdea5 commit 6ad4154
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pyhanko/sign/signers/cms_embedder.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,11 @@ def write_cms(
appearance_setup = sig_obj_setup.appearance_setup
if appearance_setup is not None:
sig_annot = get_sig_field_annot(sig_field)
appearance_setup.apply(sig_annot, writer)
page_ref = writer.find_page_for_modification(new_field_spec.on_page)[0]
ref = page_ref.get_object()
obj = ref.get("/Rotate", 0)
rotate = obj if isinstance(obj, int) else obj.get_object()
appearance_setup.apply(sig_annot, writer, rotate)

sig_obj = sig_obj_setup.sig_placeholder
sig_obj_ref = writer.add_object(sig_obj)
Expand Down

0 comments on commit 6ad4154

Please sign in to comment.