eSign Spreadsheet with Metadata signature
Leave feedback
On this page
Overview
GroupDocs.Signature provides SpreadsheetMetadataSignature class to specify different Metadata signature objects for MetadataSignOptions instance to sign Spreadsheet document files.
Spreadsheet document metadata is hidden attributes, some of them are visible only over viewing standard document properties like Author, Creation Date, Producer, Entry, Keywords etc. Spreadsheet document metadata contains pair of Name and Value, Name should be unique within the document. Spreadsheet document metadata could keep big amount of data that allows provides ability to keep serialized custom objects with additional encryption in there.
Here are the steps to add metadata signatures into Spreadsheet document with GroupDocs.Signature:
Create new instance of Signature class and pass source document path as a constructor parameter.
This example shows how to add Metadata e-signature to a Spreadsheet document.
fromdatetimeimportdatetimefromgroupdocs.signatureimportSignaturefromgroupdocs.signature.optionsimportMetadataSignOptionsfromgroupdocs.signature.domainimportSpreadsheetMetadataSignaturedefsign_xlsx():withSignature("sample.xlsx")assignature:options=MetadataSignOptions()# Create a few Spreadsheet Metadata signaturessignatures=[SpreadsheetMetadataSignature("Author","Mr.Scherlock Holmes"),SpreadsheetMetadataSignature("DateCreated",datetime.now()),SpreadsheetMetadataSignature("DocumentId",123456),SpreadsheetMetadataSignature("SignatureId",123.456),]# Add them to the optionsoptions.signatures.add_range(signatures)# Sign the spreadsheet and save the resultresult=signature.sign("signed.xlsx",options)print(f"Signed with {len(result.succeeded)} metadata signature(s):")foriteminresult.succeeded:print(f" {item.name}")if__name__=="__main__":sign_xlsx()
sample.xlsx is the sample file used in this example. Click here to download it.