In order to make multiple signatures, you must incrementally save the pdf, each time you add a signature.
If you use PyMuPDF to build the document, you must save as
saveIncr()
PDF only: saves the document incrementally. This is a convenience abbreviation for doc.save(doc.name, incremental=True, encryption=PDF_ENCRYPT_KEEP).
write(garbage=0, clean=False, deflate=False, deflate_images=False, deflate_fonts=False, ascii=False, expand=0, pretty=False, encryption=PDF_ENCRYPT_NONE, permissions=- 1, owner_pw=None, user_pw=None)
(Changed in v1.18.3)
PDF only: Writes the current content of the document to a bytes object instead of to a file. Obviously, you should be wary about memory requirements. The meanings of the parameters exactly equal those in save(). Chapter Collection of Recipes contains an example for using this method as a pre-processor to pdfrw.
I have a single pdf with multiple copies of the same document merged into one. I want to digitally sign each and every copy, meaning the pdf must have multiple digital signatures. I'm using endesive library in Python to digitally sign the PDF. The signature is showing as valid when I sign the document once but when I'm writing the same signature multiple times, it shows that the signature is invalid (when opening the document). Is it right to digitally sign a document multiple times and if yes, how to achieve it using Python's endesive library?
Can a pdf be signed multiple times using python endesive library?