Nicomsoft OCR: Developer's Guide


Blk_GetText


Syntax

C++:int Blk_GetText(HBLK BlkObj, UNICODECHAR* TextStr, int MaxLen, int Flags)
C#:int Blk_GetText(int BlkObj, out string TextStr, int Flags)
Visual Basic:Function Blk_GetText(ByVal BlkObj As Integer, ByRef TextStr As String, ByVal Flags As Integer) As Integer
Java:int Blk_GetText(HBLK BlkObj, StringBuffer TextStr, int Flags)
Delphi:function Blk_GetText(BlkObj:HBLK; TextStr:PWCHAR; MaxLen:integer; Flags:integer):integer


Description

Retrieves the recognized text for the specified block after performing OCR with the Img_OCR function.


Parameters

BlkObj [IN] – the Block object.
TextStr [OUT] – the buffer that will get a Unicode, null-terminated string with the text.
MaxLen [IN] – the buffer size, in Unicode characters, including the null termination character. If 0, then the function will not copy anything to the buffer, but will only return the buffer size (in Unicode characters, without the null termination character) needed to store the text.
Flags [IN] – the formatting flags; see the FMT_XXXXX constants for possible values.


Return value

If success, the text length in Unicode characters, without the null termination character; otherwise, an error code.


Remarks

The OCRSTEP_OCR step must be executed before calling this function.


Example

See the sample code for the Img_GetBlockCnt function.