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.
|page||Handle to the OCR page to destroy.|
|SUCCESS||The function was successful.|
|< 1||An error occurred. Refer to Return Codes.|
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.
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 Module - LEAD Engine.
Pages inside memory-based document do not need to be destroyed. The owner L_OcrDocument will automatically destroy the pages when it is destroyed.
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
For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.
|Functions:||L_OcrPage_FromBitmap, L_OcrPage_GetBitmap, L_OcrPage_SetBitmap, L_OcrPage_GetOverlayBitmap, L_OcrPage_SetOverlayBitmap, L_OcrPage_SetBitmapChangedCallback, L_OcrPage_IsInverted, L_OcrPage_GetRotateAngle, L_OcrPage_GetDeskewAngle, L_OcrPage_AutoPreprocess, L_OcrPage_AutoZone, L_OcrPage_GetZoneCount, L_OcrPage_InsertZone, L_OcrPage_AddZone, L_OcrPage_IndexOfZone, L_OcrPage_GetZoneAt, L_OcrPage_SetZoneAt, L_OcrPage_RemoveZone, L_OcrPage_RemoveZoneAt, L_OcrPage_ClearZones, L_OcrPage_GetZoneCells, L_OcrPage_SetZoneCells, L_OcrPage_HitTestZone, L_OcrPage_IsRecognized, L_OcrPage_Recognize, L_OcrPage_Unrecognize, L_OcrPage_GetRecognizeStatistics, L_OcrPage_GetRecognizedCharacters, L_OcrPage_SetRecognizedCharacters, L_OcrPage_FreePageCharacters, L_OcrPage_GetZoneWords, L_OcrPage_FreeWords, L_OcrPage_GetText, L_OcrPage_ExtractZoneMICRData, L_OcrPage_DetectLanguages, L_OcrPage_LoadZonesFile, L_OcrPage_SaveZonesFile, L_OcrPage_SaveXml, L_OcrPage_GetAutoPreprocessValues|
|Topics:||Programming with LEADTOOLS OCR Module - LEAD Engine|
|Starting and Shutting Down the OCR Engine|
|Recognizing OCR Pages|
|Working With OCR Pages|
For an Example, refer to L_OcrPage_FromBitmap