In This Topic ▼

Starting and Shutting Down the OCR Engine

To begin using the LEADTOOLS for .NET OCR class library, create an instance of the IOcrEngine" interface by calling the OcrEngineManager.CreateEngine method (for more information, refer to Creating an OCR Engine Instance). After the instance is obtained, initialize it by calling the IOcrEngine.Startup method. The IOcrEngine.Startup method must be called before calling any other LEADTOOLS OCR methods.

After calling the IOcrEngine.Startup method has been called, it is possible to load engine settings saved in a file into the engine. To load saved settings from a file or a .NET stream, call the IOcrSettingManager.Load method. Access the instance of the setting manager associated with the engine through the IOcrEngine.SettingManager">IOcrEngine.SettingManager property. To save engine settings into a file or a .NET stream for later use, call the IOcrSettingManager.Save method.

When the OCR engine instance is no longer needed, close the instance by calling the IOcrEngine.Shutdown method. This will free all internal resources allocated by the engine instance. At this point the IOcrEngine" instance becomes invalid. Before recognizing any more pages, it is necessary to establish a new IOcrEngine" instance by calling the IOcrEngine.Startup method again.

Notice that the IOcrEngine interface also implements the .NET IDisposable interface, hence it is best to call the IOcrEngine.Dispose method after the instance is longer in use (or use of the C# using or VB Using keywords). IOcrEngine.Dispose will automatically call IOcrEngine.Shutdown, if it has not already been called for this instance.

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

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