Starting and Shutting Down the Engine

To begin using the LEADTOOLS OCR document toolkit, the user must initialize an OCR document handle. This handle provides the user with access to the OCR engine and the internal OCR document list of pages. Calling the L_DocStartUp function initializes the handle. Each call to the L_DocStartUp function will create an OCR document handle of type L_HDOC. This handle is passed to many of the other LEADTOOLS OCR Document API functions, so this function must be called before calling other LEADTOOLS OCR functions.

Once the L_DocStartUp function has been called, you may opt to load engine settings saved in a file into the engine. To load saved settings from a file, call L_DocLoadSettings. To save engine settings into a file for later use, call L_DocSaveSettings. Please note that you must call L_DocStartUp before you can call L_DocSaveSettings. If you call L_DocSaveSettings after calling L_DocStartUp, but before you have set any engine settings, the settings files will contain the default engine settings.

While working with the OCR engine, you can receive progress notifications for all processes performed by the OCR engine if you set a PROGRESSCALLBACK function using L_DocSetProgressCB.

When the OCR document handle is no longer needed, the user must free the handle by calling L_DocShutDown. At this point the OCR document handle becomes invalid. Before recognizing any more pages, the user must establish a new OCR document handle by calling L_DocStartUp.