GroupDocs.Signature for Python via .NET provides functionality to update existing signatures in documents. This section demonstrates how to update different types of signatures using Python.
Basic Usage Example
Here’s a simple example showing how to update signatures in a document: find them with the search method, change their properties, and pass them to the update method. Like update itself, the example changes the document it opens, so it works on a copy:
importshutilfromgroupdocs.signatureimportSignaturefromgroupdocs.signature.optionsimportTextSearchOptions# update() saves the changes into the opened document, so work on a copyshutil.copy("signed.docx","updated.docx")withSignature("updated.docx")assignature:# Find the text signatures that GroupDocs.Signature added to the documentoptions=TextSearchOptions()options.skip_external=Truesignatures=signature.search([options]).signaturesifsignatures:# Change a found signature, then pass it to update()text_signature=signatures[0]text_signature.text="Updated Signature Text"ifsignature.update(text_signature):print(f"Updated 1 of {len(signatures)} text signature(s)")else:print("No text signatures were found")
The following articles in this section provide detailed examples for updating specific types of signatures: