MetadataSignOptions class

MetadataSignOptions class

Represents Metadata signature options.

Learn more

The MetadataSignOptions type exposes the following members:

Constructors

Constructor Description
init Initializes a new instance of the MetadataSignOptions class with default values.
init Initializes a new instance of MetadataSignOptions with metadata.

Methods

Method Description
add Add existing MetadataSignature instance to collection.
add_image_signature Creates a new ImageMetadataSignature with the given arguments and adds it to the collection.
add_image_signature_uint16
add_metadata_signature
add_pdf_signature Creates a new PdfMetadataSignature with the given arguments and adds it to the collection.
add_pdf_signature_file
add_pdf_signature_string

Properties

Property Description
data_encryption The implementation of IDataEncryption used to encrypt all metadata signatures in this options collection.
signatures The metadata signatures associated with the signature.
all_pages The signature will be placed on all document pages. (inherited from SignOptions)
appearance The additional signature appearance. (inherited from SignOptions)
document_type The document type of the signature options (DocumentType). (inherited from SignOptions)
extensions The signature extensions. (inherited from SignOptions)
hash_algorithm The hash algorithm to be used for cryptographic operations. Supported exclusively for digital signatures in PDF files. (inherited from SignOptions)
page_number The document page number for signing. (inherited from SignOptions)
pages_setup The options to specify pages to be signed. (inherited from SignOptions)
signature_type The signature type (SignatureType). (inherited from SignOptions)
zorder The Z-order position of the text signature, which determines the display order of overlapping signatures. (inherited from SignOptions)

Example

from datetime import datetime
from groupdocs.signature import Signature
from groupdocs.signature.options import MetadataSignOptions
from groupdocs.signature.domain import WordProcessingMetadataSignature

with Signature("sample.docx") as signature:
    options = MetadataSignOptions()
    signatures = [
        WordProcessingMetadataSignature("Author", "Mr.Scherlock Holmes"),
        WordProcessingMetadataSignature("DateCreated", datetime.now()),
        WordProcessingMetadataSignature("DocumentId", 123456),
        WordProcessingMetadataSignature("SignatureId", 123.456),
    ]
    options.signatures.add_range(signatures)
    result = signature.sign("signed.docx", options)
    print(f"Signed with {len(result.succeeded)} metadata signature(s).")

See Also