This tutorial shows how to create and run custom rulesets using the LEADTOOLS Document Analyzer Demo.
|Summary||This tutorial covers how to create and run custom rulesets using the Document Analyzer Demo.|
|Completion Time||5 minutes|
|IDE||Visual Studio 2017, 2019|
|Development License||Download LEADTOOLS|
Download and install the LEADTOOLS v22 SDK here, and make sure that the license and key files are located in the
<INSTALL_DIR>\LEADTOOLS22\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.
Navigate to the example source code for the project:
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 v22 toolkit, which can be found at
<INSTALL_DIR>\LEADTOOLS22\Resources\Images\Leadtools.pdf. The following screenshot shows the demo with that file loaded:
Once the document is loaded a sample ruleset is created by default to the left of the document.
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.
Define additional options on the Custom Rule dialog box as follows:
Click OK to create custom ruleset.
Run the Ruleset by clicking the Run button on the toolbar or pressing CTRL+SHIFT+F5.
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.
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.
Analyze the document by opening the File menu and then selecting Open Document.