L_OcrEngineManager_CreateEngine

#include "ltocr.h"

L_LTOCR_API L_INT EXT_FUNCTION L_OcrEngineManager_CreateEngine(engineType, engine)

L_OcrEngineType engineType; OCR engine type you wish to start
L_OcrEngine* engine; pointer to L_OcrEngine to be updated

Creates an instance of L_OcrEngine to use later on starting up the engine and some other functionality.

Parameter Description
engineType OCR engine type you wish to work with, currently L_OcrEngineType_Advantage is the only available engine.
engine Pointer to a L_OcrEngine handle to be updated with the initialized OCR engine handle. Use this handle for other OCR functionality.

Returns

SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Comments

L_OcrEngineManager_CreateEngine must be called before calling any other LEADTOOLS LTOCR toolkit functions.

The user must unlock OCR Advantage using the L_SetLicenseFile function. If the OCR Advantage engine is locked then the L_OcrEngineManager_CreateEngine function will fail and will not initialize the OCR engine.

When the handle to the OCR engine is no longer needed, it should be freed by calling L_OcrEngine_Destroy. For every call to L_OcrEngineManager_CreateEngine there must be an associated call to L_OcrEngine_Destroy.

Required DLLs and Libraries

LTOCR
For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.
See Also
Functions: L_OcrEngine_Destroy, L_OcrEngine_Startup, L_OcrEngine_Shutdown, L_OcrEngine_GetEngineType, L_OcrEngine_IsStarted, L_OcrEngine_GetSettingManager, L_OcrEngine_GetLanguageManager, L_OcrEngine_GetSpellCheckManager, L_OcrEngine_GetZoneManager, L_OcrEngine_GetDocumentManager, L_OcrEngine_GetAutoRecognizeManager, L_OcrEngine_GetWorkDirectory, L_OcrEngine_GetEngineDirectory
Topics: Programming with LEADTOOLS OCR Advantage
Starting and Shutting Down the OCR Engine
LEADTOOLS OCR Advantage Engine Settings

Example

#define OCR_ADVANTAGE_RUNTIME_DIR TEXT("C:\\LEADTOOLS 19\\Bin\\Common\\OcrAdvantageRuntime") 
L_INT L_OcrEngineManager_CreateEngineExample() 
{ 
   // Create an instance of the engine 
   L_OcrEngine ocrEngine = NULL; 
   L_INT retCode = L_OcrEngineManager_CreateEngine(L_OcrEngineType_Advantage, &ocrEngine); 
   if(retCode != SUCCESS) 
      return retCode; 
   // Start the engine using default parameters 
   retCode = L_OcrEngine_Startup(ocrEngine, NULL, OCR_ADVANTAGE_RUNTIME_DIR); 
   if(L_OcrEngine_IsStarted(ocrEngine)) 
      std::cout << "Engine started successfully.\n"; 
   else 
      std::cout << "Engine failed to start.\n"; 
   // Shutdown the engine 
   if(ocrEngine != NULL) 
   { 
      L_OcrEngine_Destroy(ocrEngine); 
      std::cout << "Engine shut down & destroyed.\n"; 
   } 
   return retCode; 
} 

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.
LEADTOOLS Advantage OCR C API Help