Advanced search for Metadata signatures

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 ability to search Metadata signatures and convert obtained values to various data types.

Here are the steps to search for Metadata signature and obtain required data type with GroupDocs.Signature:

  • Create new instance of Signature class and pass source document path or stream as a constructor parameter.

  • Create objects of MetadataSearchOptions class

  • Call search method of Signature class instance and pass MetadataSearchOptions  to it.

  • Call proper conversion method to obtain corresponding Metadata value to required data type.

Search for electronic Metadata signature values with various data type

This example shows how to search for Metadata signature values with various data types.

Signature signature = new Signature("signed.pdf");
try
{
    // search for signatures in document
    List<PdfMetadataSignature> signatures = signature.search(PdfMetadataSignature.class, SignatureType.Metadata);
    // See example SignPdfWithMetadata with added various data type values to signatures
    try
    {
        for (PdfMetadataSignature mdSignature : signatures)
        {
            switch (mdSignature.getName())
            {
                case "Author":
                    System.out.println("\t[" + mdSignature.getName() + "] as String = " + mdSignature.toString());
                    break;
                case "CreatedOn":
                    System.out.println("\t[" + mdSignature.getName() + "] as Date = " + mdSignature.toDateTime());
                    break;
                case "DocumentId":
                    System.out.println("\t[" + mdSignature.getName() + "] as Integer = " + mdSignature.toInteger());
                    break;
                case "SignatureId":
                    System.out.println("\t[" + mdSignature.getName() + "] as Double = " + mdSignature.toDouble());
                    break;
                case "Amount":
                    System.out.println("\t[" + mdSignature.getName() + "] as Double = " + mdSignature.toDouble());
                    break;
                case "Total":
                    System.out.println("\t[" + mdSignature.getName() + "] as Float = " + mdSignature.toSingle());
                    break;
            }
        }
    }
    catch (Exception ex)
    {
        System.out.println("Error obtaining signature: " + ex.getMessage());
    }
}
finally
{
    signature.dispose();
}

More resources

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.