Programming with LEADTOOLS Barcode
LEADTOOLS supports the reading and writing of several major types of barcodes using the AxtelÓ engine. These types are:
Linear barcodes (1D)
PDF417 (2D)
Data Matrix (2D)
QR
For each major type of barcode, one or more subtypes are supported for both reading and writing. These subtypes are:
Linear Barcodes
EAN 13
EAN 8
UPC A
Code 3 of 9
Code 128
Interleaved 2 of 5
CODABAR
UCCEAN 128
PDF Barcodes
PDF417
Data Matrix
BARCODE_DM_DEF
BARCODE_DM_10x10
BARCODE_DM_12x12
BARCODE_DM_14x14
BARCODE_DM_16x16
BARCODE_DM_18x18
BARCODE_DM_20x20
BARCODE_DM_22x22
BARCODE_DM_24x24
BARCODE_DM_26x26
BARCODE_DM_32x32
BARCODE_DM_36x36
BARCODE_DM_40x40
BARCODE_DM_44x44
BARCODE_DM_48x48
BARCODE_DM_52x52
BARCODE_DM_64x64
BARCODE_DM_72x72
BARCODE_DM_80x80
BARCODE_DM_88x88
BARCODE_DM_96x96
BARCODE_DM_104x104
BARCODE_DM_120x120
BARCODE_DM_132x132
BARCODE_DM_144x144
BARCODE_DM_8x18
BARCODE_DM_8x32
BARCODE_DM_12x26
BARCODE_DM_12x36
BARCODE_DM_16x36
BARCODE_DM_16x48
BARCODE_DM_WRITE_RECTANGLE
QR
BARCODE_QR_DEF
BARCODE_QR_M2_1
BARCODE_QR_M2_2
BARCODE_QR_M2_3
BARCODE_QR_M2_4
BARCODE_QR_M2_5
BARCODE_QR_M2_6
BARCODE_QR_M2_7
BARCODE_QR_M2_8
BARCODE_QR_M2_9
BARCODE_QR_M2_10
BARCODE_QR_M2_11
BARCODE_QR_M2_12
BARCODE_QR_M2_13
BARCODE_QR_M2_14
BARCODE_QR_M2_15
BARCODE_QR_M2_16
BARCODE_QR_M2_17
BARCODE_QR_M2_18
BARCODE_QR_M2_19
BARCODE_QR_M2_20
BARCODE_QR_M2_21
BARCODE_QR_M2_22
BARCODE_QR_M2_23
BARCODE_QR_M2_24
BARCODE_QR_M2_25
BARCODE_QR_M2_26
BARCODE_QR_M2_27
BARCODE_QR_M2_28
BARCODE_QR_M2_29
BARCODE_QR_M2_30
BARCODE_QR_M2_31
BARCODE_QR_M2_32
BARCODE_QR_M2_33
BARCODE_QR_M2_34
BARCODE_QR_M2_35
BARCODE_QR_M2_36
BARCODE_QR_M2_37
BARCODE_QR_M2_38
BARCODE_QR_M2_39
BARCODE_QR_M2_40
BARCODE_QR_M1_1
BARCODE_QR_M1_2
BARCODE_QR_M1_3
BARCODE_QR_M1_4
BARCODE_QR_M1_5
BARCODE_QR_M1_6
BARCODE_QR_M1_7
BARCODE_QR_M1_8
BARCODE_QR_M1_9
BARCODE_QR_M1_10
BARCODE_QR_M1_11
BARCODE_QR_M1_12
BARCODE_QR_M1_13
BARCODE_QR_M1_14
BARCODE_QR_M1_DEF
LEADTOOLS supports the reading and writing of the above barcode types for all bitmaps currently supported by LEADTOOLS. For a full list of supported file formats, refer to Summary of All Supported Image File Formats.
Before using any of the functions for reading or writing barcodes, or finding duplicate barcodes, the Barcode DLLs must be loaded and the engine initialized by calling L_BarCodeInit. The barcode functions described below can then be used. Before terminating the application however, L_BarCodeExit must be called to close the engine and free the DLLs.
LEADTOOLS provides one function for recognizing barcodes in the bitmap, and another function for writing the barcode to the bitmap.
You can use the L_BarCodeRead function, to search for barcodes in the bitmap. This function can recognize one or more barcodes in the bitmap with suitable function parameters. To write linear, Data matrix or PDF barcode symbols, use the L_BarCodeWriteExt function. To write these barcode symbols and QR barcode symbols, use L_BarCodeWriteExt2. Use the L_BarCodeVersionInfo function to get the Barcode product information.
You can read/write barcodes by specifying a color for bars and space. Also, you can write transparent barcode, but the transparent feature is not recommended.
In addition to the Barcode functions given above, there are a number of functions for getting duplicated barcodes. These are as follows: L_BarCodeIsDuplicated, L_BarCodeGetDuplicated, L_BarCodeGetFirstDuplicated and L_BarCodeGetNextDuplicated.
If you want to change the duplicated barcode, you must change the nSizeofBarCodeData, and pszBarCodeData members of BARCODEDATA structure.
To retrieve information about a barcode, use the L_BarCodeVersionInfo.
When the array of structures allocated by L_BarCodeRead is no longer needed, the memory should be freed using L_BarCodeFree.