Advanced search archive documents

GroupDocs.Signature provides archiveSearchOptions class to specify different options to search text data within the archive docuemnts. 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 varios 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.

using (var signature = new Signature("archive.zip"))
{
    // create list of signature options
    var bcOptions = new BarcodeSearchOptions(BarcodeTypes.Code128);
    var qrOptions = new QrCodeSearchOptions(QrCodeTypes.QR);

    // setup search options
    List<SearchOptions> listOptions = new List<SearchOptions>() { bcOptions, qrOptions };

    // search archive for documents
    var searchResult = signature.Search(listOptions);

    // check the result                
    Console.WriteLine("\nList of successfully processed documents:");
    int number = 1;
    foreach (DocumentResultSignature document in searchResult.Succeeded)
    {
        Console.WriteLine($"Document #{number++}: {document.FileName}. Processed: {document.ProcessingTime}, mls");
        foreach (BaseSignature temp in document.Succeeded)
        {
            Console.WriteLine($"\t\t#{temp.SignatureId}: {temp.SignatureType}");
        }
    }
    if (searchResult.Failed.Count > 0)
    {
        Console.WriteLine("\nList of failed documents:");
        number = 1;
        foreach (DocumentResultSignature document in searchResult.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:

Free Online Apps

Along with the full-featured .NET library, we provide simple but powerful free online apps.

To sign PDF, Word, Excel, PowerPoint, and other documents you can use the online apps from the GroupDocs.Signature App Product Family.

Close
Loading

Analyzing your prompt, please hold on...

An error occurred while retrieving the results. Please refresh the page and try again.