L_OcrPage_Destroy

#include "ltocr.h"

L_LTOCR_API L_INT EXT_FUNCTION L_OcrPage_Destroy(page)

L_OcrPage page; handle to the OCR page to destroy

Destroys the created L_OcrPage handle.

Parameter Description
page Handle to the OCR page to destroy.

Returns

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

Comments

Destroys the created L_OcrPage handle and free all its resources.

L_OcrPage defines a page currently added in the OCR engine. Each page contains the bitmap handle used to create it (the bitmap used when the page is created) and a group of OCR zones for the page either added manually or through auto-zoning.

Pages can be stand-alone or part of an L_OcrDocument. To create a stand-alone page, use L_OcrPage_FromBitmap.

For information on how to create memory-based or file-based documents or how to load file-based documents from disk refer to L_OcrDocumentManager_CreateDocument and Programming with LEADTOOLS OCR Advantage.

Memory-Based Documents

You can access the pages inside a memory-based OCR document (L_OcrDocument) through some methods like L_OcrDocument_AddPage, L_OcrDocument_GetPage, and some other functions.

Pages inside memory-based document do not need to be destroyed. The owner L_OcrDocument will automatically destroy the pages when it is destroyed.

File-Based Documents

Usually, you create a page directly using L_OcrPage_FromBitmap. You can use all the L_OcrPage methods to zone and recognize the OCR page as listed below as usual. And if saving the page to a final output format is required, then you can only add this page to a file-based L_OcrDocument using L_OcrDocument_AddPage method since L_OcrDocument_InsertPage is not supported in file-based documents.

Pages that were added to the file-based documents must be destroyed by the user using L_OcrPage_Destroy since the file-based document doesn't own these page, it just takes a snapshot of these pages so its the user responsibility to destroy the original created pages.

Each page contains a list of OCR zones. This list can be accessed with some L_OcrPage supported methods that deal with zones like L_OcrPage_AddZone, L_OcrPage_InsertZone, L_OcrPage_GetZoneAt and list of other methods.

After optionally manipulating the zones inside a page, call L_OcrPage_Recognize to collect the recognition data of the page. This data is stored internally in the page and can later be saved to one of the many document file formats supported by the engine such as PDF or Microsoft Word.

After a page is recognized, examine and modify the recognition data (characters and words) through the L_OcrPage_GetRecognizedCharacters and L_OcrPage_SetRecognizedCharacters methods. The L_OcrPage_GetText method can be used to obtain the recognition data as simple string object.

Once an L_OcrPage handle is obtained, you can do the following:

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