- engineType
- The engine type to use.
- useThunkServer
- true to use the LEADTOOLS thunk server when loading the internal engine, otherwise, false.
Visual Basic (Declaration) | |
---|---|
Public Shared Function CreateEngine( _ ByVal engineType As OcrEngineType, _ ByVal useThunkServer As Boolean _ ) As IOcrEngine |
Visual Basic (Usage) | Copy Code |
---|---|
|
C# | |
---|---|
public static IOcrEngine CreateEngine( OcrEngineType engineType, bool useThunkServer ) |
C++/CLI | |
---|---|
public: static IOcrEngine^ CreateEngine( OcrEngineType engineType, bool useThunkServer ) |
Parameters
- engineType
- The engine type to use.
- useThunkServer
- true to use the LEADTOOLS thunk server when loading the internal engine, otherwise, false.
Return Value
The instance of IOcrEngine that this method creates.This example will use the LEADTOOLS OCR Plus engine to OCR an image and save it as a PDF file.
Visual Basic | Copy Code |
---|---|
Public Sub CreateEngineExample() |
C# | Copy Code |
---|---|
public void CreateEngineExample() |
CreateEngine should be the first method your application calls into the Leadtools.Forms.Ocr assembly.
The CreateEngine method uses the .NET 2.0 Assembly.Load method to load the LEADTOOLS OCR assembly for the engine type. You cannot unload this assembly once it has been successfully loaded.
The various OCR engines provided by LEADTOOLS (except for the LEADTOOLS Advantage engine) are not thread safe. If your application requires multiple instances of IOcrEngine in separate threads or your application is server-based, then set the useThunkServer to true. The LEADTOOLS thunk server will be used in the background to ensure proper thread/process safety and cleanup. For more information, refer to LEADTOOLS OCR Thunk Server.
IMPORTANT: The above discussion is for the LEADTOOLS Plus and Professional engines only. The LEADTOOLS Advantage engine supports multi-threading and x64 platform natively and does not require the use of a "thunk server".
The engineType parameter determines which assembly will be loaded. For more information, refer to Files to be Included with Your Application.
The IOcrEngine interface also implements IDisposable. Dispose of the IOcrEngine instance when you are done using it.
Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family