L_OcrPage_Destroy (original) (raw)
Summary
Destroys the created L_OcrPage handle.
Syntax
#include "ltocr.h"
L_LTOCR_API L_INT EXT_FUNCTION L_OcrPage_Destroy(page)
Parameters
L_OcrPage page
Handle to the OCR page to destroy.
Returns
Value | Meaning |
---|---|
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 Module - LEAD Engine.
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 does not 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:
- Get information regarding the page bitmap, such as its Width, Height, BitsPerPixel and the X/Y resolution values.
- Get a BITMAPHANDLE object with the L_OcrPage_GetBitmap method that represents the page bitmap handle data. Manipulate this bitmap with other parts of LEADTOOLS such as the various image processing commands or show it in your viewer window. You can also use L_OcrPage_SetBitmap to update the page bitmap data.
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.
See Also
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
Example
For an example, refer to L_OcrPage_FromBitmap