Types
BARREADER

Handle of BarcodeReader object

Used to handle pointer (void *) to BarcodeReader object

BARREADERRESULT

Handle of BarReaderResult 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

See Also

BarcodeReader_set_QuietZoneSize

ThresholdModeEnum

Thresholding mode

TM_Automatic

Automatic threshold detection

TM_Fixed

Fixed threshold

TM_Multiple

Multiple thresholds

TM_Adaptive

Adaptive thresholding

See Also

BarcodeReader_set_Threshold

PreprocessingEnum

Preprocessing operations

PR_Erosion

Image erosion

PR_Dilation

Image dilation

PR_Despeckle

Image despeckle

PR_Sharp

Image sharpness

PR_Invert

Image inversion

See Also

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)

See Also

BarcodeReader_set_QRCodeRequiredECCLevel

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

PDFReadingTypeEnum

PDF file reading type

PDF_Render

Render whole page to single image and process it.

PDF_Images

Extract all images from page and process each image separately.

See Also

BarcodeReader_set_PDFReadingType

Callbacks
PageProcessingCompletedCallback

Invokes by BarcodeReader object after the page has finished processing

Parameters
hBarReader

Handle of BarcodeReader object

pageNum

page number

errorCode

error code

BarcodeReader Functions
BarcodeReader_Create
BARREADER DTKBARAPI BarcodeReader_Create(
PageProcessingCompletedCallback pageProcessingCompletedCallback
)

Create new BarcodeReader instance

Parameters
pageProcessingCompletedCallback

PageProcessingCompletedCallback function

Return

Handle of BarcodeReader object

Notes

The parameter pageProcessingCompletedCallback can be empty (zero). In this case PageProcessingCompletedCallback will not be invoked.

The PageProcessingCompletedCallback function do not impact to image processing algorithms and final results.  It will simply be called after the page/image has finished processing, to be able to control the progress of the multi-page files processing.

BarcodeReader_Destroy
void DTKBARAPI BarcodeReader_Destroy(
BARREADER hBarReader
)

Destroy BarcodeReader instance

Parameters
hBarReader

Handle of BarcodeReader object

BarcodeReader_ReadFromFile
BARREADERRESULT DTKBARAPI BarcodeReader_ReadFromFile(
BARREADER hBarReader,
const charfileName
)

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

Parameters
hBarReader

Handle of BarcodeReader object

fileName
const char*

Path to image file

Return

Handle of BarReaderResult object

Notes

BarReaderResult object must be deleted using function BarReaderResult_Destroy

BarcodeReader_ReadFromMemFile
BARREADERRESULT DTKBARAPI BarcodeReader_ReadFromMemFile(
BARREADER hBarReader,
voidpBuffer,
int bufferSize
)

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

Parameters
hBarReader

Handle of BarcodeReader object

pBuffer
void*

Pointer to a memory buffer containing the image file data

bufferSize
int

size of memory buffer in bytes

Return

Handle of BarReaderResult object

Notes

BarReaderResult object must be deleted using function BarReaderResult_Destroy

BarcodeReader_ReadFromURL
BARREADERRESULT DTKBARAPI BarcodeReader_ReadFromURL(
BARREADER hBarReader,
const charurl
)

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

Parameters
hBarReader

Handle of BarcodeReader object

url
const char*

URL string, example: http://​domain​.com​/image​.jpg

Return

Handle of BarReaderResult object

Notes

BarReaderResult object must be deleted using function BarReaderResult_Destroy.

This function can be used for still image mode only.

BarcodeReader_ReadFromImageBuffer
BARREADERRESULT DTKBARAPI BarcodeReader_ReadFromImageBuffer(
BARREADER hBarReader,
voidpBuffer,
int width,
int height,
int stride,
PixelFormatEnum pixelFormat
)

Read barcodes from image buffer

Parameters
hBarReader

Handle of BarcodeReader object

pBuffer
void*

Pointer to buffer of image pixels data

width
int

Width of image in pixels

height
int

Height of image in pixels

stride
int

Size of one image row in bytes

pixelFormat

Pixel format, PIXFMT enumeration

Return

Handle of BarReaderResult object

Notes

BarReaderResult object must be deleted using function BarReaderResult_Destroy

BarcodeReader_set_BarcodeTypes
void DTKBARAPI BarcodeReader_set_BarcodeTypes(
BARREADER hBarReader,
BarcodeTypeEnum types
)

Sets the types of barcode for recognition

Parameters
hBarReader

Handle of BarcodeReader object

types

one or a combination of BarcodeTypeEnum enumeration values

Notes

Default value is 0 (BT_Unknown).

BarcodeReader_get_BarcodeTypes
BarcodeTypeEnum DTKBARAPI BarcodeReader_get_BarcodeTypes(
BARREADER hBarReader
)

Gets the types of barcode for recognition

Parameters
hBarReader

Handle of BarcodeReader object

Return

One or a combination of BarcodeTypeEnum enumeration values

Notes

Default value is 0 (BT_Unknown).

BarcodeReader_set_Threshold
void DTKBARAPI BarcodeReader_set_Threshold(
BARREADER hBarReader,
int threshold
)

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

Parameters
hBarReader

Handle of BarcodeReader object

threshold
int

threshold value from 0 to 255

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

BarcodeReader_get_Threshold
int DTKBARAPI BarcodeReader_get_Threshold(
BARREADER hBarReader
)

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

Parameters
hBarReader

Handle of BarcodeReader object

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

BarcodeReader_set_ThresholdMode
void DTKBARAPI BarcodeReader_set_ThresholdMode(
BARREADER barReader,
ThresholdModeEnum thresholdMode
)

Sets the mode of image thresholding

Parameters
hBarReader

Handle of BarcodeReader object

thresholdMode

ThresholdModeEnum enumeration value

Notes

Default value is TM_Automatic.

See function BarcodeReader_set_Threshold for details.

BarcodeReader_get_ThresholdMode
ThresholdModeEnum DTKBARAPI BarcodeReader_get_ThresholdMode(
BARREADER barReader
)

Gets the mode of image thresholding

Parameters
hBarReader

Handle of BarcodeReader object

Return

ThresholdModeEnum enumeration value

Notes

Default value is TM_Automatic.

See function BarcodeReader_set_Threshold for details.

BarcodeReader_set_ThresholdCount
void DTKBARAPI BarcodeReader_set_ThresholdCount(
BARREADER barReader,
int thresholdCount
)

Sets the number of thresholds to be used for recognition

Parameters
hBarReader

Handle of BarcodeReader object

thresholdCount
int

expected number of barcodes

Notes

Default value is 8.

See function BarcodeReader_set_Threshold for details.

BarcodeReader_get_ThresholdCount
int DTKBARAPI BarcodeReader_get_ThresholdCount(
BARREADER barReader
)

Gets the number of thresholds to be used for recognition

Parameters
hBarReader

Handle of BarcodeReader object

Return

Number of thresholds

Notes

Default value is 8.

See function BarcodeReader_set_Threshold for details.

BarcodeReader_set_ThresholdStep
void DTKBARAPI BarcodeReader_set_ThresholdStep(
BARREADER barReader,
int thresholdStep
)

Sets the step for multiple thresholding

Parameters
hBarReader

Handle of BarcodeReader object

thresholdStep
int

step for multiple thresholding

Notes

Default value is 16.

See function BarcodeReader_set_Threshold for details.

BarcodeReader_get_ThresholdStep
int DTKBARAPI BarcodeReader_get_ThresholdStep(
BARREADER barReader
)

Gets the step for multiple thresholding

Parameters
hBarReader

Handle of BarcodeReader object

Return

Step for multiple thresholding

Notes

Default value is 16.

See function BarcodeReader_set_Threshold for details.

BarcodeReader_set_RecognitionTimeout
void DTKBARAPI BarcodeReader_set_RecognitionTimeout(
BARREADER barReader,
int timeOut
)

Sets the recognition timeout

Parameters
hBarReader

Handle of BarcodeReader object

timeOut
int

number of seconds

Notes

Default value is 0.

Specifies the maximum number of seconds for the recognition process. If the recognition time exceeds this number of seconds, the process will be aborted.

A value of 0 means that there is no time limit for the recognition process.

BarcodeReader_get_RecognitionTimeout
int DTKBARAPI BarcodeReader_get_RecognitionTimeout(
BARREADER barReader
)

Gets the recognition timeout

Parameters
hBarReader

Handle of BarcodeReader object

Notes

Default value is 0.

Specifies the maximum number of seconds for the recognition process. If the recognition time exceeds this number of seconds, the process will be aborted.

A value of 0 means that there is no time limit for the recognition process.

BarcodeReader_set_BarcodesToRead
void DTKBARAPI BarcodeReader_set_BarcodesToRead(
BARREADER hBarReader,
int barcodesToRead
)

Sets the expected number of barcodes on single image

Parameters
hBarReader

Handle of BarcodeReader object

barcodesToRead
int

expected number of barcodes

Notes

Default value is 1.

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.

BarcodeReader_get_BarcodesToRead
int DTKBARAPI BarcodeReader_get_BarcodesToRead(
BARREADER hBarReader
)

Gets the expected number of barcodes on single image

Parameters
hBarReader

Handle of BarcodeReader object

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.

BarcodeReader_set_ScanPage
void DTKBARAPI BarcodeReader_set_ScanPage(
BARREADER hBarReader,
int scanPage
)

Sets the page number for processing

Parameters
hBarReader

Handle of BarcodeReader object

scanPage
int

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.

BarcodeReader_get_ScanPage
int DTKBARAPI BarcodeReader_get_ScanPage(
BARREADER hBarReader
)

Gets the page number for processing

Parameters
hBarReader

Handle of BarcodeReader object

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.

BarcodeReader_set_Code11HaveChecksum
void DTKBARAPI BarcodeReader_set_Code11HaveChecksum(
BARREADER hBarReader,
bool bSet
)

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

Parameters
hBarReader

Handle of BarcodeReader object

bSet
bool

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.

BarcodeReader_get_Code11HaveChecksum
bool DTKBARAPI BarcodeReader_get_Code11HaveChecksum(
BARREADER hBarReader
)

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

Parameters
hBarReader

Handle of BarcodeReader object

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.

BarcodeReader_set_Code39HaveChecksum
void DTKBARAPI BarcodeReader_set_Code39HaveChecksum(
BARREADER hBarReader,
bool bSet
)

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

Parameters
hBarReader

Handle of BarcodeReader object

bSet
bool

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.

BarcodeReader_get_Code39HaveChecksum
bool DTKBARAPI BarcodeReader_get_Code39HaveChecksum(
BARREADER hBarReader
)

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

Parameters
hBarReader

Handle of BarcodeReader object

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.

BarcodeReader_set_Code93HaveChecksum
void DTKBARAPI BarcodeReader_set_Code93HaveChecksum(
BARREADER hBarReader,
bool bSet
)

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

Parameters
hBarReader

Handle of BarcodeReader object

bSet
bool

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.

BarcodeReader_get_Code93HaveChecksum
bool DTKBARAPI BarcodeReader_get_Code93HaveChecksum(
BARREADER hBarReader
)

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

Parameters
hBarReader

Handle of BarcodeReader object

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.

BarcodeReader_set_Inter2of5HaveChecksum
void DTKBARAPI BarcodeReader_set_Inter2of5HaveChecksum(
BARREADER hBarReader,
bool bSet
)

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

Parameters
hBarReader

Handle of BarcodeReader object

bSet
bool

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.

BarcodeReader_get_Inter2of5HaveChecksum
bool DTKBARAPI BarcodeReader_get_Inter2of5HaveChecksum(
BARREADER hBarReader
)

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

Parameters
hBarReader

Handle of BarcodeReader object

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.

BarcodeReader_set_Code39NoStartStop
void DTKBARAPI BarcodeReader_set_Code39NoStartStop(
BARREADER hBarReader,
bool bSet
)

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

Parameters
hBarReader

Handle of BarcodeReader object

bSet
bool

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.

BarcodeReader_get_Code39NoStartStop
bool DTKBARAPI BarcodeReader_get_Code39NoStartStop(
BARREADER hBarReader
)

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

Parameters
hBarReader

Handle of BarcodeReader object

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.

BarcodeReader_set_ConvertUPCEtoUPCA
void DTKBARAPI BarcodeReader_set_ConvertUPCEtoUPCA(
BARREADER hBarReader,
bool bSet
)

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

Parameters
hBarReader

Handle of BarcodeReader object

bSet
bool

Boolean value

Notes

Default value is False.

BarcodeReader_get_ConvertUPCEtoUPCA
bool DTKBARAPI BarcodeReader_get_ConvertUPCEtoUPCA(
BARREADER hBarReader
)

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

Parameters
hBarReader

Handle of BarcodeReader object

Return

Boolean value

Notes

Default value is False.

BarcodeReader_set_Inter2of5MinDigitsCount
void DTKBARAPI BarcodeReader_set_Inter2of5MinDigitsCount(
BARREADER hBarReader,
int val
)

Sets the minimum digits count in Interleaved 2of5 barcode

Parameters
hBarReader

Handle of BarcodeReader object

val
int

Minimum digits count

Notes

Default value is 6.

BarcodeReader_get_Inter2of5MinDigitsCount
int DTKBARAPI BarcodeReader_get_Inter2of5MinDigitsCount(
BARREADER hBarReader
)

Gets the minimum digits count in Interleaved 2of5 barcode

Parameters
hBarReader

Handle of BarcodeReader object

Return

Minimum digits count in Interleaved 2of5 barcode

Notes

Default value is 6.

BarcodeReader_set_Orientation
void DTKBARAPI BarcodeReader_set_Orientation(
BARREADER barReader,
BarcodeOrientationEnum orientation
)

Sets the expected orientation of the barcode.

Parameters
hBarReader

Handle of BarcodeReader object

orientation

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.

BarcodeReader_get_Orientation
BarcodeOrientationEnum DTKBARAPI BarcodeReader_get_Orientation(
BARREADER barReader
)

Gets the expected orientation of the barcode.

Parameters
hBarReader

Handle of BarcodeReader object

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.

BarcodeReader_set_ScanInterval
void DTKBARAPI BarcodeReader_set_ScanInterval(
BARREADER hBarReader,
int scanInterval
)

Sets the image scanning interval.

Parameters
hBarReader

Handle of BarcodeReader object

scanInterval
int

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.

BarcodeReader_get_ScanInterval
int DTKBARAPI BarcodeReader_get_ScanInterval(
BARREADER hBarReader
)

Gets the image scanning interval.

Parameters
hBarReader

Handle of BarcodeReader object

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.

BarcodeReader_set_QRCodeRequiredECCLevel
void DTKBARAPI BarcodeReader_set_QRCodeRequiredECCLevel(
BARREADER barReader,
QRCodeECCLevelEnum eccLevel
)

Sets the required ECC level for QR Codes detection

Parameters
hBarReader

Handle of BarcodeReader object

eccLevel

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.

BarcodeReader_get_QRCodeRequiredECCLevel
QRCodeECCLevelEnum DTKBARAPI BarcodeReader_get_QRCodeRequiredECCLevel(
BARREADER barReader
)

Gets the required ECC level for QR Codes detection

Parameters
hBarReader

Handle of BarcodeReader object

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.

BarcodeReader_set_QuietZoneSize
void DTKBARAPI BarcodeReader_set_QuietZoneSize(
BARREADER barReader,
QuietZoneSizeEnum quietZoneSize
)

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

Parameters
hBarReader

Handle of BarcodeReader object

quietZoneSize

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.

BarcodeReader_get_QuietZoneSize
QuietZoneSizeEnum DTKBARAPI BarcodeReader_get_QuietZoneSize(
BARREADER barReader
)

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

Parameters
hBarReader

Handle of BarcodeReader object

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.

BarcodeReader_set_ScanRectangleX
void DTKBARAPI BarcodeReader_set_ScanRectangleX(
BARREADER barReader,
int x
)

Sets the X coordinate of the scan rectangle

Parameters
hBarReader

Handle of BarcodeReader object

x
int

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.

BarcodeReader_get_ScanRectangleX
int DTKBARAPI BarcodeReader_get_ScanRectangleX(
BARREADER barReader
)

Gets the X coordinate of the scan rectangle

Parameters
hBarReader

Handle of BarcodeReader object

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.

BarcodeReader_set_ScanRectangleX

Sets the Y coordinate of the scan rectangle

Parameters
hBarReader

Handle of BarcodeReader object

y

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.

BarcodeReader_get_ScanRectangleY
int DTKBARAPI BarcodeReader_get_ScanRectangleY(
BARREADER barReader
)

Gets the Y coordinate of the scan rectangle

Parameters
hBarReader

Handle of BarcodeReader object

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.

BarcodeReader_set_ScanRectangleWidth
void DTKBARAPI BarcodeReader_set_ScanRectangleWidth(
BARREADER barReader,
int width
)

Sets the Width of the scan rectangle

Parameters
hBarReader

Handle of BarcodeReader object

width
int

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.

BarcodeReader_get_ScanRectangleWidth
int DTKBARAPI BarcodeReader_get_ScanRectangleWidth(
BARREADER barReader
)

Gets the Width of the scan rectangle

Parameters
hBarReader

Handle of BarcodeReader object

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.

BarcodeReader_set_ScanRectangleHeight
void DTKBARAPI BarcodeReader_set_ScanRectangleHeight(
BARREADER barReader,
int height
)

Sets the Height of the scan rectangle

Parameters
hBarReader

Handle of BarcodeReader object

height
int

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.

BarcodeReader_get_ScanRectangleHeight
int DTKBARAPI BarcodeReader_get_ScanRectangleHeight(
BARREADER barReader
)

Gets the Height of the scan rectangle

Parameters
hBarReader

Handle of BarcodeReader object

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.

BarcodeReader_set_PDFReadingType
void DTKBARAPI BarcodeReader_set_PDFReadingType(
BARREADER barReader,
PDFReadingTypeEnum pdfReadingType
)

Sets the reading type of PDF documents

Parameters
hBarReader

Handle of BarcodeReader object

pdfReadingType

PDFReadingTypeEnum enumeration value

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.

BarcodeReader_get_PDFReadingType
PDFReadingTypeEnum DTKBARAPI BarcodeReader_get_PDFReadingType(
BARREADER barReader
)

Gets the reading type of PDF documents

Parameters
hBarReader

Handle of BarcodeReader object

Return

PDFReadingTypeEnum enumeration value

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.

BarcodeReader_set_PDFRenderDPI
void DTKBARAPI BarcodeReader_set_PDFRenderDPI(
BARREADER barReader,
int dpi
)

Sets the DPI for PDF document pages rendering

Parameters
hBarReader

Handle of BarcodeReader object

dpi
int

DPI value

Notes

Default value is 300.

Used for PDFReadingType = PDF_Render

BarcodeReader_get_PDFRenderDPI
int DTKBARAPI BarcodeReader_get_PDFRenderDPI(
BARREADER barReader
)

Gets the DPI for PDF document pages rendering

Parameters
hBarReader

Handle of BarcodeReader object

Return

DPI value

Notes

Default value is 300.

Used for PDFReadingType = PDF_Render

BarcodeReader_Preprocessing_Count
int DTKBARAPI BarcodeReader_Preprocessing_Count(
BARREADER barReader
)

Gets the number of preprocessing operations

Parameters
hBarReader

Handle of BarcodeReader object

Return

Number of preprocessing operations

Notes

Default value is 0.

For more information, read Preprocessing Operations

BarcodeReader_Preprocessing_Add
void DTKBARAPI BarcodeReader_Preprocessing_Add(
BARREADER barReader,
PreprocessingEnum op,
int param1,
int param2
)

Adds new preprocessing operations

Parameters
hBarReader

Handle of BarcodeReader object

op

PreprocessingEnum enumeration value

param1
int

first parameter

param2
int

second parameter

Notes

For more information, read Preprocessing Operations

BarcodeReader_Preprocessing_Get
void DTKBARAPI BarcodeReader_Preprocessing_Get(
BARREADER barReader,
int index,
PreprocessingEnumop,
intparam1,
intparam2
)

Gets preprocessing operation and its parameters by index

Parameters
hBarReader

Handle of BarcodeReader object

index
int

index of preprocessing operation

op

pointer to PreprocessingEnum enumeration variable that receives operation value

param1
int*

pointer to an integer that receives the first parameter

param2
int*

pointer to an integer that receives the second parameter

Notes

For more information, read Preprocessing Operations

BarcodeReader_Preprocessing_Set
void DTKBARAPI BarcodeReader_Preprocessing_Set(
BARREADER barReader,
int index,
PreprocessingEnum op,
int param1,
int param2
)

Sets preprocessing operation and its parameters by index

Parameters
hBarReader

Handle of BarcodeReader object

index
int

index of preprocessing operation

op

PreprocessingEnum enumeration value

param1
int

first parameter

param2
int

second parameter

Notes

For more information, read Preprocessing Operations

BarcodeReader_Preprocessing_Remove
void DTKBARAPI BarcodeReader_Preprocessing_Remove(
BARREADER barReader,
int index
)

Removes preprocessing operation by index

Parameters
hBarReader

Handle of BarcodeReader object

index
int

index of preprocessing operation

Notes

For more information, read Preprocessing Operations

BarcodeReader_Preprocessing_Clear
void DTKBARAPI BarcodeReader_Preprocessing_Clear(
BARREADER barReader
)

Removes all preprocessing operations

Parameters
hBarReader

Handle of BarcodeReader object

Notes

For more information, read Preprocessing Operations

BarcodeReader_GetSettingsXml
int DTKBARAPI BarcodeReader_GetSettingsXml(
BARREADER hBarReader,
charxmlBuffer,
int xmlBufferSize
)

Gets an XML string of all settings for the BarcodeReader object

Parameters
hBarReader

Handle of BarcodeReader object

xmlBuffer
char*

Pointer to string buffer that receives XML string

xmlBufferSize
int

Size of string buffer

BarcodeReader_SetSettingsXml
int DTKBARAPI BarcodeReader_SetSettingsXml(
BARREADER hBarReader,
const charxml
)

Sets the BarcodeReader settings from an XML string

Parameters
hBarReader

Handle of BarcodeReader object

xml
const char*

XML string

Returns

Value 0 on success, or -1 if the xml string have a wrong structure

Barcode Functions
Barcode_Destroy
void DTKBARAPI Barcode_Destroy(
BARCODE hBarcode
)

Destroys Barcode object instance

Parameters
hBarcode

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 charbuffer,
int bufferLen
)

Gets the binary data of the detected barcode

Parameters
hBarcode

Handle of Barcode object

buffer
unsigned char*

Pointer to a buffer that receives the barcode binary data

bufferLen
int

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
hBarcode

Handle of Barcode object

Returns

BarcodeTypeEnum enumeration value

Barcode_get_TypeString
int DTKBARAPI Barcode_get_TypeString(
BARCODE hBarcode,
charbuffer,
int bufferLen
)

Gets the type of barcode as string

Parameters
hBarcode

Handle of Barcode object

buffer
char*

Pointer to a string buffer that receives the barcode type

bufferLen
int

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
hBarcode

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
hBarcode

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
hBarcode

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
hBarcode

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
hBarcode

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
hBarcode

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
hBarcode

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
hBarcode

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
hBarcode

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
hBarcode

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
hBarcode

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
hBarcode

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
hBarcode

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
hBarcode

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
hBarcode

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
hBarcode

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
hBarcode

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
hBarcode

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
hBarcode

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
hBarcode

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
hBarcode

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
hBarcode

Handle of Barcode object

Returns

Version number

Barcode_get_RSSExpandedIsStacked
bool DTKBARAPI Barcode_get_RSSExpandedIsStacked(
BARCODE hBarcode
)

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

Parameters
hBarcode

Handle of Barcode object

Returns

Boolean value

BarReaderResult Functions
BarReaderResult_Destroy
void DTKBARAPI BarReaderResult_Destroy(
BARREADERRESULT hResult
)

Destroy BarReaderResult object

Parameters
hResult

Handle of BarReaderResult object

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.

BarReaderResult_get_BarcodesCount
int DTKBARAPI BarReaderResult_get_BarcodesCount(
BARREADERRESULT hResult
)

Get number of Barcode objects containing in BarReaderResult object

Parameters
hResult

Handle of BarReaderResult object

Returns

Number of Barcode objects

BarReaderResult_get_Barcode
BARCODE DTKBARAPI BarReaderResult_get_Barcode(
BARREADERRESULT hResult,
int index
)

Get Barcode object from BarReaderResult by it's index

Parameters
hResult

Handle of BarReaderResult object

index
int

Index of Barcode object

Returns

Handle of Barcode object

Notes

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

BarReaderResult_get_ErrorCode
int DTKBARAPI BarReaderResult_get_ErrorCode(
BARREADERRESULT hResult
)

Get error code

Parameters
hResult

Handle of BarReaderResult object

Returns

Value 0 on success, otherwise error code.

Below is a list of possible error codes:

DTK_E_BUFFER_IS_NULL  7101

DTK_E_INVALID_SCAN_RECT  7102

DTK_E_FILENAME  7103

DTK_E_TIMEOUT  7104

DTK_E_DECODE_IMAGE 7105

DTK_E_PIXEL_FORMAT 7106

DTK_E_TIFF_DECODE 7107

DTK_E_NO_LICENSE 7201

DTK_E_VALIDATE_TRIAL 7202

DTK_E_PDF_CANNOT_OPEN 7301

DTK_E_PDF_WRONG_PASSWORD 7302

DTK_E_PDF_WRONG_PAGENUM 7303

License Functions
BarcodeReader_ActivateLicenseOnline
int DTKBARAPI BarcodeReader_ActivateLicenseOnline(
const charlicenseKey,
const charcomments
)

Activates license on-line

Parameters
licenseKey
const char*

String containing the license key

comments
const char*

String containing comments to assign to activation (optional)

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.

BarcodeReader_GetActivationLink
int DTKBARAPI BarcodeReader_GetActivationLink(
const charlicenseKey,
const charcomments,
charactivationLink,
int size
)

Returns activation link to activate the defined license key

Parameters
licenseKey
const char*

String which contain license key

comments
const char*

String which contain comments assigned to activation (optional)

activationLink
char*

Pointer to string buffer which receives activation link

size
int

Size of string buffer

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.

BarcodeReader_ActivateLicenseOffline
int DTKBARAPI BarcodeReader_ActivateLicenseOffline(
const charactivationCode
)

Activates license on machine using activation code

Parameters
activationCode
const 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.

BarcodeReader_GetSystemID
int DTKBARAPI BarcodeReader_GetSystemID(
charsystem_id,
int system_id_size
)

Gets the current machine/system ID

Parameters
system_id
char*

Pointer to string buffer which receives current machine ID (fingerprint)

system_id_size
int

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

BarcodeReader_GetActivatedLicenseInfo
void DTKBARAPI BarcodeReader_GetActivatedLicenseInfo(
charlicense_key,
int license_key_max_len,
charcomments,
int comments_max_len,
intlicense_type,
time_t* expirationDate
)

Gets the information of the currently activated license: license key, comments, license type, expiration date (if applicable)

Parameters
license_key
char*

Pointer to string buffer which receives license key activated on current machine

license_key_max_len
int

Size of string buffer

comments
char*

Pointer to string buffer which receives activation comments

comments_max_len
int

Size of string buffer

license_type
int*

Pointer to integer variable which receives type of activated license

expirationDate
time_t*

Pointer to 64bit integer value (time_t C++ type) which receives expiration date of activated license

Notes

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

The license type possible values:

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

BarcodeReader_GetLibraryVersion
int DTKBARAPI BarcodeReader_GetLibraryVersion(
charbuffer,
int buff_size
)

Return library version

Parameters
buffer
char*

Pointer to string buffer which receives library version

buff_size
int

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 charfileName,
const charpassword,
interrorCode
)

Opens PDF document

Parameters
fileName
const char*

File name

password
const char*

Password (optional)

errorCode
int*

Pointer to integer what receives error code

Returns

Handle of PDF document

PDFOpenFromMemFile
void* DTKBARAPI PDFOpenFromMemFile(
voidpBuffer,
int bufferSize,
const charpassword,
interrorCode
)

Opens PDF document from memory file

Parameters
pBuffer
void*

Pointer to a memory buffer containing the PDF file data

bufferSize
int

size of memory buffer in bytes

password
const char*

Password (optional)

errorCode
int*

Pointer to integer what receives error code

Returns

Handle of PDF document

PDFClose
void DTKBARAPI PDFClose(
voidhPDF
)

Closes PDF document

Parameters
hPDF
void*

Handle of PDF document

PDFGetPagesCount
int DTKBARAPI PDFGetPagesCount(
voidhPDF
)

Gets number of pages in PDF document

Parameters
hPDF
void*

Handle of PDF document

Returns

Number of pages

PDFGetPageImageBuffer
int DTKBARAPI PDFGetPageImageBuffer(
voidhPDF,
int page,
int dpi,
PixelFormatEnum pixelFormat,
void** pImageBuffer,
intwidth,
intheight,
intstride
)

Gets the image buffer of a rendered page of PDF document

Parameters
hPDF
void*

Handle of PDF document

page
int

Page number

dpi
int

Rendering DPI

pixelFormat

PixelFormatEnum enumeration value

pImageBuffer
void**

Pointer to a pointer variable that receives the image buffer containing pixel data of the frame image.

width
int*

Pointer to an integer variable that receives the width of the frame image.

height
int*

Pointer to an integer variable that receives the height of the frame image.

stride
int*

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(
voidpImageBuffer
)

Free image buffer

Parameters
pImageBuffer
void*

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.

BarcodeReader_Preprocessing_Count

BarcodeReader_Preprocessing_Add

BarcodeReader_Preprocessing_Get

BarcodeReader_Preprocessing_Set

BarcodeReader_Preprocessing_Remove

BarcodeReader_Preprocessing_Clear

All available preprocessing operations defined in PreprocessingEnum enumeration.

PR_Erosion

1st parameter is kernel size. Value 1 - 3x3 kernel, 2 - 5x5, 3 - 7x7, etc. 2nd parameter not used.

PR_Dilation

1st parameter is kernel size. Value 1 - 3x3 kernel, 2 - 5x5, 3 - 7x7, etc. 2nd parameter not used.

PR_Despeckle

1st parameter is kernel size. Value 1 - 3x3 kernel, 2 - 5x5, 3 - 7x7, etc. 2nd parameter not used.

PR_Sharp

no parameters (1st and 2nd parameters are not used)

PR_Invert

no parameters (1st and 2nd parameters are not used)

Example
// Do despeckle and then inversion
BarcodeReader_Preprocessing_Clear(hBarReader);
BarcodeReader_Preprocessing_Add(hBarReader, PR_Despeckle, 1, 0);
BarcodeReader_Preprocessing_Add(hBarReader, PR_Invert, 0, 0);
Barcode Location
barcode_bbox
barcode_angle