Sometimes you may want to search for electronic signatures of different types simultaneously. GroupDocs.Signature allows searching documents for different signature types in an easy and intuitive way. In common words the idea is to pass collection of desired signature types to Search method.
Here are the steps to search for multiple signatures types within the document with GroupDocs.Signature:
Create new instance of Signature class and pass source document path as a constructor parameter.
Instantiate search options for required signature types and them to collection of List<SearchOptions> type.
The possible options are:
Call search method of Signature class instance and pass collection of search options to it.
This example shows how to search for multiple electronic signature types in the document.
Signaturesignature=newSignature("SingedSample.pdf");BarcodeSearchOptionsbarcodeOptions=newBarcodeSearchOptions();barcodeOptions.setAllPages(true);barcodeOptions.setEncodeType(BarcodeTypes.Code128);QrCodeSearchOptionsqrCodeOptions=newQrCodeSearchOptions();qrCodeOptions.setAllPages(true);qrCodeOptions.setEncodeType(QrCodeTypes.QR);qrCodeOptions.setText("John");qrCodeOptions.setMatchType(TextMatchType.Contains);MetadataSearchOptionsmetadataOptions=newMetadataSearchOptions();metadataOptions.setAllPages(true);metadataOptions.setIncludeBuiltinProperties(true);// add options to list
List<SearchOptions>listOptions=newArrayList<SearchOptions>();listOptions.add(barcodeOptions);listOptions.add(qrCodeOptions);listOptions.add(metadataOptions);// search for signatures in document
SearchResultresult=signature.search(listOptions);if(result.getSignatures().size()>0){System.out.print("\nSource document contains following signatures.");for(BaseSignatureresSignature:result.getSignatures()){System.out.print("Signature found at page "+resSignature.getPageNumber()+" with type "+resSignature.getSignatureType());}}else{System.out.print("No one signature was found.");}
More resources
Advanced Usage Topics
To learn more about document eSign features, please refer to the advanced usage section.
GitHub Examples
You may easily run the code above and see the feature in action in our GitHub examples:
Along with full-featured .NET library we provide simple, but powerful free Apps. You are welcome to eSign PDF, Word, Excel, PowerPoint documents with free to use online GroupDocs Signature App.
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.