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 getSucceeded() list is a DocumentResultSignature for one archive document with the signatures found in it, and the getFailed() 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.
Call search method of Signature class instance and pass list of the SearchOptions to it.
This example shows how to make advanced search for any data within the archive documents.
Signaturesignature=newSignature("archive.zip");try{// create list of search options
BarcodeSearchOptionsbcOptions=newBarcodeSearchOptions(BarcodeTypes.Code128);QrCodeSearchOptionsqrOptions=newQrCodeSearchOptions(QrCodeTypes.QR);// setup search options
List<SearchOptions>listOptions=newArrayList<SearchOptions>();listOptions.add(bcOptions);listOptions.add(qrOptions);// search archive for documents
SearchResultsearchResult=signature.search(listOptions);// check the result
System.out.println("\nList of successfully processed documents:");intnumber=1;for(BaseSignatureitem:searchResult.getSucceeded()){DocumentResultSignaturedocument=(DocumentResultSignature)item;System.out.println("Document #"+number+++": "+document.getFileName()+". Processed: "+document.getProcessingTime()+", mls");for(BaseSignaturetemp:document.getSucceeded()){System.out.println("\t\t#"+temp.getSignatureId()+": "+temp.getSignatureType());}}if(searchResult.getFailed().size()>0){System.out.println("\nList of failed documents:");number=1;for(BaseSignatureitem:searchResult.getFailed()){DocumentResultSignaturedocument=(DocumentResultSignature)item;System.out.println("ERROR in Document #"+number+++"-"+document.getFileName()+": "+document.getErrorMessage());}}}finally{signature.dispose();}