GroupDocs.Signature provides the ability to search for multiple types of electronic signatures in documents simultaneously. This allows you to find different types of signatures like text, image, digital, barcode, QR code, and form field signatures in a single search operation.
How to Search for Multiple Signature Types
The Signature class provides the search method which allows you to search for multiple types of signatures in documents. Here’s how to use it:
Create a new instance of the Signature class and pass the source document path as a parameter.
Create search options for each type of signature you want to search for.
Call the search method of the Signature class instance and pass the list of search options to it.
Process the search results: the signatures property of the returned SearchResult holds the signatures of all requested types. The signature_type property of each one tells its SignatureType.
Here’s an example of how to search for multiple types of signatures in a document:
fromgroupdocs.signatureimportSignaturefromgroupdocs.signature.optionsimport(BarcodeSearchOptions,FormFieldSearchOptions,ImageSearchOptions,QrCodeSearchOptions,TextSearchOptions)defsearch_types():withSignature("signed.pdf")assignature:# One search call with options for every signature type to findoptions=[TextSearchOptions(),ImageSearchOptions(),BarcodeSearchOptions(),QrCodeSearchOptions(),FormFieldSearchOptions(),]result=signature.search(options)print(f"Found {len(result.signatures)} signature(s)")forfoundinresult.signatures:print(f"{found.signature_type.name} signature on page {found.page_number} "f"at ({found.left}, {found.top})")if__name__=="__main__":search_types()
signed.pdf is the sample file used in this example. Click here to download it.
Found 10 signature(s)
TEXT signature on page 1 at (50, 480)
TEXT signature on page 1 at (50, 530)
TEXT signature on page 1 at (50, 379)
IMAGE signature on page 1 at (50, 415)
BARCODE signature on page 1 at (400, 375)
BARCODE signature on page 1 at (400, 430)
QR_CODE signature on page 1 at (270, 370)
FORM_FIELD signature on page 1 at (50, 530)
FORM_FIELD signature on page 1 at (270, 532)
[TRUNCATED]