id: advanced-search-archive-documents
url: signature/net/advanced-search-archive-documents
title: Advanced search archive documents
linkTitle: π Archive
weight: 16
description: “This article explains how to make advanced search within the archive that contains several documents for any electronic signatures with GroupDocs.Signature API.”
keywords:
productName: GroupDocs.Signature for .NET
toc: True
structuredData:
showOrganization: True
application: name: Advanced search for various signatures within the archive files in C# description: Advanced search for all supported signatures within the archives fast and easily with C# language and GroupDocs.Signature for .NET APIs
productCode: signature
productPlatform: net
showVideo: True
howTo:
name: How to search data in the archive using C#
description: Get additional information of advanced searching for any signature data within the archive documents with C#
steps:
- name: Upload supported archive file (ZIP, TAR or 7Z).
text: Instantiate object of Signature passing file as a constructor parameter. You can use either file path or file stream.
- name: Create one or many search options
text: Instantiate specific SearchOptions (one or many) object(s) providing all required data.
- name: Get list of the corresponding signatures
text: Invoke method Search passing search options.
- name: Process list of found items
text: Loop through list of found items and process in demanded way.
GroupDocs.SignatureΒ providesΒ archiveSearchOptionsΒ classΒ to specify different options to search text data within the archive documents.
Please be aware that the search result will be always as the MetadataSignature.
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");}}}
More resources
GitHub Examples
You may easily run the code above and see the feature in action in ourΒ GitHub examples: