Update Signatures in Documents

View as MarkdownMarkdown

Set up your AI agent

Give your coding agent live access to the GroupDocs documentation and API reference through the GroupDocs Docs MCP server — no install, no API key. Learn more

claude mcp add --transport http groupdocs-docs https://docs.groupdocs.com/mcp

Also process documents locally

The GroupDocs.Signature MCP server lets your agent work with files on your machine; they are never uploaded. It needs the .NET 10 SDK or Docker.

claude mcp add groupdocs-signature -- dnx GroupDocs.Signature.Mcp --yes
Folders, licensing and more →

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: