Using the BankCheckReader Class

Take the following steps to create a project and add some code that loads and reads the machine-printed information on a bank check image.

  1. Start Visual Studio 2015.
  2. Choose File->New->Project from the menu.
  3. In the New Project dialog box, choose either "Visual C# Projects" or "VB Projects" in the Projects Type List, and choose "Console Application" in the Templates List.
  4. Type the project name as "CheckReaderDemo" in the Project Name field, and then click OK. If desired, type a new location for your project or select a directory using the Browse button, and then click OK.
  5. In the Solution Explorer window, right-click on the References folder, and select "Add Reference..." from the context menu. In the "Add Reference" dialog box, select the ".NET" tab, browse to the "<INSTALLDIR>\Bin\Dotnet\Win32" folder (or "<INSTALLDIR>\Bin\Dotnet4\Win32" if you are going to use .NET 4), and select the following DLLs:

    Click the Select button and then press the OK button to add the above DLLs to the application.

  6. Add the following lines at the beginning of the file:

    using Leadtools; 
    using Leadtools.Codecs; 
    using Leadtools.Forms.Commands; 
    using Leadtools.Ocr; 

  7. In the Main() method, add the following initialization code, changing the placeholder values to the actual location and value of the license and developer key.
    string MY_LICENSE_FILE = "d:\\temp\\TestLic.lic"; 
    string MY_DEVELOPER_KEY = "xyz123abc"; 
    RasterSupport.SetLicense(MY_LICENSE_FILE, MY_DEVELOPER_KEY); 
    string chequePath =  @"C:\Users\Public\Documents\LEADTOOLS Images\BankCheck.jpg"; 
    RasterCodecs codecs = new RasterCodecs(); 
    RasterImage image; 
    BankCheckReader chequeReader = new BankCheckReader(); 
  8. Add the following lines of code to load and read the check image.
    using (IOcrEngine engine = OcrEngineManager.CreateEngine(OcrEngineType.LEAD, false)) 
       engine.Startup(codecs, null, null, null); 
       chequeReader.OcrEngine = engine; 
  9. Add the following lines of code to display the results on the console.
    foreach (KeyValuePair<string, BankCheckField> kvp in chequeReader.Results) 
       Console.WriteLine(kvp.Key + "\t\t" + kvp.Value.Text); 
  10. Finally, add the following lines of code for clean-up.
  11. Build, run, and test the program. The detected information will be printed in the console window. Press Enter to close and exit the program
Help Version 20.0.2018.1.23
Products | Support | Contact Us | Copyright Notices
© 1991-2018 LEAD Technologies, Inc. All Rights Reserved.
LEADTOOLS Imaging, Medical, and Document