#include "ltocr.h"
L_LTOCR_API L_INT EXT_FUNCTION L_OcrAutoRecognizeManager_Run(autoRecognizeManager, imageFileName, documentFileName, format, zonesFileName)
| L_OcrAutoRecognizeManager autoRecognizeManager; | handle to the OCR auto recognize manager |
| const L_TCHAR* imageFileName; | the name of the file containing the image |
| const L_TCHAR* documentFileName; | the name of the result document file |
| DOCWRTFORMAT format; | the output document format |
| const L_TCHAR* zonesFileName; | optional name of prepared multi-page zone file. This parameter can be NULL |
Converts an image file on disk to a document file in the specified document format with optional multi-page zone file.
| Parameter | Description |
|---|---|
| autoRecognizeManager | Handle to the OCR engine auto recognize manager. |
| imageFileName | The name of the file containing the image. |
| documentFileName | The name of the result document file. |
| format | The output document format. |
| zonesFileName | Optional name of prepared multi-page zone file. This parameter can be NULL. |
| SUCCESS | The function was successful. |
| < 1 | An error occurred. Refer to Return Codes. |
This method will perform the following operations:
The L_OcrAutoRecognizeManager also has some options that you can control, For more information about these options, refer to L_OcrAutoRecognizeManager_GetOptions and L_OcrAutoRecognizeManager_SetOptions.
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. |
#define MAKE_IMAGE_PATH(pFileName) TEXT("C:\\Users\\Public\\Documents\\LEADTOOLS Images\\")pFileName#define OCR_ADVANTAGE_RUNTIME_DIR TEXT("C:\\LEADTOOLS 19\\Bin\\Common\\OcrAdvantageRuntime")L_INT L_OcrAutoRecognizeManager_RunExample(){L_INT retCode = -1;L_OcrEngine ocrEngine = NULL;L_OcrAutoRecognizeManager autoRecognizeManager = NULL;// Create an instance of the engineretCode = L_OcrEngineManager_CreateEngine(L_OcrEngineType_Advantage, &ocrEngine);if(retCode != SUCCESS)return retCode;// Start the engine using default parametersretCode =L_OcrEngine_Startup(ocrEngine, NULL, OCR_ADVANTAGE_RUNTIME_DIR);if(retCode != SUCCESS)return retCode;// Get the AutoRecognizeManagerL_OcrEngine_GetAutoRecognizeManager(ocrEngine, &autoRecognizeManager);// Recognize the documentretCode = L_OcrAutoRecognizeManager_Run(autoRecognizeManager, MAKE_IMAGE_PATH(L_TEXT("OCR1.tif")), MAKE_IMAGE_PATH(L_TEXT("OCR1.pdf")), DOCUMENTFORMAT_PDF, NULL);//CLEANUPL_OcrEngine_Destroy(ocrEngine);return retCode;}