Skip to content

How to get additional information from a signed pdf file #185

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

You must be logged in to vote

Hi @areqq,

There's an embedded_signatures property on PdfFileReader that allows you to loop over the signatures in the document. The API for EmbeddedPdfSignature is available in the documentation. Not all of the properties you mention are exposed directly, but you can get access to the signature dictionary itself via the sig_object field. In other words, to get the Reason field, you'd write something like

emb_sig = r.embedded_signatures[0]
reason = emb_sig.sig_object['/Reason']

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by areqq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants