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. See more examples here.
Here are the steps to add metadata signatures into Image with GroupDocs.Signature:
Create new instance of Signature class and pass source document path as a constructor parameter.
This example shows how to sign png image with metadata e-signatures
using(Signaturesignature=newSignature("sample.png")){// create Metadata option with predefined Metadata textvaroptions=newMetadataSignOptions();// Specify different Metadata Signatures and add them to options signature collectionushortimgsMetadataId=41996;// Create several Image Metadata signatures with different typesoptions.Add(newImageMetadataSignature(imgsMetadataId++,"Mr.Scherlock Holmes"))// String value.Add(newImageMetadataSignature(imgsMetadataId++,DateTime.Now))// Date Time value.Add(newImageMetadataSignature(imgsMetadataId++,123456))// Integer value.Add(newImageMetadataSignature(imgsMetadataId++,123.456D))// Double value.Add(newImageMetadataSignature(imgsMetadataId++,123.456M))// Decimal value.Add(newImageMetadataSignature(imgsMetadataId++,123.456F));// Float value// add these signatures to optionsoptions.Signatures.AddRange(signatures);signature.Sign("SampleSigned.png",options);}
Advanced Usage Topics
To learn more about document eSign features, please refer to the advanced usage section.
More resources
GitHub Examples
You may easily run the code above and see the feature in action in our GitHub examples: