GroupDocs.Signature for Python via .NET provides functionality to manipulate image signatures’ location, size, and other properties.
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 an Image 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 image signatures
Select from the list the ImageSignature 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 an Image signature that was found using the search method:
importgroupdocs.signatureassignaturefromgroupdocs.signature.optionsimportImageSearchOptions# Initialize signaturewithsignature.Signature("sample_signed.pdf")assign:# Create search optionsoptions=ImageSearchOptions()# Search for image signatures in documentsignatures=sign.search(options)iflen(signatures)>0:# Get first image signatureimage_signature=signatures[0]# Change image propertiesimage_signature.top=200image_signature.left=200image_signature.width=300image_signature.height=150# Update the signatureresult=sign.update(image_signature)ifresult.updated_count>0:print(f"Signature with top position '{image_signature.top}' was updated in the document")else:print(f"Signature was not updated in the document! "f"Signature with top position '{image_signature.top}' was not found!")
More Resources
GitHub Examples
You may easily run the code above and see the feature in action in our GitHub examples: