Update Image signatures in document

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 provides ImageSignature class to manipulate barcode signatures location, size and textual content. 

The update method writes the changed document to the file path or stream that you pass to it. To change the source document itself, pass the same path that you passed to the Signature constructor.

Here are the steps to update Barcode signature in the document with GroupDocs.Signature:

This example shows how to update Image signature that was found using  search method.

Signature signature = new Signature("sampleSigned.pdf");
try {
    ImageSearchOptions options = new ImageSearchOptions();
    // search for image signatures in document
    List<ImageSignature> signatures = signature.search(ImageSignature.class, options);
    if (signatures.size() > 0) {
        ImageSignature imageSignature = signatures.get(0);
        // change Image properties
        imageSignature.setTop(200);
        imageSignature.setLeft(200);
        imageSignature.setWidth(300);
        imageSignature.setHeight(150);

        // save the document with the updated signature to a new file
        boolean result = signature.update("sampleUpdated.pdf", imageSignature);
        if (result) {
            System.out.println("Signature with Top " + imageSignature.getTop() + " was updated in the document.");
        } else {
            System.out.println("Signature was not updated in the document! Signature with Top " + imageSignature.getTop() + " was not found!");
        }
    }
} finally {
    signature.dispose();
}

More resources

Advanced Usage Topics

To learn more about document eSign features, please refer to the advanced usage section.

GitHub Examples 

You may easily run the code above and see the feature in action in our GitHub examples:

Free Online App 

Along with full-featured Java library we provide simple, but powerful free Apps.
You are welcome to eSign PDF, Word, Excel, PowerPoint documents with free to use online GroupDocs Signature App.