Create and Run Custom Rulesets with the Document Analyzer Demo

This tutorial shows how to create and run custom rulesets using the LEADTOOLS Document Analyzer Demo.

Overview  
Summary This tutorial covers how to create and run custom rulesets using the Document Analyzer Demo.
Completion Time 5 minutes
Platform .NET Framework
IDE Visual Studio 2017, 2019
Development License Download LEADTOOLS

Required Knowledge

Download and install the LEADTOOLS v21 SDK here, and make sure that the license and key files are located in the <INSTALL_DIR>\LEADTOOLS21\Support\Common\License directory. To set the license, refer to the Add References and Set a License tutorial. For an introduction to the Document Analyzer Demo, refer to the Get Started with the Document Analyzer Demo tutorial.

The installed LEADTOOLS SDK contains a Document Analyzer Demo. It harnesses the power of LEAD's image processing technology to intelligently identify the document components and features used to recognize and classify scanned documents. It provides a set of classes and interfaces for automated, unstructured forms processing. This framework provides a high-level way to use LEADTOOLS form information extraction within text, as well as the functionality to complete different actions. Users can inherit from the framework's interfaces to implement their own custom repositories as well.

Open the Document Analyzer Demo

Navigate to the example source code for the project:

<INSTALL_DIR>\LEADTOOLS21\Examples\DotNet\CS\DocumentAnalyzerDemo\DocumentAnalyzerDemo_4.csproj

Open the project in Visual Studio and open the Document Analyzer Demo using Start or F5.

With the Document Analyzer Demo running, select File -> Open Document. Open the LEADTOOLS Demo PDF document ("leadtools.pdf") included with the v21 toolkit, which can be found at <INSTALL_DIR>\LEADTOOLS21\Resources\Images\leadtools.pdf. The following screenshot shows the demo with that file loaded:

LEADTOOLS Document Analyzer Demo with leadtools.pdf loaded

Once the document is loaded a sample ruleset is created by default to the left of the document.

LEADTOOLS Document Analyzer Demo highlighting default ruleset

Defining a Custom Ruleset

After opening the document ("leadtools.pdf"), add a Custom Ruleset by clicking Custom Rule on the toolbar.

In the dialog box, define the name of your Ruleset in the Name text box, then define the value in the Value text box. For the purposes of this tutorial, call it lead. Create a Regular Expression by selecting the Expression Builder button.

The Custom Rule Dialog Box

Define additional options on the Custom Rule dialog box as follows:

Click OK to create custom ruleset.

Running a Custom Ruleset

Run the Ruleset by clicking the Run button on the toolbar or pressing CTRL+SHIFT+F5.

Running a Highlight Ruleset

Highlight information in the document by clicking the Highlight Information button in the LEADTOOLS Document Analyzer Demo. The following screenshot shows the file after the button has been clicked and the instances of "LEAD" have been highlighted.

LEADTOOLS Document Analyzer Demo Showing Results After Running Highlight Ruleset

Running a Redaction Ruleset

Redact information in the document by clicking the Redact Information button in the LEADTOOLS Document Analyzer Demo. The following screenshot shows the file after the button has been clicked and the instances of "LEAD" have been redacted.

LEADTOOLS Document Analyzer Demo Showing Results After Running Redact Ruleset

Analyze the document by opening the File menu and then selecting Open Document.

See also

Help Version 21.0.2023.3.1
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.