L_OcrPage_SaveZonesFile

#include "ltocr.h"

L_LTOCR_API L_INT EXT_FUNCTION L_OcrPage_SaveZonesFile(page, fileName, pageNumber, xmlOptions)

L_OcrPage page; handle to the OCR page
const L_TCHAR* fileName; the name of the file to save the zones to
L_UINT pageNumber; 1-based page number of the zones in the file to replace or append
const L_OcrWriteXmlOptions* xmlOptions; Options to use when creating the XML data.

Saves the zones of this L_OcrPage to a multi-page zones disk file with XML options.

Parameter Description
page Handle to the OCR page.
fileName The name of the file to save the zones to.
pageNumber The 1-based page number of the zones in the file to replace (or append). If the zones file contain zones for page 'pageNumber', then this method will replace these zones with the zones of the current L_OcrPage. If the file does not contain zones for page 'pageNumber', then this method will append these zones at the end of the file.
xmlOptions Options to use when creating the XML data.

Returns

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

Comments

L_OcrPage_SaveZonesFile method save the zones of a particular OCR page to a multi-page disk file. If the file exist previously, this method will replace the zones specified in 'pageNumber' with the zones of the L_OcrPage. If the file does not contain zones for the specified page number, the zones will be appended to the file at the end and can be loaded later using L_OcrPage_LoadZonesFile.

If you wish to save all L_OcrDocument pages zones to file then you have to loop through the OCR document pages saving each page zones to the same file and the save method will append the zones of each page to the file giving you a multi-page zones file. The saved data will contain the page number of the zones. To load these zones, you also have to loop through all you OCR document pages loading each page zones separately passing the L_OcrPage_LoadZonesFile method the page number you wish to load its zones.

Note on loading zones from a multi-page zone file: If the file does not contain zones data with the correct page number, the engine will not load any zones for this page. After the method returns, any OCR page that did not have zones data will contain zero zones. You can then use L_OcrPage_AutoZone if required to re-zone this page.

The zones of this page will first be cleared prior to loading the new items.

Saving zones to an external file or could be useful when you are processing forms. For example, you can load one of the forms and automatically find the zones inside it using L_OcrPage_AutoZone, if the automatic zone detection was not 100 percent satisfactory, you can update the page zones manually and then save the result with L_OcrPage_SaveZonesFile. Once the zones are saved, you can now process all similar forms in the following manner:

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.
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