eSign Image with Metadata signature

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 →

Overview

Metadata signature for Image document is an electronic signature based on image metadata standard. Most image formats support metadata specification or EXIF. Image metadata is dictionary map with unique whole short identifier in range 0-65535, Some identifiers are reserved by EXIF specification. From signature perspective image metadata may content any hidden value of standard (int,char, string) or custom type (user defined class), be encrypted and decrypted back by known key over Search method.

GroupDocs.Signature provides ImageMetadataSignature class to specify Metadata e-signature for image documents. Image document metadata contains pair with unique identifier Id and its Value.
Image document metadata could keep big amount of data that provides ability to keep serialized custom objects with additional encryption in there.

Here are the steps to add metadata signatures into Image with GroupDocs.Signature:

How to eSign Image with Metadata signature

This example shows how to sign png image with metadata e-signatures

from datetime import datetime

from groupdocs.signature import Signature
from groupdocs.signature.options import MetadataSignOptions
from groupdocs.signature.domain import ImageMetadataSignature


def sign_png():
    with Signature("sample.png") as signature:
        options = MetadataSignOptions()

        # Image metadata entries are identified by a number, not a name
        metadata_id = 41996

        # Add several Image Metadata signatures with values of different types
        options.add(ImageMetadataSignature(metadata_id, "Mr.Scherlock Holmes"))  # text
        options.add(ImageMetadataSignature(metadata_id + 1, datetime.now()))      # date and time
        options.add(ImageMetadataSignature(metadata_id + 2, 123456))              # whole number
        options.add(ImageMetadataSignature(metadata_id + 3, 123.456))             # floating-point number

        # Sign the image and save the result
        result = signature.sign("signed.png", options)
        print(f"Signed with {len(result.succeeded)} metadata signature(s):")
        for item in result.succeeded:
            print(f"  {item.id}")


if __name__ == "__main__":
    sign_png()

sample.png is the sample file used in this example. Click here to download it.

Binary file (PNG, 77 KB)

Download full output

More resources

GitHub Examples

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

Free Online Apps

Along with the full-featured Python library, we provide simple but powerful free online apps.

To sign PDF, Word, Excel, PowerPoint, and other documents you can use the online apps from the GroupDocs.Signature App Product Family.