GroupDocs.Signature for Python via .NET provides functionality to verify various types of signatures in documents. This section demonstrates how to verify different types of signatures using Python.
Basic Usage Example
Here’s a simple example showing how to verify signatures in a document. The is_valid property of the returned VerificationResult is True when the document contains valid signatures that match the verification options, and succeeded lists them:
fromgroupdocs.signatureimportSignaturefromgroupdocs.signature.domainimportTextMatchTypefromgroupdocs.signature.optionsimportTextVerifyOptions# Open the signed documentwithSignature("signed.pdf")assignature:# Create verification optionsoptions=TextVerifyOptions()options.text="John Smith"options.match_type=TextMatchType.CONTAINS# Verify signaturesresult=signature.verify(options)ifresult.is_valid:print(f"Document was verified successfully: {len(result.succeeded)} matching signature(s).")else:print("Document failed verification process.")
The following articles in this section provide detailed examples for verifying specific types of signatures: