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.
This example shows how to search for multiple electronic signature types in the document.
using(Signaturesignature=newSignature("SingedSample.pdf")){// define few search optionsBarcodeSearchOptionsbarcodeOptions=newBarcodeSearchOptions(){EncodeType=BarcodeTypes.Code128};QrCodeSearchOptionsqrCodeOptions=newQrCodeSearchOptions(){EncodeType=QRCodeTypes.QR,Text="John",MatchType=TextMatchType.Contains};MetadataSearchOptionsmetadataOptions=newMetadataSearchOptions(){IncludeBuiltinProperties=true};// add options to listList<SearchOptions>listOptions=newList<SearchOptions>();listOptions.Add(barcodeOptions);listOptions.Add(qrCodeOptions);listOptions.Add(metadataOptions);// search for signatures in documentSearchResultresult=signature.Search(listOptions);if(result.Signatures.Count>0){Console.WriteLine("\nSource document contains following signatures.");foreach(varresSignatureinresult.Signatures){Console.WriteLine("Signature found at page {0} with type {1}",resSignature.PageNumber,resSignature.SignatureType);}}else{Console.WriteLine("Signatures was not found.");}}
Advanced Usage Topics
To learn more about document eSign features, please refer to the advanced usage section.
More resources
GitHub Examples
You may easily run the code above and see the feature in action in our GitHub examples: