SimpleOCR:SDK Functions – OCRSetOutputHandler

You are here:
< All Topics

OCROutputHandler OCRSetOutputHandler(OCROutputHandler handler)

When the output mode is OM_TEXT or OM_RICHTEXT, a user defined function of type OCROutputHandler will be called by the engine for each “ event”.

Return Value

Previously selected output handler.

Parameters

handler

New Output handler function.

Comments

If the output mode is OT_TEXT, OCR events among OT_PROP, OT_ITAL, OT_UNDS, OT_SIZE, OT_HILT and OT_BITM are not sent to the output hander.

An OCROutputHandler has the following form:

void AnOCRHandler(int event, int param);

with event, the code of the “OCR event” and param a value associated with the event.

The OCR events are:

OT_TEXT

A character has been recognized. param contains the ASCII code of the recognized character.

OT_PROP

The font type has changed (proportional or non proportional font). param is nonzero if the font is proportional.

OT_ITAL

Switches italic mode on or off. param is nonzero if the following characters are italic.

OT_UNDS

Switches underscored mode on or off. param is nonzero if the following characters are underscored.

OT_SIZE

Changes the character size. param contains the font size for the following characters.

OT_HILT

Changes the character color.
If param contains 1, the following word is not in the dictionary. If param contains 2, the following word has not been well recognized.

OT_ENDL

An end of line has been reached.

OT_ENDZ

An end of text area has been reached.

OT_BITM

An image has been recognized. (IMG *) param is a pointer to the image.

Previous SimpleOCR:SDK Functions – OCRSetOutputCharHandler
Next SimpleOCR:SDK Functions – OCRSetProgressHandler
Table of Contents
Contact Us for FREE Consultation on Your OCR Project
Go to Top