The J4L barcoding components for C++ family currently support the following symbologies:
The components can be used as DLL or compiled inside your own applications since the source code is provided. The components will compile on Windows and Linux using the GNU C++ compiler.
The components can produce two kind of outputs:
The J4L Barcode 1D C++ class includes the following 1D symbologies:
The product includes a small demo application which creates windows EMF files. The program is called 1dConsole.exe and supports the following options
example:
1DConsole.exe -code 123456 -type 13 -height 40 -file barcode.emf
will encode the value 123456 using the code128 symbology.
If you want to compile the source code together with your C++ application you can use the following code for creating a windows emf file:
J4LBarcode1D* m= new J4LBarcode1D();
m->code="123456";
m->barType=13; // code 128
m->processTilde=true;
m->checkCharacter=true;
m->paint();
Metafile* bmp= new Metafile();
string filename="output.emf";
const char* s=m->codeText.c_str();
bmp->write1DWithText(filename.c_str(),m->getWidthsArray(),m->getHeightsArray(),m->getArrayLength(),s,20,m->codeText.length());delete bmp;
delete m;
Data Matrix is a two-dimensional (2D) matrix symbology which is made up of square modules arranged within a perimeter finder pattern. It can encode up to 3116 characters from the entire 256 byte ASCII character set. The symbol consists of data regions which contain square modules set out in a regular array. Large ECC 200 symbols contain several regions. Each data region is delimited by a finder pattern, and this is surrounded on all four sides by a quiet zone border (margin).
ECC 200 symbols have an even number of rows and an even number of columns. Most of the symbols are square with sizes from 10 x 10 to 144 x 144. Some symbols however are rectangular with sizes from 8 x 18 to 16 x 48. All ECC 200 symbols can be recognized by the upper right corner module being light (binary 0).
ECC200 is the newest version of data matrix and supports advanced encoding error checking and correction algorithms (reed-solomon). This algorithms allow the recognition of barcodes that are up to 60% damaged.
The barcode supports two optional mechanisms:
RDataMatrix supports:
RDataMatrix supports all data matrix formats. The following table contains the size , the capacity and the correction error features of each format:
Size |
Numeric Capacity |
Alphanumeric capacity |
Binary capacity |
Max Correctable Error/Erasure |
10 x 10 |
6 |
3 |
1 |
2 |
12 x 12 | 10 | 6 | 3 | 3 |
14 x 14 | 16 | 10 | 6 | 5/7 |
16 x 16 | 24 | 16 | 10 | 6/9 |
18 x 18 |
36 |
25 |
16 |
7/11 |
20 x 20 | 44 | 31 | 20 | 9/15 |
22 x 22 |
60 |
43 |
28 |
10/17 |
24 x 24 |
72 |
52 |
34 |
12/21 |
26 x 26 |
88 |
64 |
42 |
14/25 |
32 x 32 | 124 | 91 | 60 | 18/33 |
36 x 36 | 172 | 127 | 84 | 21/39 |
40 x 40 | 228 | 169 | 112 | 24/45 |
44 x 44 | 288 | 214 | 142 | 28/53 |
48 x 48 | 348 | 259 | 172 | 34/65 |
52 x 52 | 408 | 304 | 202 | 42/78 |
64 x 64 | 560 | 418 | 278 | 56/106 |
72 x 72 | 736 | 550 | 366 | 72/132 |
80 x 80 | 912 | 682 | 454 | 96/180 |
88 x 88 | 1152 | 862 | 574 | 112/212 |
96 x 96 | 1392 | 1042 | 694 | 136/260 |
104 x 104 | 1632 | 1222 | 814 | 168/318 |
120 x 120 | 2100 | 1573 | 1048 | 204/390 |
132 x 132 | 2608 | 1954 | 1302 | 248/472 |
144 x 144 | 3116 | 2335 | 1556 | 310/590 |
8 x 18 | 10 | 6 | 3 | 3 |
8 x 32 | 20 | 13 | 8 | 5 |
12 x 26 | 32 | 22 | 14 | 7/11 |
12 x 36 | 44 | 31 | 20 | 9/15 |
16 x 36 | 64 | 46 | 30 | 12/21 |
16 x 48 | 98 | 72 | 47 | 14/25 |
The data represented in the symbol can be compressed using one or several of the following algorithms:
All encoding system can be used to encode any data, but for example, encoding binary data with C40 generates much more overhead (longer symbol) than with BASE256.
RDataMatrix uses the character ~ to recognize some special characters in the input data. The following possibilities are available:
The product includes a small demo application which creates BMP files. The program is called datamatrix.exe and supports the following options
example:
datamatrix.exe -file datamatrix.bmp -encoding 0 -format 0 -code 1234567890
will encode the value 1234567890 using ASCII encoding.
The DLL file datamatrix.dll has one entry point defined as:
void createDatamatrix(char format,char encoding,unsigned short int dataLen,char* data,char* file);
where:
The following Visual Basic 6.0 code shows how to call the DLL :
Private Declare Sub createDatamatrix Lib "datamatrix.dll" (ByVal format As Byte, ByVal encoding As Byte, ByVal datalen As Integer, FirstDataElement As Byte, name As Byte)
.......
Dim data(100) As Byte
Dim file(100) As Byte
Dim format As Byte
Dim encoding As Byte
Dim dataLen As Byte
Dim h As Integerfile(0) = Asc("c")
file(1) = Asc(":")
file(2) = Asc("\")
file(3) = Asc("a")
file(4) = Asc(".")
file(5) = Asc("b")
file(6) = Asc("m")
file(7) = Asc("p")
file(8) = 0dataLen = 100 ' encode 100 A
For h = 0 To i - 1
data(h) = Asc("A")
Nextformat = 1
encoding= 3 ' base265createDatamatrix format, encoding, i, data(0), file(0)
If you want to compile the source code together with your C++ application you can use the following code for creating a bmp file:
string filename="c:\\datamatrix.bmp";
RDatamatrix* m= new RDatamatrix();
m->codeBinary=d;
m->codeBinaryLength=dataLen;
m->encoding=3;
m->preferredFormat=0;m->paint();
// create now bmp file
bitmapfile* bmp= new bitmapfile();
bmp->write(filename,m->bitmap,m->rows,m->cols);delete bmp;
delete m;
if you want to read the datamatrix bitmap array instead of create a bmp file you must use:
m->getBitmapEntry(col,row);
where:
Datamatrix | |
Encoding
|
Value
|
ASCII
|
0
|
C40
|
1
|
TEXT
|
2
|
BASE256
|
3
|
AUTO
|
5
|
Datamatrix | |
Format
|
Value
|
C10x10
|
0
|
C12x12
|
1
|
C14x14
|
2
|
C16x16
|
3
|
C18x18
|
4
|
C20x20
|
5
|
C22x22
|
6
|
C24x24
|
7
|
C26x26
|
8
|
C32x32
|
9
|
C36x36
|
10
|
C40x40
|
11
|
C44x44
|
12
|
C48x48
|
13
|
C52x52
|
14
|
C64x64
|
15
|
C72x72
|
16
|
C80x80
|
17
|
C88x88
|
18
|
C96x96
|
19
|
C104x104
|
20
|
C120x120
|
21
|
C132x132
|
22
|
C144x144
|
23
|
C8x18
|
24
|
C8x32
|
25
|
C12x26
|
26
|
C12x36
|
27
|
C16x36
|
28
|
C16x48
|
29
|
PDF stands for “Portable Data File.” A two-dimensional symbology (2D), a single PDF417 symbol carries up to 1.1 kilobytes of machine-readable data in a space no larger than a standard bar code. And, unlike one-dimensional bar codes (1D), which are just a key linked to a database, PDF417 symbols contain the database itself. That means, you don't have to store an article number in the barcode but you can also store the name , the size , the color, the name of the manufacturer etc...
RPDF417 support:
The symbol has the following format:
where number of rows * number of columns must be <= 928.
Each symbol character is made of 17 modules, 4 bars and 4 space elements (bars), with the largest element 6 modules wide.
The maximum possible number of data characters per symbol (at error correction level 0) is:
The data represented in the symbol can be compressed using one or several of the following algorithms:
The product includes a small demo application which creates BMP files. The program is called pdf417.exe and supports the following options
example:
pdf417.exe -file pdf417.bmp -mode 0 -cols 10 -eclevel 3 -code 1234567890
will encode the value 1234567890 using BYTE encoding.
The DLL file pdf417.dll has one entry point defined as:
void createPDF417(char cols,char rows,char maxrows,char mode,char eclevel,unsigned short int dataLen,char* data,char* file)
where:
The following Visual Basic 6.0 code shows how to call the DLL :
Private Declare Sub createPDF417 Lib "pdf417.dll" (ByVal cols As Byte, ByVal rows As Byte, ByVal maxrows As Byte, ByVal mode As Byte, ByVal level As Byte, ByVal datalen As Integer, FirstDataElement As Byte, name As Byte)
.......
Dim data(100) As Byte
Dim file(100) As Byte
Dim dataLen As Byte
Dim h As Integer
file(0) = Asc("c")
file(1) = Asc(":")
file(2) = Asc("\")
file(3) = Asc("a")
file(4) = Asc(".")
file(5) = Asc("b")
file(6) = Asc("m")
file(7) = Asc("p")
file(8) = 0dataLen = 100 ' encode 100 A
For h = 0 To i - 1
data(h) = Asc("A")
Nextformat = 1
encoding= 0 ' BYTE
createPDF417 3, 3, 10, 0, 1, dataLen, data(0), file(0)
If you want to compile the source code together with your C++ application you can use the following code for creating a bmp file:
string filename="pdf417.bmp";
RPDF417* m= new RPDF417();
m->code="12345678901234567890123456789012345678901234567890";
m->PDFMode=2; //PDF_TEXT;
m->PDFColumns=3;
m->PDFMaxRows=10;
m->PDFECLevel=3;m->paint();
// create now bmp file
bitmapfile* bmp= new bitmapfile();bmp->write(filename,m->pixelbitmap,m->pixelbitmapHeight,m->pixelbitmapWidth);
delete bmp;
delete m;
if you want to read the datamatrix bitmap array instead of create a bmp file you must use:
m->getBitmapEntry(col,row);
This option allows to concatenate several PDF417 symbols in order to encode large amount of information. This is achieved by encoding several barcodes (segments) which include a Macro PDF 417 control header. The control header contains a file id field which is used to know which barcodes below together, and a segment number to know the sequence of the barcodes. There are other header fields, line sender, timestamp, filename ... which are optional.
You can use 2 approches:
PDF Modes | |
Mode
|
Value
|
Byte
|
0
|
Text
|
1
|
Numeric
|
2
|
QR Code is a matrix symbology which includes a finder pattern located at three corners of the symbol used to locate the symbol and figure out its size and orientation. The QRCode following features are supported
J4L-QRCode supports:
Table — Data capacity for QRCode versions
Version
|
Error
Correction Level
|
Numeric |
Alphanumeric |
Byte |
Kanji |
|
1 |
L |
41 |
25 |
17 |
10 |
|
2 |
L |
77 |
47 |
32 |
20 |
|
3 |
L |
127 |
77 |
53 |
32 |
|
4 |
L |
187 |
114 |
78 |
48 |
|
5 |
L |
255 |
154 |
106 |
65 |
|
6 |
L |
322 |
195 |
134 |
82 |
|
7 |
L |
370 |
224 |
154 |
95 |
|
8 |
L |
461 |
279 |
192 |
118 |
|
9 |
L |
552 |
335 |
230 |
141 |
|
10 |
L |
652 |
395 |
271 |
167 |
|
11 |
L |
772 |
468 |
321 |
198 |
|
12 |
L |
883 |
535 |
367 |
226 |
|
13 |
L |
1022 |
619 |
425 |
262 |
|
14 |
L |
1101 |
667 |
458 |
282 |
|
15 |
L |
1250 |
758 |
520 |
320 |
|
16 |
L |
1408 |
854 |
586 |
361 |
|
17 |
L |
1548 |
938 |
644 |
397 |
|
18 |
L |
1725 |
1046 |
718 |
442 |
|
19 |
L |
1903 |
1153 |
792 |
488 |
|
20 |
L |
2061 |
1249 |
858 |
528 |
|
21 |
L |
2232 |
1352 |
929 |
572 |
|
22 |
L |
2409 |
1460 |
1003 |
618 |
|
23 |
L |
2620 |
1588 |
1091 |
672 |
|
24 |
L |
2812 |
1704 |
1171 |
721 |
|
25 |
L |
3057 |
1853 |
1273 |
784 |
|
26 |
L |
3283 |
1990 |
1367 |
842 |
|
27 |
L |
3517 |
2132 |
1465 |
902 |
|
28 |
L |
3669 |
2223 |
1528 |
940 |
|
29 |
L |
3909 |
2369 |
1628 |
1002 |
|
30 |
L |
4158 |
2520 |
1732 |
1066 |
|
31 |
L |
4417 |
2677 |
1840 |
1132 |
|
32 |
L |
4686 |
2840 |
1952 |
1201 |
|
33 |
L |
4965 |
3009 |
2068 |
1273 |
|
34 |
L |
5253 |
3183 |
2188 |
1347 |
|
35 |
L |
5529 |
3351 |
2303 |
1417 |
|
36 |
L |
5836 |
3537 |
2431 |
1496 |
|
37 |
L |
6153 |
3729 |
2563 |
1577 |
|
38 |
L |
6479 |
3927 |
2699 |
1661 |
|
39 |
L |
6743 |
4087 |
2809 |
1729 |
|
40 |
L |
7089 |
4296 |
2953 |
1817 |
The data represented in the symbol can be compressed using one or several of the following algorithms:
J4L-QRCode uses the character ~ (tilde) to recognize some special characters in the input data:
The product includes a small demo application which creates BMP files. The program is called datamatrix.exe and supports the following options
example:
qrcode.exe -file qrcode.bmp -encoding 4 -format 0 -level 0 -code 1234567890
will encode the value 1234567890 using AUTO encoding.
The DLL file datamatrix.dll has one entry point defined as:
void createQRCode(char format,char encoding,char level,unsigned short int dataLen,char* data,char* file);
where:
The following Visual Basic 6.0 code shows how to call the DLL :
Private Declare Sub createQRCode Lib "qrcode.dll" (ByVal format As Byte, ByVal encoding As Byte, ByVal level as Byte, ByVal datalen As Integer, FirstDataElement As Byte, name As Byte)
.......
Dim data(100) As Byte
Dim file(100) As Byte
Dim format As Byte
Dim encoding As Byte
Dim level as Byte
Dim dataLen As Byte
Dim h As Integerfile(0) = Asc("c")
file(1) = Asc(":")
file(2) = Asc("\")
file(3) = Asc("a")
file(4) = Asc(".")
file(5) = Asc("b")
file(6) = Asc("m")
file(7) = Asc("p")
file(8) = 0dataLen = 100 ' encode 100 A
For h = 0 To i - dataLen
data(h) = Asc("A")
Nextformat = 1
level=0
encoding= 4' AUTOcreateQRCode format, encoding, level, dataLen, data(0), file(0)
If you want to compile the source code together with your C++ application you can use the following code for creating a bmp file:
string filename="c:\\qrcode.bmp";
QRCode* m= new QRCode();
m->setBinaryCode(data,dataLen); // where data is int*
m->encoding=encoding; // 4, AUTO, 3 Kanji, 2 numeric, 1 byte, 0 alpha
m->correctionLevel=level; // 0-L , 1-M, 2-Q , 3-H
m->preferredVersion=format; // 0 till 39
m->processTilde=false;
/* m->setFnc1Mode(2);
//strcutured append configuration
m->setStructuredAppend(true);
m->setStructuredAppendCounter(2);
m->setStructuredAppendIndex(1);*/
m->paint();
// create now bmp file
bitmapfile* bmp= new bitmapfile();
bmp->write(filename,m->bitmap,m->rows,m->cols);delete bmp;
delete m;
if you want to read the datamatrix bitmap array instead of create a bmp file you must use:
m->getBitmapEntry(col,row);
where:
QRCode | |
Encoding
|
Value
|
APLHA
|
0
|
BYTE
|
1
|
BINARY
|
2
|
KANJI
|
3
|
AUTO
|
4
|
QRCode | |
Error Correction Level
|
Value
|
L (7%)
|
0
|
M (15%)
|
1
|
Q (25%)
|
2
|
H (30%)
|
3
|
Aztec Code is a 2D matrix symbology made up of square modules on a square grid, with a square bullseye pattern at their center. Aztec Code symbols can encode large amounts of data with user defined error correction level.
The smallest format can encode 13 numeric , 12 alphabetic characters or 6 bytes of data, while the largest format can encode 3832 numeric ,3067 alphabetic characters or 1914 bytes of data.
Compact formats can be used to encode short messages in a more efficient manner than full range formats. Note that reader/decoder can autodiscrimanate between both formats.
There are also a set of 256 special formats called "Aztec runes" which can be used for encoding values 0 to 255 for special applications.
RAztecCode supports:
Available formats are:
Rows / columns (number of modules/squares) |
Capacity (digits)
|
Capacity (text)
|
Capacity (binary data)
|
CONFIGURATION_15X15_COMPACT |
13
|
12
|
6
|
CONFIGURATION_19X19 |
18
|
15
|
8
|
CONFIGURATION_19X19_COMPACT |
40
|
33
|
19
|
CONFIGURATION_23X23 |
49
|
40
|
24
|
CONFIGURATION_23X23_COMPACT |
70
|
57
|
33
|
CONFIGURATION_27X27 |
84
|
68
|
40
|
CONFIGURATION_27X27_COMPACT |
110
|
89
|
53
|
CONFIGURATION_31X31 |
128
|
104
|
62
|
CONFIGURATION_37X37 |
178
|
144
|
87
|
CONFIGURATION_41X41 |
232
|
187
|
114
|
CONFIGURATION_45X45 |
294
|
236
|
145
|
CONFIGURATION_49X49 |
362
|
291
|
179
|
CONFIGURATION_53X53 |
433
|
348
|
214
|
CONFIGURATION_57X57 |
516
|
414
|
256
|
CONFIGURATION_61X61 |
601
|
482
|
298
|
CONFIGURATION_67X67 |
691
|
554
|
343
|
CONFIGURATION_71X71 |
793
|
636
|
394
|
CONFIGURATION_75X75 |
896
|
896
|
446
|
CONFIGURATION_79X79 |
1008
|
808
|
502
|
CONFIGURATION_83X83 |
1123
|
900
|
559
|
CONFIGURATION_87X87 |
1246
|
998
|
621
|
CONFIGURATION_91X91 |
1378
|
1104
|
687
|
CONFIGURATION_95X95 |
1511
|
1210
|
753
|
CONFIGURATION_101X101 |
1653
|
1324
|
824
|
CONFIGURATION_105X105 |
1801
|
1442
|
898
|
CONFIGURATION_109X109 |
1956
|
1566
|
976
|
CONFIGURATION_113X113 |
2216
|
1694
|
1056
|
CONFIGURATION_117X117 |
2281
|
1826
|
1138
|
CONFIGURATION_121X121 |
2452
|
1963
|
1224
|
CONFIGURATION_125X125 |
2632
|
2107
|
1314
|
CONFIGURATION_131X131 |
2818
|
2256
|
1407
|
CONFIGURATION_135X135 |
3007
|
2407
|
1501
|
CONFIGURATION_139X139 |
3205
|
2565
|
1600
|
CONFIGURATION_143X143 |
3409
|
2728
|
1702
|
CONFIGURATION_147X147 |
3616
|
2894
|
1806
|
CONFIGURATION_151X151 |
3832
|
3067
|
1914
|
The data represented in the symbol can be compressed using one of the following algorithms:
J4L-Aztec uses the character ~ to recognize some special characters in the input data (if the processTilde option has been activated). The following possibilities are available:
The product includes a small demo application which creates BMP files. The program is called aztec.exe and supports the following options
example:
aztec.exe -file aztec.bmp -encoding 0 -format 0 -level 23 -code 1234567890
will encode the value 1234567890 using NORMAL encoding.
The DLL file aztec.dll has one entry point defined as:
void createAztec(char format,char encoding, char level ,unsigned short int dataLen,char* data,char* file);
where:
The following Visual Basic 6.0 code shows how to call the DLL :
Private Declare Sub createAztec Lib "aztec.dll" (ByVal format As Byte, ByVal encoding As Byte, ByVal level as Byte, ByVal datalen As Integer, FirstDataElement As Byte, name As Byte)
.......
Dim data(100) As Byte
Dim file(100) As Byte
Dim format As Byte
Dim encoding As Byte
Dim level as Byte
Dim dataLen As Byte
Dim h As Integerfile(0) = Asc("c")
file(1) = Asc(":")
file(2) = Asc("\")
file(3) = Asc("a")
file(4) = Asc(".")
file(5) = Asc("b")
file(6) = Asc("m")
file(7) = Asc("p")
file(8) = 0dataLen = 100 ' encode 100 A
For h = 0 To dataLen- 1
data(h) = Asc("A")
Nextformat = 0
level=23
encoding= 0createAztec format, encoding, level, dataLen, data(0), file(0)
If you want to compile the source code together with your C++ application you can use the following code for creating a bmp file:
string filename="c:\\aztec.bmp";
Aztec* m= new Aztec();
m->setBinaryCode(d,dataLen);
m->setEncoding(1); // 0 normal , 1 binary
m->setPreferredConfiguration(0);
m->setAutoConfigurate(true);
m->setConfigurationType(0); // 0 any, 1 compact, 2 full
m->setProcessTilde(false);
// configuration for structured append
/*m->setStructuredAppend(true);
m->setStructuredAppendCounter(2);
m->setStructuredAppendIndex(1);
m->setFileId("ABC");*/m->paint();
// create now bmp file
bitmapfile* bmp= new bitmapfile();
bmp->write(filename,m->bitmap,m->rows,m->cols);delete bmp;
delete m;
if you want to read the datamatrix bitmap array instead of create a bmp file you must use:
m->getBitmapEntry(col,row);
where:
Aztec | |
Encoding
|
Value
|
NORMAL
|
0
|
BINARY
|
1
|