GroupDocs.Signature provides the ability to search for metadata electronic signatures in documents. Metadata signatures allow you to add custom metadata properties to your documents, which can be used to store additional information about the document or its signatures.
How to Search for Metadata Signatures
The Signature class provides the search method which allows you to search for metadata signatures in documents. Here’s how to use it:
Create a new instance of the Signature class and pass the source document path as a parameter.
Call the search method of the Signature class instance and pass a list with the search options to it.
Process the search results: the signatures property of the returned SearchResult holds the found MetadataSignature objects, each with a name, a value and a value type.
Here’s an example of how to search for metadata signatures in a document. The result includes the document’s standard properties, such as Producer and CreateDate, as well as the custom ones:
You can search for metadata signatures by name: set the name property of MetadataSearchOptions and choose how it is compared with name_match_type (TextMatchType):
fromgroupdocs.signatureimportSignaturefromgroupdocs.signature.domainimportTextMatchTypefromgroupdocs.signature.optionsimportMetadataSearchOptionsdefsearch_metadata_by_name():withSignature("signed.pdf")assignature:options=MetadataSearchOptions()# Return only the metadata signature named "Author"options.name="Author"options.name_match_type=TextMatchType.EXACTresult=signature.search([options])print(f"Found {len(result.signatures)} matching metadata signature(s)")formetadatainresult.signatures:print(f"{metadata.name} = {metadata.value}")if__name__=="__main__":search_metadata_by_name()
signed.pdf is the sample file used in this example. Click here to download it.
Found 1 matching metadata signature(s)
Author = John Smith