GroupDocs.Signature provides PdfMetadataSignature class to specify different Metadata signature objects for MetadataSignOptions instance.
PDF document metadata is hidden attributes, some of them are visible only over viewing standard document properties like Author, Creation Date, Producer, Entry, Keywords etc. PDF document metadata contains 3 fields: Name, Value and TagPrefix, combination of Name and Tag prefix should be unique.
PDF 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 PDF document with GroupDocs.Signature:
Create new instance of Signature class and pass source document path as a constructor parameter.
How to eSign PDF with standard metadata signatures
This example shows how to sign PDF document with standard embedded PDF document metadata signatures. If PDF metadata signature already exists with same name its value will be overwritten.
importgroupdocs.signatureassignaturefromgroupdocs.signature.optionsimportMetadataSignOptionsfromgroupdocs.signature.domainimportPdfMetadataSignature,PdfMetadataSignaturesfromdatetimeimportdatetime,timedelta# Initialize signaturewithsignature.Signature("sample.pdf")assign:# Create metadata optionsoptions=MetadataSignOptions()# Using standard Pdf Metadata Signatures with new valuessignatures=[PdfMetadataSignatures.AUTHOR.clone("Mr.Scherlock Holmes"),PdfMetadataSignatures.CREATE_DATE.clone(datetime.now()-timedelta(days=1)),PdfMetadataSignatures.METADATA_DATE.clone(datetime.now()-timedelta(days=2)),PdfMetadataSignatures.CREATOR_TOOL.clone("GD.Signature-Test"),PdfMetadataSignatures.MODIFY_DATE.clone(datetime.now()-timedelta(days=13)),PdfMetadataSignatures.PRODUCER.clone("GroupDocs-Producer"),PdfMetadataSignatures.ENTRY.clone("Signature"),PdfMetadataSignatures.KEYWORDS.clone("GroupDocs, Signature, Metadata, Creation Tool"),PdfMetadataSignatures.TITLE.clone("Metadata Example"),PdfMetadataSignatures.SUBJECT.clone("Metadata Test Example"),PdfMetadataSignatures.DESCRIPTION.clone("Metadata Test example description"),PdfMetadataSignatures.CREATOR.clone("GroupDocs.Signature")]# Add signatures to optionsoptions.signatures.extend(signatures)# Sign documentsign.sign("sample_signed.pdf",options)
More resources
GitHub Examples
You may easily run the code above and see the feature in action in our GitHub examples: