Nicomsoft OCR: Developer's Guide


Blk_GetBarcodeText


Syntax

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


Description

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


Parameters

BlkObj [IN] – the Block object. You can also specify the Image object if you want to work with the global list of barcodes for the entire image.
BarcodeInd [IN] – the barcode index.
TextStr [OUT] – the buffer that will get the 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.


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 Blk_GetBarcodeCnt function.