Update Signatures in Documents

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:

import shutil

from groupdocs.signature import Signature
from groupdocs.signature.options import TextSearchOptions

# update() saves the changes into the opened document, so work on a copy
shutil.copy("signed.docx", "updated.docx")

with Signature("updated.docx") as signature:
    # Find the text signatures that GroupDocs.Signature added to the document
    options = TextSearchOptions()
    options.skip_external = True
    signatures = signature.search([options]).signatures

    if signatures:
        # Change a found signature, then pass it to update()
        text_signature = signatures[0]
        text_signature.text = "Updated Signature Text"
        if signature.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:

Close
Loading

Analyzing your prompt, please hold on...

An error occurred while retrieving the results. Please refresh the page and try again.