Skip to content

How to ignore page rotation while signing pdf using pyHanko? #150

Answered by MatthiasValvekens
ihegde asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @ihegde,

Per the PDF standard, the default behaviour of the Rotate entry in a page dictionary is to rotate all annotations along with the page content. That also applies to (visible) signature fields, and I'm pretty sure that's the cause of the behaviour you're seeing.

The behaviour you want can be achieved by setting the NoRotate flag on the annotation, but unfortunately there's no convenient API to set that bit for you in pyHanko. It's not hard to add an option to SigFieldSpec to toggle that one, though. I'll see what I can do about that and get back to you.

In the meantime, you can work around the issue as follows:

  • Set up a signature field using pyhanko.sign.fields.append_signature…

Replies: 1 comment 15 replies

Comment options

You must be logged in to vote
15 replies
@ihegde
Comment options

@MatthiasValvekens
Comment options

@ihegde
Comment options

@MatthiasValvekens
Comment options

@ihegde
Comment options

Answer selected by ihegde
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
enhancement New feature or request question Further information is requested
2 participants