DTWAIN_GetOCRTextInfoLong

Top  Previous  Next

The DTWAIN_GetOCRTextInfoLong returns information concerning a specific character in the returned text after an OCR engine has processed an image file.

 

BOOL DTWAIN_GetOCRTextInfoLong (

DTWAIN_OCRTEXTINFOHANDLE

TextInfoHandle

LONG

charPos,

LONG

nWhichItem

LPLONG

pInfo );

 

Parameters:

TextInfoHandle

The value returned by DTWAIN_GetOCRTextInfoHandle.

 

charPos

Position of character in the text in the returned age number of the text information to return.

 

nWhichItem

Character information that is to be retrieved.

 

pInfo

Pointer to a LONG that, on return, will be filled with the information about the character.

 

 

Returns:

If successful, TRUE.  On failure, FALSE is returned.   Call DTWAIN_GetLastError on further information on the failure.

 

Comments:

DTWAIN_GetOCRTextInfoLong returns information concerning a particular character that the OCR engine has produced after processing an image file.  See the nWhichItem table below as to the type of information that can be returned.

 

The TextInfoHandle is the handle value returned by DTWAIN_GetOCRTextInfoHandle.

 

The charPos value is the zero-based character position of the text that was returned by DTWAIN_GetOCRText.

 

The nWhichItem denotes the information that is to be returned to the caller.  The following table lists the valid values for nWhichItem, as well as a description of the value returned.

 

nWhichItem Values

Description

 

DTWAIN_OCRINFO_CHAR

The ASCII value of the character at position charPos.

DTWAIN_OCRINFO_CHARXPOS

The x-position of the character at position charPos

DTWAIN_OCRINFO_CHARYPOS

The y-position of the character at position charPos

DTWAIN_OCRINFO_CHARXWIDTH

The x-width of the character at position charPos

DTWAIN_OCRINFO_CHARYWIDTH

The y-width of the character at position charPos.

DTWAIN_OCRINFO_PAGENUM

The page number where the character charPos is located.

DTWAIN_OCRINFO_OCRENGINE

The DTWAIN_OCRENGINE that was used to generate the character.

 

On return the pInfo value will be filled in with the information desired.  The pInfo cannot be NULL.

 

For floating point information concerning the characters in the OCR-ed text, the DTWAIN_GetOCRTextInfoFloat should be used.  If your application desires to get an entire buffer of character information instead of information for a single character, call DTWAIN_GetOCRTextInfoLongEx.

 

Example

 

Prerequisite Function Call(s)

DTWAIN_SysInitialize

DTWAIN_InitOCRInterface

DTWAIN_SelectOCREngine, or DTWAIN_SelectOCREngineByName, or DTWAIN_SelectDefaultOCREngine

DTWAIN_ExecuteOCR

DTWAIN_GetOCRTextInfoHandle