GroupDocs.Signature for Python via .NET provides functionality to manipulate QR code signatures’ location, size, encode type, and textual content.
Please note that the update method modifies the same document that was passed to the constructor of the Signature class.
Here are the steps to update a QR code signature in a document with GroupDocs.Signature:
Create a new instance of the Signature class and pass the source document path as a constructor parameter
Call the search method to obtain a list of QR code signatures
Select from the list the QrCodeSignature object(s) that should be updated
Call the Signature object’s update method and pass one or several signatures to it
This example shows how to update a QR code signature that was found using the search method:
importgroupdocs.signatureassignaturefromgroupdocs.signature.optionsimportQrCodeSearchOptions# Initialize signaturewithsignature.Signature("signed.pdf")assign:# Create search optionsoptions=QrCodeSearchOptions()# Search for QR code signatures in documentsignatures=sign.search(options)iflen(signatures)>0:# Get first QR code signatureqr_code_signature=signatures[0]# Change positionqr_code_signature.left=100qr_code_signature.top=100# Update the signatureresult=sign.update(qr_code_signature)ifresult.updated_count>0:print(f"Signature with QR code '{qr_code_signature.text}' was updated in the document")else:print("Signature was not updated in the document!")
More Resources
GitHub Examples
You may easily run the code above and see the feature in action in our GitHub examples: