Handle of BarcodeReader object
Used to handle pointer (void *) to BarcodeReader object
Handle of BarReaderResult object
Used to handle pointer (void *) to BarReaderResult object
Handle of Barcode object
Used to handle pointer (void *) to Barcode object
Barcode types
Invokes by BarcodeReader object after the page has finished processing
hBarReader | Handle of BarcodeReader object |
pageNum | page number |
errorCode | error code |
BARREADER DTKBARAPI BarcodeReader_Create( |
| ) |
Create new BarcodeReader instance
pageProcessingCompletedCallback | PageProcessingCompletedCallback function |
Handle of BarcodeReader object
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.
void DTKBARAPI BarcodeReader_Destroy( |
| ) |
BARREADERRESULT DTKBARAPI BarcodeReader_ReadFromFile( |
| ) |
Read barcodes from image file (JPEG, BMP, PNG)
hBarReader | Handle of BarcodeReader object |
fileName const char* | Path to image file |
Handle of BarReaderResult object
BarReaderResult object must be deleted using function BarReaderResult_Destroy
BARREADERRESULT DTKBARAPI BarcodeReader_ReadFromMemFile( |
| ) |
Read barcodes from image file (JPEG, BMP, PNG) contained in the memory
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 |
Handle of BarReaderResult object
BarReaderResult object must be deleted using function BarReaderResult_Destroy
BARREADERRESULT DTKBARAPI BarcodeReader_ReadFromURL( |
| ) |
Read barcodes from image file (JPEG, BMP, PNG) from HTTP URL
hBarReader | Handle of BarcodeReader object |
url const char* | URL string, example: http://domain.com/image.jpg |
Handle of BarReaderResult object
BarReaderResult object must be deleted using function BarReaderResult_Destroy.
This function can be used for still image mode only.
BARREADERRESULT DTKBARAPI BarcodeReader_ReadFromImageBuffer( |
| ) |
Read barcodes from image buffer
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 |
Handle of BarReaderResult object
BarReaderResult object must be deleted using function BarReaderResult_Destroy
void DTKBARAPI BarcodeReader_set_BarcodeTypes( |
| ) |
Sets the types of barcode for recognition
hBarReader | Handle of BarcodeReader object |
types | one or a combination of BarcodeTypeEnum enumeration values |
Default value is 0 (BT_Unknown).
BarcodeTypeEnum DTKBARAPI BarcodeReader_get_BarcodeTypes( |
| ) |
Gets the types of barcode for recognition
hBarReader | Handle of BarcodeReader object |
One or a combination of BarcodeTypeEnum enumeration values
Default value is 0 (BT_Unknown).
void DTKBARAPI BarcodeReader_set_Threshold( |
| ) |
Sets the color threshold to distinguish between background and foreground pixels.
hBarReader | Handle of BarcodeReader object |
threshold int | threshold value from 0 to 255 |
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.
Threshold = 100
ThresholdCount = 6
ThresholdStep = 10
The following thresholds will be used: 100, 110, 90, 120, 80, 130, 70
int DTKBARAPI BarcodeReader_get_Threshold( |
| ) |
Gets the color threshold to distinguish between background and foreground pixels.
hBarReader | Handle of BarcodeReader object |
Threshold value
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.
Threshold = 100
ThresholdCount = 6
ThresholdStep = 10
The following thresholds will be used: 100, 110, 90, 120, 80, 130, 70
void DTKBARAPI BarcodeReader_set_ThresholdMode( |
| ) |
Sets the mode of image thresholding
hBarReader | Handle of BarcodeReader object |
thresholdMode | ThresholdModeEnum enumeration value |
Default value is TM_Automatic.
See function BarcodeReader_set_Threshold for details.
ThresholdModeEnum DTKBARAPI BarcodeReader_get_ThresholdMode( |
| ) |
Gets the mode of image thresholding
hBarReader | Handle of BarcodeReader object |
ThresholdModeEnum enumeration value
Default value is TM_Automatic.
See function BarcodeReader_set_Threshold for details.
void DTKBARAPI BarcodeReader_set_ThresholdCount( |
| ) |
Sets the number of thresholds to be used for recognition
hBarReader | Handle of BarcodeReader object |
thresholdCount int | expected number of barcodes |
Default value is 8.
See function BarcodeReader_set_Threshold for details.
int DTKBARAPI BarcodeReader_get_ThresholdCount( |
| ) |
Gets the number of thresholds to be used for recognition
hBarReader | Handle of BarcodeReader object |
Number of thresholds
Default value is 8.
See function BarcodeReader_set_Threshold for details.
void DTKBARAPI BarcodeReader_set_ThresholdStep( |
| ) |
Sets the step for multiple thresholding
hBarReader | Handle of BarcodeReader object |
thresholdStep int | step for multiple thresholding |
Default value is 16.
See function BarcodeReader_set_Threshold for details.
int DTKBARAPI BarcodeReader_get_ThresholdStep( |
| ) |
Gets the step for multiple thresholding
hBarReader | Handle of BarcodeReader object |
Step for multiple thresholding
Default value is 16.
See function BarcodeReader_set_Threshold for details.
void DTKBARAPI BarcodeReader_set_RecognitionTimeout( |
| ) |
Sets the recognition timeout
hBarReader | Handle of BarcodeReader object |
timeOut int | number of seconds |
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.
int DTKBARAPI BarcodeReader_get_RecognitionTimeout( |
| ) |
Gets the recognition timeout
hBarReader | Handle of BarcodeReader object |
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.
void DTKBARAPI BarcodeReader_set_BarcodesToRead( |
| ) |
Sets the expected number of barcodes on single image
hBarReader | Handle of BarcodeReader object |
barcodesToRead int | expected number of barcodes |
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.
int DTKBARAPI BarcodeReader_get_BarcodesToRead( |
| ) |
Gets the expected number of barcodes on single image
hBarReader | Handle of BarcodeReader object |
Expected number of barcodes
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.
void DTKBARAPI BarcodeReader_set_ScanPage( |
| ) |
Sets the page number for processing
hBarReader | Handle of BarcodeReader object |
scanPage int | page number |
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.
int DTKBARAPI BarcodeReader_get_ScanPage( |
| ) |
Gets the page number for processing
hBarReader | Handle of BarcodeReader object |
Page number
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.
void DTKBARAPI BarcodeReader_set_Code11HaveChecksum( |
| ) |
Sets the value indicating whether optional checksum validation is required for Code 11 barcodes.
hBarReader | Handle of BarcodeReader object |
bSet bool | Boolean value |
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.
bool DTKBARAPI BarcodeReader_get_Code11HaveChecksum( |
| ) |
Gets the value indicating whether optional checksum validation is required for Code 11 barcodes.
hBarReader | Handle of BarcodeReader object |
Boolean value
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.
void DTKBARAPI BarcodeReader_set_Code39HaveChecksum( |
| ) |
Sets the value indicating whether optional checksum validation is required for Code 39 barcodes.
hBarReader | Handle of BarcodeReader object |
bSet bool | Boolean value |
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.
bool DTKBARAPI BarcodeReader_get_Code39HaveChecksum( |
| ) |
Gets the value indicating whether optional checksum validation is required for Code 39 barcodes.
hBarReader | Handle of BarcodeReader object |
Boolean value
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.
void DTKBARAPI BarcodeReader_set_Code93HaveChecksum( |
| ) |
Sets the value indicating whether optional checksum validation is required for Code 93 barcodes.
hBarReader | Handle of BarcodeReader object |
bSet bool | Boolean value |
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.
bool DTKBARAPI BarcodeReader_get_Code93HaveChecksum( |
| ) |
Gets the value indicating whether optional checksum validation is required for Code 93 barcodes.
hBarReader | Handle of BarcodeReader object |
Boolean value
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.
void DTKBARAPI BarcodeReader_set_Inter2of5HaveChecksum( |
| ) |
Sets the value indicating whether optional checksum validation is required for Interleaved 2of5 barcodes.
hBarReader | Handle of BarcodeReader object |
bSet bool | Boolean value |
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.
bool DTKBARAPI BarcodeReader_get_Inter2of5HaveChecksum( |
| ) |
Gets the value indicating whether optional checksum validation is required for Interleaved 2of5 barcodes.
hBarReader | Handle of BarcodeReader object |
Boolean value
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.
void DTKBARAPI BarcodeReader_set_Code39NoStartStop( |
| ) |
Sets the value indicating whether Code 39 barcodes have start/stop symbols
hBarReader | Handle of BarcodeReader object |
bSet bool | Boolean value |
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.
bool DTKBARAPI BarcodeReader_get_Code39NoStartStop( |
| ) |
Gets the value indicating whether Code 39 barcodes have start/stop symbols
hBarReader | Handle of BarcodeReader object |
Boolean value
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.
void DTKBARAPI BarcodeReader_set_ConvertUPCEtoUPCA( |
| ) |
Sets the value indicating whether the UPC-E barcode must be converted to UPC-A format.
hBarReader | Handle of BarcodeReader object |
bSet bool | Boolean value |
Default value is False.
bool DTKBARAPI BarcodeReader_get_ConvertUPCEtoUPCA( |
| ) |
Gets the value indicating whether the UPC-E barcode must be converted to UPC-A format.
hBarReader | Handle of BarcodeReader object |
Boolean value
Default value is False.
void DTKBARAPI BarcodeReader_set_Inter2of5MinDigitsCount( |
| ) |
Sets the minimum digits count in Interleaved 2of5 barcode
hBarReader | Handle of BarcodeReader object |
val int | Minimum digits count |
Default value is 6.
int DTKBARAPI BarcodeReader_get_Inter2of5MinDigitsCount( |
| ) |
Gets the minimum digits count in Interleaved 2of5 barcode
hBarReader | Handle of BarcodeReader object |
Minimum digits count in Interleaved 2of5 barcode
Default value is 6.
void DTKBARAPI BarcodeReader_set_Orientation( |
| ) |
Sets the expected orientation of the barcode.
hBarReader | Handle of BarcodeReader object |
orientation | one or a combination of BarcodeOrientationEnum enumeration values |
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.
BarcodeOrientationEnum DTKBARAPI BarcodeReader_get_Orientation( |
| ) |
Gets the expected orientation of the barcode.
hBarReader | Handle of BarcodeReader object |
One or a combination of BarcodeOrientationEnum enumeration values
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.
void DTKBARAPI BarcodeReader_set_ScanInterval( |
| ) |
Sets the image scanning interval.
hBarReader | Handle of BarcodeReader object |
scanInterval int | the image scanning interval in pixels. |
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.
int DTKBARAPI BarcodeReader_get_ScanInterval( |
| ) |
Gets the image scanning interval.
hBarReader | Handle of BarcodeReader object |
The image scanning interval in pixels.
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.
void DTKBARAPI BarcodeReader_set_QRCodeRequiredECCLevel( |
| ) |
Sets the required ECC level for QR Codes detection
hBarReader | Handle of BarcodeReader object |
eccLevel | one of QRCodeECCLevelEnum enumeration values |
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.
QRCodeECCLevelEnum DTKBARAPI BarcodeReader_get_QRCodeRequiredECCLevel( |
| ) |
Gets the required ECC level for QR Codes detection
hBarReader | Handle of BarcodeReader object |
One of QRCodeECCLevelEnum enumeration values
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.
void DTKBARAPI BarcodeReader_set_QuietZoneSize( |
| ) |
Sets the expected size of the quiet zone of the barcode.
hBarReader | Handle of BarcodeReader object |
quietZoneSize | one of QuietZoneSizeEnum enumeration values |
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.
QuietZoneSizeEnum DTKBARAPI BarcodeReader_get_QuietZoneSize( |
| ) |
Gets the expected size of the quiet zone of the barcode.
hBarReader | Handle of BarcodeReader object |
One of QuietZoneSizeEnum enumeration values
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.
void DTKBARAPI BarcodeReader_set_ScanRectangleX( |
| ) |
Sets the X coordinate of the scan rectangle
hBarReader | Handle of BarcodeReader object |
x int | X coordinate in pixels |
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.
int DTKBARAPI BarcodeReader_get_ScanRectangleX( |
| ) |
Gets the X coordinate of the scan rectangle
hBarReader | Handle of BarcodeReader object |
X coordinate in pixels
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
hBarReader | Handle of BarcodeReader object |
y | Y coordinate in pixels |
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.
int DTKBARAPI BarcodeReader_get_ScanRectangleY( |
| ) |
Gets the Y coordinate of the scan rectangle
hBarReader | Handle of BarcodeReader object |
Y coordinate in pixels
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.
void DTKBARAPI BarcodeReader_set_ScanRectangleWidth( |
| ) |
Sets the Width of the scan rectangle
hBarReader | Handle of BarcodeReader object |
width int | width in pixels |
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.
int DTKBARAPI BarcodeReader_get_ScanRectangleWidth( |
| ) |
Gets the Width of the scan rectangle
hBarReader | Handle of BarcodeReader object |
Width in pixels
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.
void DTKBARAPI BarcodeReader_set_ScanRectangleHeight( |
| ) |
Sets the Height of the scan rectangle
hBarReader | Handle of BarcodeReader object |
height int | height in pixels |
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.
int DTKBARAPI BarcodeReader_get_ScanRectangleHeight( |
| ) |
Gets the Height of the scan rectangle
hBarReader | Handle of BarcodeReader object |
Height in pixels
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.
void DTKBARAPI BarcodeReader_set_PDFReadingType( |
| ) |
Sets the reading type of PDF documents
hBarReader | Handle of BarcodeReader object |
pdfReadingType | PDFReadingTypeEnum enumeration value |
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.
PDFReadingTypeEnum DTKBARAPI BarcodeReader_get_PDFReadingType( |
| ) |
Gets the reading type of PDF documents
hBarReader | Handle of BarcodeReader object |
PDFReadingTypeEnum enumeration value
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.
void DTKBARAPI BarcodeReader_set_PDFRenderDPI( |
| ) |
Sets the DPI for PDF document pages rendering
hBarReader | Handle of BarcodeReader object |
dpi int | DPI value |
Default value is 300.
Used for PDFReadingType = PDF_Render
int DTKBARAPI BarcodeReader_get_PDFRenderDPI( |
| ) |
Gets the DPI for PDF document pages rendering
hBarReader | Handle of BarcodeReader object |
DPI value
Default value is 300.
Used for PDFReadingType = PDF_Render
int DTKBARAPI BarcodeReader_Preprocessing_Count( |
| ) |
Gets the number of preprocessing operations
hBarReader | Handle of BarcodeReader object |
Number of preprocessing operations
Default value is 0.
For more information, read Preprocessing Operations
void DTKBARAPI BarcodeReader_Preprocessing_Add( |
| ) |
Adds new preprocessing operations
hBarReader | Handle of BarcodeReader object |
op | PreprocessingEnum enumeration value |
param1 int | first parameter |
param2 int | second parameter |
For more information, read Preprocessing Operations
void DTKBARAPI BarcodeReader_Preprocessing_Get( |
| ) |
Gets preprocessing operation and its parameters by index
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 |
For more information, read Preprocessing Operations
void DTKBARAPI BarcodeReader_Preprocessing_Set( |
| ) |
Sets preprocessing operation and its parameters by index
hBarReader | Handle of BarcodeReader object |
index int | index of preprocessing operation |
op | PreprocessingEnum enumeration value |
param1 int | first parameter |
param2 int | second parameter |
For more information, read Preprocessing Operations
void DTKBARAPI BarcodeReader_Preprocessing_Remove( |
| ) |
Removes preprocessing operation by index
hBarReader | Handle of BarcodeReader object |
index int | index of preprocessing operation |
For more information, read Preprocessing Operations
void DTKBARAPI BarcodeReader_Preprocessing_Clear( |
| ) |
Removes all preprocessing operations
hBarReader | Handle of BarcodeReader object |
For more information, read Preprocessing Operations
int DTKBARAPI BarcodeReader_GetSettingsXml( |
| ) |
Gets an XML string of all settings for the BarcodeReader object
hBarReader | Handle of BarcodeReader object |
xmlBuffer char* | Pointer to string buffer that receives XML string |
xmlBufferSize int | Size of string buffer |
int DTKBARAPI BarcodeReader_SetSettingsXml( |
| ) |
Sets the BarcodeReader settings from an XML string
hBarReader | Handle of BarcodeReader object |
xml const char* | XML string |
Value 0 on success, or -1 if the xml string have a wrong structure
void DTKBARAPI Barcode_Destroy( |
| ) |
Gets the text of the detected barcode
hBarcode | Handle of Barcode object |
buffer | Pointer to a buffer that receives the barcode text |
bufferLen | Size of the string buffer |
Number of characters copied to buffer
int DTKBARAPI Barcode_get_BinaryData( |
| ) |
Gets the binary data of the detected barcode
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 |
Number of bytes copied to buffer
BarcodeTypeEnum DTKBARAPI Barcode_get_Type( |
| ) |
Gets the type of barcode
hBarcode | Handle of Barcode object |
BarcodeTypeEnum enumeration value
int DTKBARAPI Barcode_get_TypeString( |
| ) |
Gets the type of barcode as string
hBarcode | Handle of Barcode object |
buffer char* | Pointer to a string buffer that receives the barcode type |
bufferLen int | Size of the string buffer |
Number of characters copied to buffer
int DTKBARAPI Barcode_get_Page( |
| ) |
Gets the page number of the detected barcode
hBarcode | Handle of Barcode object |
Page number of the detected barcode
This property is only meaningful if you read barcodes from multi-page TIFF image or PDF document.
BarcodeOrientationEnum DTKBARAPI Barcode_get_Orientation( |
| ) |
Gets the orientation of recognized barcode
hBarcode | Handle of Barcode object |
BarcodeOrientationEnum enumeration value
int DTKBARAPI Barcode_get_Threshold( |
| ) |
Gets the threshold level that was used to detect this barcode.
hBarcode | Handle of Barcode object |
Threshold level
int DTKBARAPI Barcode_get_BorderStartX1( |
| ) |
Gets the X coordinate of the first point of start boundary of the barcode.
hBarcode | Handle of Barcode object |
X coordinate in pixels
See Barcode Location section for details.
int DTKBARAPI Barcode_get_BorderStartY1( |
| ) |
Gets the Y coordinate of the first point of start boundary of the barcode.
hBarcode | Handle of Barcode object |
Y coordinate in pixels
See Barcode Location section for details.
int DTKBARAPI Barcode_get_BorderStartX2( |
| ) |
Gets the X coordinate of the second point of start boundary of the barcode.
hBarcode | Handle of Barcode object |
X coordinate in pixels
See Barcode Location section for details.
int DTKBARAPI Barcode_get_BorderStartY2( |
| ) |
Gets the Y coordinate of the second point of start boundary of the barcode.
hBarcode | Handle of Barcode object |
Y coordinate in pixels
See Barcode Location section for details.
int DTKBARAPI Barcode_get_BorderEndX1( |
| ) |
Gets the X coordinate of the first point of end boundary of the barcode.
hBarcode | Handle of Barcode object |
X coordinate in pixels
See Barcode Location section for details.
int DTKBARAPI Barcode_get_BorderEndY1( |
| ) |
Gets the Y coordinate of the first point of end boundary of the barcode.
hBarcode | Handle of Barcode object |
Y coordinate in pixels
See Barcode Location section for details.
int DTKBARAPI Barcode_get_BorderEndX2( |
| ) |
Gets the X coordinate of the second point of end boundary of the barcode.
hBarcode | Handle of Barcode object |
X coordinate in pixels
See Barcode Location section for details.
int DTKBARAPI Barcode_get_BorderEndY2( |
| ) |
Gets the Y coordinate of the second point of end boundary of the barcode.
hBarcode | Handle of Barcode object |
Y coordinate in pixels
See Barcode Location section for details.
int DTKBARAPI Barcode_get_BoundingRectX( |
| ) |
Gets the X coordinate of the bounding rectangle of the barcode
hBarcode | Handle of Barcode object |
X coordinate in pixels
See Barcode Location section for details.
int DTKBARAPI Barcode_get_BoundingRectY( |
| ) |
Gets the Y coordinate of the bounding rectangle of the barcode
hBarcode | Handle of Barcode object |
Y coordinate in pixels
See Barcode Location section for details.
int DTKBARAPI Barcode_get_BoundingRectWidth( |
| ) |
Gets the width of the bounding rectangle of the barcode
hBarcode | Handle of Barcode object |
Width in pixels
See Barcode Location section for details.
int DTKBARAPI Barcode_get_BoundingRectHeight( |
| ) |
Gets the height of the bounding rectangle of the barcode
hBarcode | Handle of Barcode object |
Height in pixels
See Barcode Location section for details.
float DTKBARAPI Barcode_get_Angle( |
| ) |
Gets the skew angle of the detected barcode, in degrees.
hBarcode | Handle of Barcode object |
Angle in degrees
See Barcode Location section for details.
int DTKBARAPI Barcode_get_Checksum( |
| ) |
Gets the checksum of barcode
hBarcode | Handle of Barcode object |
Checksum value
This property applies to barcode with checksum.
int DTKBARAPI Barcode_get_Dim1( |
| ) |
Gets the first dimension of the recognized 2D barcode.
hBarcode | Handle of Barcode object |
First dimension of 2D barcode
This property only applies to Data Matrix and QR Code.
int DTKBARAPI Barcode_get_Dim2( |
| ) |
Gets the second dimension of the recognized 2D barcode.
hBarcode | Handle of Barcode object |
Second dimension of 2D barcode
This property only applies to Data Matrix and QR Code.
int DTKBARAPI Barcode_get_NumErrorsCorrected( |
| ) |
Gets the number of errors corrected when decoding a 2D barcode.
hBarcode | Handle of Barcode object |
Number of errors corrected
int DTKBARAPI Barcode_get_ErrorCorrectionLevel( |
| ) |
Gets the error correction level of the recognized 2D barcode.
hBarcode | Handle of Barcode object |
Error correction level
int DTKBARAPI Barcode_get_QRVersion( |
| ) |
Gets the version of recognized QR Code
hBarcode | Handle of Barcode object |
Version number
bool DTKBARAPI Barcode_get_RSSExpandedIsStacked( |
| ) |
Gets a value that indicates whether the RSS Expanded barcode is Stacked.
hBarcode | Handle of Barcode object |
Boolean value
void DTKBARAPI BarReaderResult_Destroy( |
| ) |
Destroy BarReaderResult object
hResult | Handle of BarReaderResult object |
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.
int DTKBARAPI BarReaderResult_get_BarcodesCount( |
| ) |
Get number of Barcode objects containing in BarReaderResult object
hResult | Handle of BarReaderResult object |
Number of Barcode objects
BARCODE DTKBARAPI BarReaderResult_get_Barcode( |
| ) |
Get Barcode object from BarReaderResult by it's index
hResult | Handle of BarReaderResult object |
index int | Index of Barcode object |
Handle of Barcode object
Each Barcode object from BarReaderResult must be destroyed using \ref Barcode_Destroy function
int DTKBARAPI BarReaderResult_get_ErrorCode( |
| ) |
Get error code
hResult | Handle of BarReaderResult object |
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
int DTKBARAPI BarcodeReader_ActivateLicenseOnline( |
| ) |
Activates license on-line
licenseKey const char* | String containing the license key |
comments const char* | String containing comments to assign to activation (optional) |
0 on success, error code otherwise
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.
int DTKBARAPI BarcodeReader_GetActivationLink( |
| ) |
Returns activation link to activate the defined license key
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 |
Number of bytes copied to buffer. If activationLink = NULL or size = 0, then function return number of bytes required for store result string
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.
int DTKBARAPI BarcodeReader_ActivateLicenseOffline( |
| ) |
Activates license on machine using activation code
activationCode const char* | String which contain activation code |
0 on success, error code otherwise
The optional comments parameter can be used to identify certain license activation, for example machine name or customer name can be used.
int DTKBARAPI BarcodeReader_GetSystemID( |
| ) |
Gets the current machine/system ID
system_id char* | Pointer to string buffer which receives current machine ID (fingerprint) |
system_id_size int | Size of string buffer |
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
void DTKBARAPI BarcodeReader_GetActivatedLicenseInfo( |
| ) |
Gets the information of the currently activated license: license key, comments, license type, expiration date (if applicable)
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 |
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 |
int DTKBARAPI BarcodeReader_GetLibraryVersion( |
| ) |
Return library version
buffer char* | Pointer to string buffer which receives library version |
buff_size int | Size of string buffer |
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
void* DTKBARAPI PDFOpenFromFile( |
| ) |
Opens PDF document
fileName const char* | File name |
password const char* | Password (optional) |
errorCode int* | Pointer to integer what receives error code |
Handle of PDF document
void* DTKBARAPI PDFOpenFromMemFile( |
| ) |
Opens PDF document from memory file
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 |
Handle of PDF document
void DTKBARAPI PDFClose( |
| ) |
Closes PDF document
hPDF void* | Handle of PDF document |
int DTKBARAPI PDFGetPagesCount( |
| ) |
Gets number of pages in PDF document
hPDF void* | Handle of PDF document |
Number of pages
int DTKBARAPI PDFGetPageImageBuffer( |
| ) |
Gets the image buffer of a rendered page of PDF document
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. |
Number of pages
You need to call PDFFreeImageBuffer with received pointer to free memory.
void DTKBARAPI PDFFreeImageBuffer( |
| ) |
Free image buffer
pImageBuffer void* | Pointer to image buffer |
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) |
// 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);