Search for multiple e-signature types

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.

The possible options are:

This example shows how to search for multiple electronic signature types in the document.

using (Signature signature = new Signature("SingedSample.pdf"))
{
    // define few search options
    BarcodeSearchOptions barcodeOptions = new BarcodeSearchOptions()
    {
        EncodeType = BarcodeTypes.Code128
    };
    QrCodeSearchOptions qrCodeOptions = new QrCodeSearchOptions()
    {
        EncodeType = QrCodeTypes.QR,
        Text = "John",
        MatchType = TextMatchType.Contains
    };
    MetadataSearchOptions metadataOptions = new MetadataSearchOptions()
    {
        IncludeBuiltinProperties = true
    };

    // add options to list
    List<SearchOptions> listOptions = new List<SearchOptions>();
    listOptions.Add(barcodeOptions);
    listOptions.Add(qrCodeOptions);
    listOptions.Add(metadataOptions);

    // search for signatures in document
    SearchResult result = signature.Search(listOptions);
    if (result.Signatures.Count > 0)
    {
        Console.WriteLine("\nSource document contains following signatures.");
        foreach (var resSignature in result.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:

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.