Types

Used to handle pointer (void *) to BarcodeReader object

Used to handle pointer (void *) to BarReaderResult object

BARCODE

Handle of Barcode object

Used to handle pointer (void *) to Barcode object

Enumerations
BarcodeTypeEnum

Barcode types

 BT_Unknown barcode type is undefined BT_Code11 Code 11 BT_Code39 Code 39 BT_Code93 Code 93 BT_Code128 Code 128 BT_Codabar Codabar BT_Inter2of5 Interleaved 2 of 5 BT_PatchCode Patch Code BT_EAN8 EAN-8 BT_UPCE UPC-E BT_EAN13 EAN-13 BT_UPCA UPC-A BT_Plus2 +2 Supplemental for UPC/EAN BT_Plus5 +5 Supplemental for UPC/EAN BT_PDF417 PDF417 BT_DataMatrix DataMatrix BT_QRCode QR Code BT_Postnet POSTNET BT_Planet PLANET BT_RM4SCC Royal Mail 4-State Customer Code (RM4SCC) BT_AustraliaPost Australia Post BT_IntelligentMail Intelligent Mail BT_Code39Extended Code 39 Extended BT_MicroQRCode Micro QR Code BT_PharmaCode Pharmacode BT_UCC128 UCC-128 BT_RSS14 RSS-14 / GS1 Databar BT_RSSLimited RSS-14 / GS1 Databar Limited BT_RSSExpanded RSS-14 / GS1 Databar Expanded / Stacked BT_All All barcode types BT_All_1D All 1D barcodes BT_All_2D All 2D barcodes
BarcodeOrientationEnum

Barcode orientations

 BO_Unknown Orientation is not defined BO_LeftToRight Left to right orientation BO_RightToLeft Right to left orientation BO_TopToBottom Top to bottom orientation BO_BottomToTop Bottom to top orientation BO_All All orientations
QuietZoneSizeEnum

Barcode quiet zone size

 QZ_ExtraSmall Extra small quiet zone QZ_Small Small quiet zone QZ_Normal Normal quiet zone QZ_Large Large quiet zone

ThresholdModeEnum

Thresholding mode

 TM_Automatic Automatic threshold detection TM_Fixed Fixed threshold TM_Multiple Multiple thresholds TM_Adaptive Adaptive thresholding

PreprocessingEnum

Preprocessing operations

 PR_Erosion Image erosion PR_Dilation Image dilation PR_Despeckle Image despeckle PR_Sharp Image sharpness PR_Invert Image inversion

Preprocessing Operations

QRCodeECCLevelEnum

QR Code Error correction levels

 QRECCLevel_Undefined ECC level not defined QRECCLevel_L Error correction level L (up to 7% damage) QRECCLevel_M Error correction level M (up to 15% damage) QRECCLevel_Q Error correction level Q (up to 25% damage) QRECCLevel_H Error correction level H (up to 30% damage)

PixelFormatEnum

Image buffer pixel formats

 PIXFMT_NONE pixel format is undefined PIXFMT_GRAYSCALE Grayscale 8 bpp format PIXFMT_RGB24 RGB 24 bpp format PIXFMT_BGR24 BGR 24 bpp format PIXFMT_RGBA RGB 32 bpp format (with alpha channel) PIXFMT_BGRA BGR 32 bpp format (with alpha channel) PIXFMT_YUV420 YUV420 format

 PDF_Render Render whole page to single image and process it. PDF_Images Extract all images from page and process each image separately.

Callbacks
PageProcessingCompletedCallback

Invokes by BarcodeReader object after the page has finished processing

Parameters
 PageProcessingCompletedCallback pageProcessingCompletedCallback
)

Return

)

Parameters
)

Read barcodes from image file (JPEG, BMP, PNG)

Parameters
Return

Notes

)

Read barcodes from image file (JPEG, BMP, PNG) contained in the memory

Parameters
 hBarReaderBARREADER Handle of BarcodeReader object pBuffervoid* Pointer to a memory buffer containing the image file data bufferSizeint size of memory buffer in bytes
Return

Notes

)

Read barcodes from image file (JPEG, BMP, PNG) from HTTP URL

Parameters
Return

Notes

This function can be used for still image mode only.

 BARREADER hBarReader, void* pBuffer, int width, int height, int stride, PixelFormatEnum pixelFormat
)

Parameters
 hBarReaderBARREADER Handle of BarcodeReader object pBuffervoid* Pointer to buffer of image pixels data widthint Width of image in pixels heightint Height of image in pixels strideint Size of one image row in bytes pixelFormatPixelFormatEnum Pixel format, PIXFMT enumeration
Return

Notes

)

Sets the types of barcode for recognition

Parameters
Notes

Default value is 0 (BT_Unknown).

)

Gets the types of barcode for recognition

Parameters
Return

One or a combination of BarcodeTypeEnum enumeration values

Notes

Default value is 0 (BT_Unknown).

)

Sets the color threshold to distinguish between background and foreground pixels.

Parameters
Notes

Default value is 128.

Threshold related parameters are ThresholdMode, Threshold, ThresholdStep and ThresholdCount.  The threshold is used to distinguish between foreground and background pixels (black and white information) in color or grayscale images.  Possible threshold values are 0..255. Each pixel in a color or grayscale image has a brightness from 0 (black) to 255 (white).  When the threshold is set to 128, pixels with intensities less than 128 will be treated as black (foreground) pixels,and pixels with intensities greater than 128 as white (background) pixels.  The threshold parameters are ignored for binary (black and white) images.

There are the following thresholding modes

1) ThresholdMode = TM_Automatic

The threshold is determined automatically using the adaptive global threshold algorithm. The threshold will be calculated for each image (page).  The Threshold, ThresholdStep and ThresholdCount parameters not used in this mode.

2) ThresholdMode = TM_Fixed

Only the value of the Threshold parameter will be used.  The ThresholdStep and ThresholdCount parameters not used in this mode.

3) ThresholdMode = TM_Multiple

This mode will use multiple thresholds and process image for each threshold separately.  In this mode ThresholdCount and ThresholdStep (S) will be used.  The value specified in the Threshold (T) parameter will be used as the initial value, followed by T+S, T-S, T+2*S, T-2*S, and so on, until the number of calculated thresholds exceeds ThresholdCount.

Example

Threshold = 100

ThresholdCount = 6

ThresholdStep = 10

The following thresholds will be used: 100, 110, 90, 120, 80, 130, 70

)

Gets the color threshold to distinguish between background and foreground pixels.

Parameters
Return

Threshold value

Notes

Default value is 128.

Threshold related parameters are ThresholdMode, Threshold, ThresholdStep and ThresholdCount.  The threshold is used to distinguish between foreground and background pixels (black and white information) in color or grayscale images.  Possible threshold values are 0..255. Each pixel in a color or grayscale image has a brightness from 0 (black) to 255 (white).  When the threshold is set to 128, pixels with intensities less than 128 will be treated as black (foreground) pixels,and pixels with intensities greater than 128 as white (background) pixels.  The threshold parameters are ignored for binary (black and white) images.

There are the following thresholding modes

1) ThresholdMode = TM_Automatic

The threshold is determined automatically using the adaptive global threshold algorithm. The threshold will be calculated for each image (page).  The Threshold, ThresholdStep and ThresholdCount parameters not used in this mode.

2) ThresholdMode = TM_Fixed

Only the value of the Threshold parameter will be used.  The ThresholdStep and ThresholdCount parameters not used in this mode.

3) ThresholdMode = TM_Multiple

This mode will use multiple thresholds and process image for each threshold separately.  In this mode ThresholdCount and ThresholdStep (S) will be used.  The value specified in the Threshold (T) parameter will be used as the initial value, followed by T+S, T-S, T+2*S, T-2*S, and so on, until the number of calculated thresholds exceeds ThresholdCount.

Example

Threshold = 100

ThresholdCount = 6

ThresholdStep = 10

The following thresholds will be used: 100, 110, 90, 120, 80, 130, 70

)

Sets the mode of image thresholding

Parameters
Notes

Default value is TM_Automatic.

)

Gets the mode of image thresholding

Parameters
Return

ThresholdModeEnum enumeration value

Notes

Default value is TM_Automatic.

)

Sets the number of thresholds to be used for recognition

Parameters
Notes

Default value is 8.

)

Gets the number of thresholds to be used for recognition

Parameters
Return

Number of thresholds

Notes

Default value is 8.

)

Sets the step for multiple thresholding

Parameters
Notes

Default value is 16.

)

Gets the step for multiple thresholding

Parameters
Return

Step for multiple thresholding

Notes

Default value is 16.

)

Sets the expected number of barcodes on single image

Parameters
Notes

Default value is 0.

A value of 0 means that the maximum possible number of barcodes will be detected.

This parameter defines the expected number of barcodes on single image (page).  The number of barcodes detected may be greater than this value. This value is used as a condition for stopping the barcode reading process, for example, if the expected number of barcodes is found during multiple thresholding, then recognition will be stopped without processing for all thresholds.

)

Gets the expected number of barcodes on single image

Parameters
Return

Expected number of barcodes

Notes

Default value is 0.

A value of 0 means that the maximum possible number of barcodes will be detected.

This parameter defines the expected number of barcodes on single image (page).  The number of barcodes detected may be greater than this value. This value is used as a condition for stopping the barcode reading process, for example, if the expected number of barcodes is found during multiple thresholding, then recognition will be stopped without processing for all thresholds.

)

Sets the page number for processing

Parameters
Notes

Default value is 0.

A value 0 indicates to process all pages. Page numbers starts with 1.

This parameter is only meaningful for multipage documents.

)

Gets the page number for processing

Parameters
Return

Page number

Notes

Default value is 0.

A value 0 indicates to process all pages. Page numbers starts with 1.

This parameter is only meaningful for multipage documents.

)

Sets the value indicating whether optional checksum validation is required for Code 11 barcodes.

Parameters
Notes

Default value is False.

This parameter is only meaningful if you have Code 11 barcodes generated with an option checksum. If this property is set to True, barcodes without a checksum will not be detected.

)

Gets the value indicating whether optional checksum validation is required for Code 11 barcodes.

Parameters
Return

Boolean value

Notes

Default value is False.

This parameter is only meaningful if you have Code 11 barcodes generated with an option checksum. If this property is set to True, barcodes without a checksum will not be detected.

)

Sets the value indicating whether optional checksum validation is required for Code 39 barcodes.

Parameters
Notes

Default value is False.

This parameter is only meaningful if you have Code 39 barcodes generated with an option checksum. If this property is set to True, barcodes without a checksum will not be detected.

)

Gets the value indicating whether optional checksum validation is required for Code 39 barcodes.

Parameters
Return

Boolean value

Notes

Default value is False.

This parameter is only meaningful if you have Code 39 barcodes generated with an option checksum. If this property is set to True, barcodes without a checksum will not be detected.

)

Sets the value indicating whether optional checksum validation is required for Code 93 barcodes.

Parameters
Notes

Default value is False.

This parameter is only meaningful if you have Code 93 barcodes generated with an option checksum. If this property is set to True, barcodes without a checksum will not be detected.

)

Gets the value indicating whether optional checksum validation is required for Code 93 barcodes.

Parameters
Return

Boolean value

Notes

Default value is False.

This parameter is only meaningful if you have Code 93 barcodes generated with an option checksum. If this property is set to True, barcodes without a checksum will not be detected.

)

Sets the value indicating whether optional checksum validation is required for Interleaved 2of5 barcodes.

Parameters
Notes

Default value is False.

This parameter is only meaningful if you have Interleaved 2of5 barcodes generated with an option checksum. If this property is set to True, barcodes without a checksum will not be detected.

)

Gets the value indicating whether optional checksum validation is required for Interleaved 2of5 barcodes.

Parameters
Return

Boolean value

Notes

Default value is False.

This parameter is only meaningful if you have Interleaved 2of5 barcodes generated with an option checksum. If this property is set to True, barcodes without a checksum will not be detected.

)

Sets the value indicating whether Code 39 barcodes have start/stop symbols

Parameters
Notes

Default value is False.

This parameter is only meaningful if you have Code 39 barcodes INCORRECTLY generated without start/stop symbols.

DO NOT use this property to process normal Code 39 barcodes.

)

Gets the value indicating whether Code 39 barcodes have start/stop symbols

Parameters
Return

Boolean value

Notes

Default value is False.

This parameter is only meaningful if you have Code 39 barcodes INCORRECTLY generated without start/stop symbols.

DO NOT use this property to process normal Code 39 barcodes.

)

Sets the value indicating whether the UPC-E barcode must be converted to UPC-A format.

Parameters
Notes

Default value is False.

)

Gets the value indicating whether the UPC-E barcode must be converted to UPC-A format.

Parameters
Return

Boolean value

Notes

Default value is False.

)

Sets the expected orientation of the barcode.

Parameters
 hBarReader Handle of BarcodeReader object orientationBarcodeOrientationEnum one or a combination of BarcodeOrientationEnum enumeration values
Notes

Default value is BO_LetfToRight.

The barcode reader can detect barcodes in any orientation, although if you know that all barcodes will be oriented in a particular way, this can be used to speed up the recognition process.  For example, if you define the orientation of LetfToRight, this means that barcodes with a horizontal orientation (left-right direction) at an angle of +/- 45 degrees can be detected.

)

Gets the expected orientation of the barcode.

Parameters
Return

One or a combination of BarcodeOrientationEnum enumeration values

Notes

Default value is BO_LetfToRight.

The barcode reader can detect barcodes in any orientation, although if you know that all barcodes will be oriented in a particular way, this can be used to speed up the recognition process.  For example, if you define the orientation of LetfToRight, this means that barcodes with a horizontal orientation (left-right direction) at an angle of +/- 45 degrees can be detected.

)

Sets the image scanning interval.

Parameters
Notes

Default value is 1.

Possible values are from 1 to 10.

A value of 1 means scanning each row or column of pixels in the image; a value of 2 means scanning every second row or column, and so on.  Increasing the value of this parameter can result in faster image processing, but increases the likelihood of not detecting narrow or poorly formed barcodes.  Decreasing the value of this parameter can have the opposite effect: slower image processing, but better barcode detection.

)

Gets the image scanning interval.

Parameters
Return

The image scanning interval in pixels.

Notes

Default value is 1.

Possible values are from 1 to 10.

A value of 1 means scanning each row or column of pixels in the image; a value of 2 means scanning every second row or column, and so on.  Increasing the value of this parameter can result in faster image processing, but increases the likelihood of not detecting narrow or poorly formed barcodes.  Decreasing the value of this parameter can have the opposite effect: slower image processing, but better barcode detection.

)

Sets the required ECC level for QR Codes detection

Parameters
Notes

Default value is QRECCLevel_Undefined.

This property can be used in some special cases where the error correction capability (ECC) of the QR code is known.

)

Gets the required ECC level for QR Codes detection

Parameters
Return

One of QRCodeECCLevelEnum enumeration values

Notes

Default value is QRECCLevel_Undefined.

This property can be used in some special cases where the error correction capability (ECC) of the QR code is known.

)

Sets the expected size of the quiet zone of the barcode.

Parameters
Notes

Default value is QZ_Normal.

Quiet zone means the blank margin on either side of a barcode that is used to tell the barcode reader where a barcode starts and stops.  The purpose of a quiet zone is to prevent the reader from picking up information that does not pertain to the bar code that is being scanned.  As a rule, the quiet zone should be ten times the dimension of the narrowest element in the bar code. An undersized quiet zone may render a bar code unreadable.

The possible values of the QuietZoneSize parameter are: QZ_ExtraSmall, QZ_Small, QZ_Normal, QZ_Large.

The QZ_Normal is a standard quiet zone, as it defined by specification (approximately 10 times greater than the narrowest element in the barcode).  The other parameters QZ_Large, QZ_Small and QZ_ExtraSmall can be used if the quiet zone is abnormal, less or greater than defined in specification.

For example, the barcode can be printed in table or near some graphic object, in this case the barcode will not be detected by using QZ_Normal, and you should use QZ_Small or QZ_ExtraSmall to detect such barcode.

QZ_Small or QZ_ExtraSmall can slow down the recognition speed and can lead to more errors in recognition.

QZ_Large increases the speed and stability, but may not detect some barcodes with normal quiet zone. QZ_Large can be used if you know for sure that the quiet zones are large enough.

)

Gets the expected size of the quiet zone of the barcode.

Parameters
Return

One of QuietZoneSizeEnum enumeration values

Notes

Default value is QZ_Normal.

Quiet zone means the blank margin on either side of a barcode that is used to tell the barcode reader where a barcode starts and stops.  The purpose of a quiet zone is to prevent the reader from picking up information that does not pertain to the bar code that is being scanned.  As a rule, the quiet zone should be ten times the dimension of the narrowest element in the bar code. An undersized quiet zone may render a bar code unreadable.

The possible values of the QuietZoneSize parameter are: QZ_ExtraSmall, QZ_Small, QZ_Normal, QZ_Large.

The QZ_Normal is a standard quiet zone, as it defined by specification (approximately 10 times greater than the narrowest element in the barcode).  The other parameters QZ_Large, QZ_Small and QZ_ExtraSmall can be used if the quiet zone is abnormal, less or greater than defined in specification.

For example, the barcode can be printed in table or near some graphic object, in this case the barcode will not be detected by using QZ_Normal, and you should use QZ_Small or QZ_ExtraSmall to detect such barcode.

QZ_Small or QZ_ExtraSmall can slow down the recognition speed and can lead to more errors in recognition.

QZ_Large increases the speed and stability, but may not detect some barcodes with normal quiet zone. QZ_Large can be used if you know for sure that the quiet zones are large enough.

)

Sets the X coordinate of the scan rectangle

Parameters
Notes

Default value is 0.

The scan rectangle defines a rectangular area in the image for barcode detection. It should be used if you know the location of the barcode in the image.

)

Gets the X coordinate of the scan rectangle

Parameters
Return

X coordinate in pixels

Notes

Default value is 0.

The scan rectangle defines a rectangular area in the image for barcode detection. It should be used if you know the location of the barcode in the image.

Sets the Y coordinate of the scan rectangle

Parameters
Notes

Default value is 0.

The scan rectangle defines a rectangular area in the image for barcode detection. It should be used if you know the location of the barcode in the image.

)

Gets the Y coordinate of the scan rectangle

Parameters
Return

Y coordinate in pixels

Notes

Default value is 0.

The scan rectangle defines a rectangular area in the image for barcode detection. It should be used if you know the location of the barcode in the image.

)

Sets the Width of the scan rectangle

Parameters
Notes

Default value is 0.

The scan rectangle defines a rectangular area in the image for barcode detection. It should be used if you know the location of the barcode in the image.

)

Gets the Width of the scan rectangle

Parameters
Return

Width in pixels

Notes

Default value is 0.

The scan rectangle defines a rectangular area in the image for barcode detection. It should be used if you know the location of the barcode in the image.

)

Sets the Height of the scan rectangle

Parameters
Notes

Default value is 0.

The scan rectangle defines a rectangular area in the image for barcode detection. It should be used if you know the location of the barcode in the image.

)

Gets the Height of the scan rectangle

Parameters
Return

Height in pixels

Notes

Default value is 0.

The scan rectangle defines a rectangular area in the image for barcode detection. It should be used if you know the location of the barcode in the image.

)

Sets the reading type of PDF documents

Parameters
Notes

Default value is PDF_Images.

1) PDF_Render. The page of the PDF document will be rendered to single image with defined DPI (property PDFRenderDPI).  If the PDF page contains various objects such as text, graphics, images, etc., then all objects will be rendered to a single bitmap.

2) PDF_Images. All images located on the PDF page will be extracted and barcode recognition will be performed for each image separately.  Other non-image objects, such as text, will be ignored. A barcode can be created as a text object using a barcode font, and when using the PDF_Images option, this barcode will not be recognized as only image objects will be processed.

)

Gets the reading type of PDF documents

Parameters
Return

Notes

Default value is PDF_Images.

1) PDF_Render. The page of the PDF document will be rendered to single image with defined DPI (property PDFRenderDPI).  If the PDF page contains various objects such as text, graphics, images, etc., then all objects will be rendered to a single bitmap.

2) PDF_Images. All images located on the PDF page will be extracted and barcode recognition will be performed for each image separately.  Other non-image objects, such as text, will be ignored. A barcode can be created as a text object using a barcode font, and when using the PDF_Images option, this barcode will not be recognized as only image objects will be processed.

)

Sets the DPI for PDF document pages rendering

Parameters
Notes

Default value is 300.

)

Gets the DPI for PDF document pages rendering

Parameters
Return

DPI value

Notes

Default value is 300.

)

Gets the number of preprocessing operations

Parameters
Return

Number of preprocessing operations

Notes

Default value is 0.

)

Parameters
 hBarReader Handle of BarcodeReader object opPreprocessingEnum PreprocessingEnum enumeration value param1int first parameter param2int second parameter
Notes

)

Gets preprocessing operation and its parameters by index

Parameters
 hBarReader Handle of BarcodeReader object indexint index of preprocessing operation op pointer to PreprocessingEnum enumeration variable that receives operation value param1int* pointer to an integer that receives the first parameter param2int* pointer to an integer that receives the second parameter
Notes

)

Sets preprocessing operation and its parameters by index

Parameters
 hBarReader Handle of BarcodeReader object indexint index of preprocessing operation opPreprocessingEnum PreprocessingEnum enumeration value param1int first parameter param2int second parameter
Notes

)

Removes preprocessing operation by index

Parameters
Notes

)

Removes all preprocessing operations

Parameters
Notes

)

Gets an XML string of all settings for the BarcodeReader object

Parameters
)

Sets the BarcodeReader settings from an XML string

Parameters
Barcode Functions
Barcode_Destroy
void DTKBARAPI Barcode_Destroy(
 BARCODE hBarcode
)

Destroys Barcode object instance

Parameters
 hBarcodeBARCODE Handle of Barcode object
Barcode_get_String

Gets the text of the detected barcode

Parameters
 hBarcode Handle of Barcode object buffer Pointer to a buffer that receives the barcode text bufferLen Size of the string buffer
Returns

Number of characters copied to buffer

Barcode_get_BinaryData
int DTKBARAPI Barcode_get_BinaryData(
 BARCODE hBarcode, unsigned char* buffer, int bufferLen
)

Gets the binary data of the detected barcode

Parameters
 hBarcodeBARCODE Handle of Barcode object bufferunsigned char* Pointer to a buffer that receives the barcode binary data bufferLenint Size of the string buffer
Returns

Number of bytes copied to buffer

Barcode_get_Type
BarcodeTypeEnum DTKBARAPI Barcode_get_Type(
 BARCODE hBarcode
)

Gets the type of barcode

Parameters
 hBarcodeBARCODE Handle of Barcode object
Returns

BarcodeTypeEnum enumeration value

Barcode_get_TypeString
int DTKBARAPI Barcode_get_TypeString(
 BARCODE hBarcode, char* buffer, int bufferLen
)

Gets the type of barcode as string

Parameters
 hBarcodeBARCODE Handle of Barcode object bufferchar* Pointer to a string buffer that receives the barcode type bufferLenint Size of the string buffer
Returns

Number of characters copied to buffer

Barcode_get_Page
int DTKBARAPI Barcode_get_Page(
 BARCODE hBarcode
)

Gets the page number of the detected barcode

Parameters
 hBarcodeBARCODE Handle of Barcode object
Returns

Page number of the detected barcode

Notes

This property is only meaningful if you read barcodes from multi-page TIFF image or PDF document.

Barcode_get_Orientation
BarcodeOrientationEnum DTKBARAPI Barcode_get_Orientation(
 BARCODE hBarcode
)

Gets the orientation of recognized barcode

Parameters
 hBarcodeBARCODE Handle of Barcode object
Returns

BarcodeOrientationEnum enumeration value

Barcode_get_Threshold
int DTKBARAPI Barcode_get_Threshold(
 BARCODE hBarcode
)

Gets the threshold level that was used to detect this barcode.

Parameters
 hBarcodeBARCODE Handle of Barcode object
Returns

Threshold level

Barcode_get_BorderStartX1
int DTKBARAPI Barcode_get_BorderStartX1(
 BARCODE hBarcode
)

Gets the X coordinate of the first point of start boundary of the barcode.

Parameters
 hBarcodeBARCODE Handle of Barcode object
Returns

X coordinate in pixels

Notes

See Barcode Location section for details.

Barcode_get_BorderStartY1
int DTKBARAPI Barcode_get_BorderStartY1(
 BARCODE hBarcode
)

Gets the Y coordinate of the first point of start boundary of the barcode.

Parameters
 hBarcodeBARCODE Handle of Barcode object
Returns

Y coordinate in pixels

Notes

See Barcode Location section for details.

Barcode_get_BorderStartX2
int DTKBARAPI Barcode_get_BorderStartX2(
 BARCODE hBarcode
)

Gets the X coordinate of the second point of start boundary of the barcode.

Parameters
 hBarcodeBARCODE Handle of Barcode object
Returns

X coordinate in pixels

Notes

See Barcode Location section for details.

Barcode_get_BorderStartY2
int DTKBARAPI Barcode_get_BorderStartY2(
 BARCODE hBarcode
)

Gets the Y coordinate of the second point of start boundary of the barcode.

Parameters
 hBarcodeBARCODE Handle of Barcode object
Returns

Y coordinate in pixels

Notes

See Barcode Location section for details.

Barcode_get_BorderEndX1
int DTKBARAPI Barcode_get_BorderEndX1(
 BARCODE hBarcode
)

Gets the X coordinate of the first point of end boundary of the barcode.

Parameters
 hBarcodeBARCODE Handle of Barcode object
Returns

X coordinate in pixels

Notes

See Barcode Location section for details.

Barcode_get_BorderEndY1
int DTKBARAPI Barcode_get_BorderEndY1(
 BARCODE hBarcode
)

Gets the Y coordinate of the first point of end boundary of the barcode.

Parameters
 hBarcodeBARCODE Handle of Barcode object
Returns

Y coordinate in pixels

Notes

See Barcode Location section for details.

Barcode_get_BorderEndX2
int DTKBARAPI Barcode_get_BorderEndX2(
 BARCODE hBarcode
)

Gets the X coordinate of the second point of end boundary of the barcode.

Parameters
 hBarcodeBARCODE Handle of Barcode object
Returns

X coordinate in pixels

Notes

See Barcode Location section for details.

Barcode_get_BorderEndY2
int DTKBARAPI Barcode_get_BorderEndY2(
 BARCODE hBarcode
)

Gets the Y coordinate of the second point of end boundary of the barcode.

Parameters
 hBarcodeBARCODE Handle of Barcode object
Returns

Y coordinate in pixels

Notes

See Barcode Location section for details.

Barcode_get_BoundingRectX
int DTKBARAPI Barcode_get_BoundingRectX(
 BARCODE hBarcode
)

Gets the X coordinate of the bounding rectangle of the barcode

Parameters
 hBarcodeBARCODE Handle of Barcode object
Returns

X coordinate in pixels

Notes

See Barcode Location section for details.

Barcode_get_BoundingRectY
int DTKBARAPI Barcode_get_BoundingRectY(
 BARCODE hBarcode
)

Gets the Y coordinate of the bounding rectangle of the barcode

Parameters
 hBarcodeBARCODE Handle of Barcode object
Returns

Y coordinate in pixels

Notes

See Barcode Location section for details.

Barcode_get_BoundingRectWidth
int DTKBARAPI Barcode_get_BoundingRectWidth(
 BARCODE hBarcode
)

Gets the width of the bounding rectangle of the barcode

Parameters
 hBarcodeBARCODE Handle of Barcode object
Returns

Width in pixels

Notes

See Barcode Location section for details.

Barcode_get_BoundingRectHeight
int DTKBARAPI Barcode_get_BoundingRectHeight(
 BARCODE hBarcode
)

Gets the height of the bounding rectangle of the barcode

Parameters
 hBarcodeBARCODE Handle of Barcode object
Returns

Height in pixels

Notes

See Barcode Location section for details.

Barcode_get_Angle
float DTKBARAPI Barcode_get_Angle(
 BARCODE hBarcode
)

Gets the skew angle of the detected barcode, in degrees.

Parameters
 hBarcodeBARCODE Handle of Barcode object
Returns

Angle in degrees

Notes

See Barcode Location section for details.

Barcode_get_Checksum
int DTKBARAPI Barcode_get_Checksum(
 BARCODE hBarcode
)

Gets the checksum of barcode

Parameters
 hBarcodeBARCODE Handle of Barcode object
Returns

Checksum value

Notes

This property applies to barcode with checksum.

Barcode_get_Dim1
int DTKBARAPI Barcode_get_Dim1(
 BARCODE hBarcode
)

Gets the first dimension of the recognized 2D barcode.

Parameters
 hBarcodeBARCODE Handle of Barcode object
Returns

First dimension of 2D barcode

Notes

This property only applies to Data Matrix and QR Code.

Barcode_get_Dim2
int DTKBARAPI Barcode_get_Dim2(
 BARCODE hBarcode
)

Gets the second dimension of the recognized 2D barcode.

Parameters
 hBarcodeBARCODE Handle of Barcode object
Returns

Second dimension of 2D barcode

Notes

This property only applies to Data Matrix and QR Code.

Barcode_get_NumErrorsCorrected
int DTKBARAPI Barcode_get_NumErrorsCorrected(
 BARCODE hBarcode
)

Gets the number of errors corrected when decoding a 2D barcode.

Parameters
 hBarcodeBARCODE Handle of Barcode object
Returns

Number of errors corrected

Barcode_get_ErrorCorrectionLevel
int DTKBARAPI Barcode_get_ErrorCorrectionLevel(
 BARCODE hBarcode
)

Gets the error correction level of the recognized 2D barcode.

Parameters
 hBarcodeBARCODE Handle of Barcode object
Returns

Error correction level

Barcode_get_QRVersion
int DTKBARAPI Barcode_get_QRVersion(
 BARCODE hBarcode
)

Gets the version of recognized QR Code

Parameters
 hBarcodeBARCODE Handle of Barcode object
Returns

Version number

 BARCODE hBarcode
)

Gets a value that indicates whether the RSS Expanded barcode is Stacked.

Parameters
 hBarcodeBARCODE Handle of Barcode object
Returns

Boolean value

)

Parameters
Notes

There is not possibility to create BarReaderResult object, the BarcodeReader only can create this object, you need to destroy it when you do not need it anymore.

Get number of Barcode objects containing in BarReaderResult object

Parameters
Returns

Number of Barcode objects

Get Barcode object from BarReaderResult by it's index

Parameters
 hResult Handle of BarReaderResult object index Index of Barcode object
Returns

Handle of Barcode object

Notes

Each Barcode object from BarReaderResult must be destroyed using \ref LicensePlate_Destroy function

)

Get error code

Parameters
Returns

Value 0 on success, otherwise error code.

)

Parameters
Returns

0 on success, error code otherwise

Notes

The Internet connection (host: dtksoft.com port: 80) is required to perform license activation.

The optional comments parameter can be used to identify certain license activation, for example machine name or customer name can be used.

)

Parameters
Returns

Number of bytes copied to buffer. If activationLink = NULL or size = 0, then function return number of bytes required for store result string

Notes

The Internet connection (host: dtksoft.com port: 80) is required to perform license activation.

The optional comments parameter can be used to identify certain license activation, for example machine name or customer name can be used.

 const char* activationCode
)

Activates license on machine using activation code

Parameters
 activationCodeconst char* String which contain activation code
Returns

0 on success, error code otherwise

Notes

The optional comments parameter can be used to identify certain license activation, for example machine name or customer name can be used.

 char* system_id, int system_id_size
)

Gets the current machine/system ID

Parameters
 system_idchar* Pointer to string buffer which receives current machine ID (fingerprint) system_id_sizeint Size of string buffer
Returns

Number of bytes copied to buffer. If system_id = NULL or system_id_size = 0, then function return number of bytes required for store result string

)

Parameters
Notes

If expirationDate value is 0, then license does not expire.

 1 Workstation 1D 2 Workstation 1D2D 3 Unlimited Workstation 1D 4 Unlimited Workstation 1D1D2D 5 Server 1D 6 Server 1D2D 7 Unlimited Server 1D 8 Unlimited Server 1D2D
 char* buffer, int buff_size
)

Return library version

Parameters
 bufferchar* Pointer to string buffer which receives library version buff_sizeint Size of string buffer
Returns

Number of bytes copied to buffer. If buffer = NULL or buff_size = 0, then function return number of bytes required to store the result string

Other Functions
PDFOpenFromFile
void* DTKBARAPI PDFOpenFromFile(
 const char* fileName, const char* password, int* errorCode
)

Opens PDF document

Parameters
Returns

Handle of PDF document

PDFOpenFromMemFile
void* DTKBARAPI PDFOpenFromMemFile(
 void* pBuffer, int bufferSize, const char* password, int* errorCode
)

Opens PDF document from memory file

Parameters
 pBuffervoid* Pointer to a memory buffer containing the PDF file data bufferSizeint size of memory buffer in bytes passwordconst char* Password (optional) errorCodeint* Pointer to integer what receives error code
Returns

Handle of PDF document

PDFClose
void DTKBARAPI PDFClose(
 void* hPDF
)

Closes PDF document

Parameters
 hPDFvoid* Handle of PDF document
PDFGetPagesCount
int DTKBARAPI PDFGetPagesCount(
 void* hPDF
)

Gets number of pages in PDF document

Parameters
 hPDFvoid* Handle of PDF document
Returns

Number of pages

PDFGetPageImageBuffer
int DTKBARAPI PDFGetPageImageBuffer(
 void* hPDF, int page, int dpi, PixelFormatEnum pixelFormat, void** pImageBuffer, int* width, int* height, int* stride
)

Gets the image buffer of a rendered page of PDF document

Parameters
 hPDFvoid* Handle of PDF document pageint Page number dpiint Rendering DPI pixelFormatPixelFormatEnum PixelFormatEnum enumeration value pImageBuffervoid** Pointer to a pointer variable that receives the image buffer containing pixel data of the frame image. widthint* Pointer to an integer variable that receives the width of the frame image. heightint* Pointer to an integer variable that receives the height of the frame image. strideint* Pointer to an integer variable that receives the size of one image row in bytes.
Returns

Number of pages

Notes

You need to call PDFFreeImageBuffer with received pointer to free memory.

PDFFreeImageBuffer
void DTKBARAPI PDFFreeImageBuffer(
 void* pImageBuffer
)

Free image buffer

Parameters
 pImageBuffervoid* Pointer to image buffer
Preprocessing Operations

The BarcodeReader have a set of preprocessing operations what can be executed before actual barcode recognition process.

There are the following set of functions to work with preprocessing operations.

// Do despeckle and then inversionBarcodeReader_Preprocessing_Clear(hBarReader);BarcodeReader_Preprocessing_Add(hBarReader, PR_Despeckle, 1, 0);BarcodeReader_Preprocessing_Add(hBarReader, PR_Invert, 0, 0);