GroupDocs.Signature searches all documents of an archive in one call: compose a list of SearchOptions objects, such as BarcodeSearchOptions or QrCodeSearchOptions, and pass it to the Search method.
The result is a SearchResult object. Each item of its Succeeded list is a DocumentResultSignature for one archive document with the signatures found in it, and the Failed list holds the documents that could not be processed.
Here are the steps to search for the values within the archive document with GroupDocs.Signature:
Create new instance ofΒ SignatureΒ class and pass source document path as a constructor parameter.
Instantiate the various SearchOptionsΒ objects according to your requirements. Here there’s ability to compose list of any search options types.
This example shows how to make advanced search for any data within the archive documents.
using(varsignature=newSignature("archive.zip")){// create list of signature optionsvarbcOptions=newBarcodeSearchOptions(BarcodeTypes.Code128);varqrOptions=newQrCodeSearchOptions(QrCodeTypes.QR);// setup search optionsList<SearchOptions>listOptions=newList<SearchOptions>(){bcOptions,qrOptions};// search archive for documentsvarsearchResult=signature.Search(listOptions);// check the result Console.WriteLine("\nList of successfully processed documents:");intnumber=1;foreach(DocumentResultSignaturedocumentinsearchResult.Succeeded){Console.WriteLine($"Document #{number++}: {document.FileName}. Processed: {document.ProcessingTime}, mls");foreach(BaseSignaturetempindocument.Succeeded){Console.WriteLine($"\t\t#{temp.SignatureId}: {temp.SignatureType}");}}if(searchResult.Failed.Count>0){Console.WriteLine("\nList of failed documents:");number=1;foreach(DocumentResultSignaturedocumentinsearchResult.Failed){Console.WriteLine($"ERROR in Document #{number++}-{document.FileName}: {document.ErrorMessage}, mls");}}}