The OcrEngineManager class and its methods are your entry to using the Leadtools.Forms.Ocr class library.
You use the OcrEngineManager.CreateEngine method to create an instance of the IOcrEngine interface. Afterwards, you can use the properties and methods of this interface to perform the various OCR tasks required.
There are two things to consider when creating an IOcrEngine instance:
OCR Engine Type
LEADTOOLS for .NET class library supports multiple OCR engines. All the engines supported implement the same interfaces defined in Leadtools.Forms.Ocr.dll. As a result, your application code does not need to change when you switch between the engines.
The first parameters to the OcrEngineManager.CreateEngine method (engineType) is a value of the OcrEngineType enumeration to specifiy the name of the OCR engine to load. Internally, the framework will use Assembly.Load to load the corresponding assembly and create the objects that implements the various public interfaces (for example, IOcrEngine).
Currently, LEADTOOLS for .NET class library supports the following engines:
Engine | Description |
---|---|
OcrEngineType.Plus | LEADTOOLS OCR Plus engine. The OCR library inside Leadtools.Forms.Ocr.Plus.dll is loaded. |
OcrEngineType.Professional | LEADTOOLS OCR Professional engine. The OCR library inside Leadtools.Forms.Ocr.Professional.dll is loaded. |
OcrEngineType.Advantage | LEADTOOLS OCR Advantage engine. The OCR library inside Leadtools.Forms.Ocr.Advantage.dll is loaded. |
OcrEngineType.Arabic | LEADTOOLS OCR Arabic engine. The OCR library inside Leadtools.Forms.Ocr.Arabic.dll is loaded. |
Usage of the LEADTOOLS Thunk Server
Note: The description below applies for the LEADTOOLS Plus, Professional and Arabic engines only. The LEADTOOLS Advantage engine supports multi-threading natively and does not require the use of a "thunk server".
The various OCR engines provided by LEADTOOLS are not thread safe by default. If you are planning on using a single instance of IOcrEngine in your application then this is not a problem.
However, if your application is planning on using multiple threads for OCR or your application is server-based, then it is recommended that you communicate with the internal OCR engine using the LEADTOOLS Thunk Server. The Thunk Server will load each instance of the internal OCR engine in a separate process and will insure proper thread/process safety and cleanup without the expense of a performance hit.
To use the Thunk Server, pass true to the second parameter of the OcrEngineManager.CreateEngine method (useThunkServer). Otherwise; pass false.
In either case, LEADTOOLS for .NET OCR class library is designed to use standard .NET interfaces to perform the various OCR functions. These interfaces hide the internal workings of the OCR engines and its loading mechanism. Your application code should not change if you switch the Thunk Server on or off.
Once you obtained an instance of the OCR engine, the next step is starting up the engine using the IOcrEngine.Startup method. For more information, refer to Starting and Shutting Down the OCR Engine.
Reference
IntroductionGetting Started (Guide to Example Programs)
LEADTOOLS OCR .NET Assemblies
Programming with LEADTOOLS .NET OCR
An Overview of OCR Recognition Modules
Starting and Shutting Down the OCR Engine
OCR Spell Language Dictionaries
Working with OCR Languages
Working With OCR User Dictionaries
Working with OCR Pages
Working with OCR Zones
Recognizing OCR Pages
OCR Confidence Reporting
Using OMR in LEADTOOLS .NET OCR
OCR Languages and Spell Checking
OCR Engine Specific Settings
OCR Tutorial - Working with Pages
OCR Tutorial - Recognizing Pages
OCR Tutorial - Adding and Painting Zones
OCR Tutorial - Working with Recognition Results
OCR Tutorial - Scanning to Searchable PDF