File: manual.html

package info (click to toggle)
zint 2.15.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 23,016 kB
  • sloc: ansic: 133,002; cpp: 8,153; php: 1,846; sh: 1,304; python: 307; makefile: 207; tcl: 74
file content (9569 lines) | stat: -rw-r--r-- 444,224 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
9530
9531
9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567
9568
9569
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
<head>
  <meta charset="utf-8" />
  <meta name="generator" content="pandoc" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
  <meta name="author" content="Version 2.15.0" />
  <title>Zint Barcode Generator and Zint Barcode Studio User Manual</title>
  <style>
    html {
      font-family: TeX Gyre Pagella;
      color: #1a1a1a;
      background-color: #ffffff;
    }
    body {
      line-height: 1.2;
      margin: 0 auto;
      max-width: 50em;
      padding-left: 50px;
      padding-right: 50px;
      padding-top: 50px;
      padding-bottom: 50px;
      hyphens: auto;
      overflow-wrap: break-word;
      text-rendering: optimizeLegibility;
      font-kerning: normal;
    }
    @media (max-width: 600px) {
      body {
        font-size: 0.9em;
        padding: 12px;
      }
      h1 {
        font-size: 1.8em;
      }
    }
    @media print {
      html {
        background-color: white;
      }
      body {
        background-color: transparent;
        color: black;
        font-size: 12pt;
      }
      p, h2, h3 {
        orphans: 3;
        widows: 3;
      }
      h2, h3, h4 {
        page-break-after: avoid;
      }
    }
    p {
      margin: 1em 0;
    }
    a {
      color: #800000;
    }
    a:visited {
      color: #800000;
    }
    a:not(:hover) {
      text-decoration: none;
    }
    figure {
      margin-left: 0;
      margin-right: 0;
      text-align: center;
    }
    img {
      max-width: 100%;
    }
    img.btn {
      height: 0.9em;
    }
    img.win {
      max-width: 80%;
    }
    img.pop {
      max-width: 60%;
    }
    img[src*="gui_set_printing_scale.png"] {
      max-width: 50%;
    }
    img.lin {
      max-height: 10em;
    }
    img[src*="code128_rotate90.svg"] {
      max-height: 20em;
    }
    img.i2d {
      max-height: 10em;
    }
    img[src*="upnqr.svg"] {
      max-height: 20em;
    }
    img.i2dbig {
    }
    img.trk {
      max-height: 3em;
    }
    img[src*="fim.svg"] {
      max-height: 10em;
    }
    img.dotty {
      max-height: 7em;
    }
    img.ultra {
      max-height: 12em;
    }
    img.upcean {
      max-height: 12em;
    }
    h1, h2, h3, h4, h5, h6 {
      margin-top: 1.4em;
    }
    h5, h6 {
      font-size: 1em;
      font-style: italic;
    }
    h6 {
      font-weight: normal;
    }
    ol, ul {
      padding-left: 1.7em;
      margin-top: 1em;
    }
    li > ol, li > ul {
      margin-top: 0;
    }
    dt {
      font-weight:bold;
    }
    blockquote {
      margin: 1em 0 1em 1.7em;
      padding-left: 1em;
      border-left: 2px solid #e6e6e6;
      color: #606060;
    }
    code {
      font-family: Liberation Mono;
      font-size: 90%;
      margin: 0;
      hyphens: manual;
      color: #000000;
    }
    pre {
      margin: 1em 0;
      overflow: auto;
    }
    pre code {
      padding: 0;
      overflow: visible;
      overflow-wrap: normal;
    }
    .sourceCode {
     background-color: transparent;
     overflow: visible;
    }
    div.sourceCode {
      background-color: #f7f7f7;
      padding: 0.3em 0;
    }
    aside.footnotes {
      font-size:90%;
    }
    hr {
      background-color: #1a1a1a;
      border: none;
      height: 1px;
      margin: 1em 0;
    }
    table {
      margin: 0 auto 0.4em auto;
      border-collapse: collapse;
      overflow-x: auto;
      font-variant-numeric: lining-nums tabular-nums;
    }
    #tbl\:gridmatrix_eccs {
      margin-top: 1em;
    }
    table caption {
      margin-bottom: 0.75em;
    }
    tbody {
      margin-top: 0.5em;
      border-top: 1px solid #1a1a1a;
      border-bottom: 1px solid #1a1a1a;
    }
    th {
      border-top: 1px solid #1a1a1a;
      padding: 0.25em 0.5em 0.25em 0.5em;
    }
    td {
      padding: 0.125em 0.5em 0.25em 0.5em;
      vertical-align: top;
    }
    tbody tr:first-child td {
      padding-top: 0.5em;
    }
    thead > tr {
      margin-bottom: 4em;
      text-align: center;
    }
    #banner {
      text-align: center;
    }
    #banner img.img_hdr {
      height: 7em;
    }
    #TOC {
      font-size: 115%;
    }
    #TOC li {
      list-style: none;
      margin-bottom: 0.1em;
      margin-top: 0.2em;
    }
    #TOC ul {
      padding-left: 1.3em;
    }
    #TOC > ul {
      padding-left: 0;
    }
    #TOC > ul > li {
      margin-top: 0.5em;
    }
    #TOC > ul > li > a {
      font-weight: bold;
    }
    #TOC a:not(:hover) {
      color: #1a1a1a;
      text-decoration: none;
    }
    dd > p {
      margin-bottom:1.5em;
      margin-top:0.5em;
    }
    #exit-status + dl > dt {
      float: left;
    }
    #exit-status + dl > dd {
      margin-bottom: 1em;
    }

    code{white-space: pre-wrap;}
    span.smallcaps{font-variant: small-caps;}
    div.columns{display: flex; gap: min(4vw, 1.5em);}
    div.column{flex: auto; overflow-x: auto;}
    div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
    /* The extra [class] is a hack that increases specificity enough to
       override a similar rule in reveal.js */
    ul.task-list[class]{list-style: none;}
    ul.task-list li input[type="checkbox"] {
      font-size: inherit;
      width: 0.8em;
      margin: 0 0.8em 0.2em -1.6em;
      vertical-align: middle;
    }
    .display.math{display: block; text-align: center; margin: 0.5rem auto;}
    /* CSS for syntax highlighting */
    html { -webkit-text-size-adjust: 100%; }
    pre > code.sourceCode { white-space: pre; position: relative; }
    pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
    pre > code.sourceCode > span:empty { height: 1.2em; }
    .sourceCode { overflow: visible; }
    code.sourceCode > span { color: inherit; text-decoration: inherit; }
    div.sourceCode { margin: 1em 0; }
    pre.sourceCode { margin: 0; }
    @media screen {
    div.sourceCode { overflow: auto; }
    }
    @media print {
    pre > code.sourceCode { white-space: pre-wrap; }
    pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
    }
    pre.numberSource code
      { counter-reset: source-line 0; }
    pre.numberSource code > span
      { position: relative; left: -4em; counter-increment: source-line; }
    pre.numberSource code > span > a:first-child::before
      { content: counter(source-line);
        position: relative; left: -1em; text-align: right; vertical-align: baseline;
        border: none; display: inline-block;
        -webkit-touch-callout: none; -webkit-user-select: none;
        -khtml-user-select: none; -moz-user-select: none;
        -ms-user-select: none; user-select: none;
        padding: 0 4px; width: 4em;
        color: #aaaaaa;
      }
    pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa;  padding-left: 4px; }
    div.sourceCode
      {   }
    @media screen {
    pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
    }
    code span.al { color: #ff0000; } /* Alert */
    code span.an { color: #008000; } /* Annotation */
    code span.at { } /* Attribute */
    code span.bu { } /* BuiltIn */
    code span.cf { color: #0000ff; } /* ControlFlow */
    code span.ch { color: #008080; } /* Char */
    code span.cn { } /* Constant */
    code span.co { color: #008000; } /* Comment */
    code span.cv { color: #008000; } /* CommentVar */
    code span.do { color: #008000; } /* Documentation */
    code span.er { color: #ff0000; font-weight: bold; } /* Error */
    code span.ex { } /* Extension */
    code span.im { } /* Import */
    code span.in { color: #008000; } /* Information */
    code span.kw { color: #0000ff; } /* Keyword */
    code span.op { } /* Operator */
    code span.ot { color: #ff4000; } /* Other */
    code span.pp { color: #ff4000; } /* Preprocessor */
    code span.sc { color: #008080; } /* SpecialChar */
    code span.ss { color: #008080; } /* SpecialString */
    code span.st { color: #008080; } /* String */
    code span.va { } /* Variable */
    code span.vs { color: #008080; } /* VerbatimString */
    code span.wa { color: #008000; font-weight: bold; } /* Warning */
  </style>
  <!--[if lt IE 9]>
    <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
  <![endif]-->
</head>
<body>
<div id="banner">
<img src="images/zint.png" class="img_hdr">
<img src="images/zint-qt.png" class="img_hdr">
</div>
<header id="title-block-header">
<h1 class="title">Zint Barcode Generator and Zint Barcode Studio User
Manual</h1>
<p class="author">Version 2.15.0</p>
<p class="date">February 2025</p>
</header>
<nav id="TOC" role="doc-toc">
<ul>
<li><a href="#introduction" id="toc-introduction">1. Introduction</a>
<ul>
<li><a href="#glossary" id="toc-glossary">1.1 Glossary</a></li>
</ul></li>
<li><a href="#installing-zint" id="toc-installing-zint">2. Installing
Zint</a>
<ul>
<li><a href="#linux" id="toc-linux">2.1 Linux</a></li>
<li><a href="#bsd" id="toc-bsd">2.2 BSD</a></li>
<li><a href="#microsoft-windows" id="toc-microsoft-windows">2.3
Microsoft Windows</a></li>
<li><a href="#apple-macos" id="toc-apple-macos">2.4 Apple macOS</a></li>
<li><a href="#zint-tcl-backend" id="toc-zint-tcl-backend">2.5 Zint Tcl
Backend</a></li>
</ul></li>
<li><a href="#using-zint-barcode-studio"
id="toc-using-zint-barcode-studio">3. Using Zint Barcode Studio</a>
<ul>
<li><a href="#main-window-and-data-tab"
id="toc-main-window-and-data-tab">3.1 Main Window and Data Tab</a></li>
<li><a href="#gs1-composite-groupbox"
id="toc-gs1-composite-groupbox">3.2 GS1 Composite Groupbox</a></li>
<li><a href="#additional-ecidata-segments-groupbox"
id="toc-additional-ecidata-segments-groupbox">3.3 Additional ECI/Data
Segments Groupbox</a></li>
<li><a href="#symbology-specific-groupbox"
id="toc-symbology-specific-groupbox">3.4 Symbology-specific
Groupbox</a></li>
<li><a href="#symbology-specific-tab"
id="toc-symbology-specific-tab">3.5 Symbology-specific Tab</a></li>
<li><a href="#appearance-tab" id="toc-appearance-tab">3.6 Appearance
Tab</a></li>
<li><a href="#data-dialog" id="toc-data-dialog">3.7 Data Dialog</a></li>
<li><a href="#sequence-dialog" id="toc-sequence-dialog">3.8 Sequence
Dialog</a></li>
<li><a href="#export-dialog" id="toc-export-dialog">3.9 Export
Dialog</a></li>
<li><a href="#cli-equivalent-dialog" id="toc-cli-equivalent-dialog">3.10
CLI Equivalent Dialog</a></li>
</ul></li>
<li><a href="#using-the-command-line" id="toc-using-the-command-line">4.
Using the Command Line</a>
<ul>
<li><a href="#inputting-data" id="toc-inputting-data">4.1 Inputting
Data</a></li>
<li><a href="#directing-output" id="toc-directing-output">4.2 Directing
Output</a></li>
<li><a href="#selecting-barcode-type"
id="toc-selecting-barcode-type">4.3 Selecting Barcode Type</a></li>
<li><a href="#adjusting-height" id="toc-adjusting-height">4.4 Adjusting
Height</a></li>
<li><a href="#adjusting-whitespace" id="toc-adjusting-whitespace">4.5
Adjusting Whitespace</a></li>
<li><a href="#adding-boundary-bars-and-boxes"
id="toc-adding-boundary-bars-and-boxes">4.6 Adding Boundary Bars and
Boxes</a></li>
<li><a href="#using-colour" id="toc-using-colour">4.7 Using
Colour</a></li>
<li><a href="#rotating-the-symbol" id="toc-rotating-the-symbol">4.8
Rotating the Symbol</a></li>
<li><a href="#adjusting-image-size-x-dimension"
id="toc-adjusting-image-size-x-dimension">4.9 Adjusting Image Size
(X-dimension)</a>
<ul>
<li><a href="#scaling-by-x-dimension-and-resolution"
id="toc-scaling-by-x-dimension-and-resolution">4.9.1 Scaling by
X-dimension and Resolution</a></li>
<li><a href="#scaling-example" id="toc-scaling-example">4.9.2 Scaling
Example</a></li>
<li><a href="#maxicode-raster-scaling"
id="toc-maxicode-raster-scaling">4.9.3 MaxiCode Raster Scaling</a></li>
</ul></li>
<li><a href="#human-readable-text-hrt-options"
id="toc-human-readable-text-hrt-options">4.10 Human Readable Text (HRT)
Options</a></li>
<li><a href="#input-modes" id="toc-input-modes">4.11 Input Modes</a>
<ul>
<li><a href="#unicode-data-and-gs1-modes"
id="toc-unicode-data-and-gs1-modes">4.11.1 Unicode, Data, and GS1
Modes</a></li>
<li><a href="#input-modes-and-eci" id="toc-input-modes-and-eci">4.11.2
Input Modes and ECI</a>
<ul>
<li><a href="#input-modes-and-eci-example-1"
id="toc-input-modes-and-eci-example-1">4.11.2.1 Input Modes and ECI
Example 1</a></li>
<li><a href="#input-modes-and-eci-example-2"
id="toc-input-modes-and-eci-example-2">4.11.2.2 Input Modes and ECI
Example 2</a></li>
<li><a href="#input-modes-and-eci-example-3"
id="toc-input-modes-and-eci-example-3">4.11.2.3 Input Modes and ECI
Example 3</a></li>
</ul></li>
</ul></li>
<li><a href="#batch-processing" id="toc-batch-processing">4.12 Batch
Processing</a></li>
<li><a href="#direct-output-to-stdout"
id="toc-direct-output-to-stdout">4.13 Direct Output to stdout</a></li>
<li><a href="#automatic-filenames" id="toc-automatic-filenames">4.14
Automatic Filenames</a></li>
<li><a href="#working-with-dots" id="toc-working-with-dots">4.15 Working
with Dots</a></li>
<li><a href="#multiple-segments" id="toc-multiple-segments">4.16
Multiple Segments</a></li>
<li><a href="#structured-append" id="toc-structured-append">4.17
Structured Append</a></li>
<li><a href="#help-options" id="toc-help-options">4.18 Help
Options</a></li>
<li><a href="#other-options" id="toc-other-options">4.19 Other
Options</a></li>
</ul></li>
<li><a href="#using-the-api" id="toc-using-the-api">5. Using the API</a>
<ul>
<li><a href="#creating-and-deleting-symbols"
id="toc-creating-and-deleting-symbols">5.1 Creating and Deleting
Symbols</a></li>
<li><a href="#encoding-and-saving-to-file"
id="toc-encoding-and-saving-to-file">5.2 Encoding and Saving to
File</a></li>
<li><a href="#encoding-and-printing-functions-in-depth"
id="toc-encoding-and-printing-functions-in-depth">5.3 Encoding and
Printing Functions in Depth</a></li>
<li><a href="#buffering-symbols-in-memory-raster"
id="toc-buffering-symbols-in-memory-raster">5.4 Buffering Symbols in
Memory (raster)</a></li>
<li><a href="#buffering-symbols-in-memory-vector"
id="toc-buffering-symbols-in-memory-vector">5.5 Buffering Symbols in
Memory (vector)</a></li>
<li><a href="#buffering-symbols-in-memory-memfile"
id="toc-buffering-symbols-in-memory-memfile">5.6 Buffering Symbols in
Memory (memfile)</a></li>
<li><a href="#setting-options" id="toc-setting-options">5.7 Setting
Options</a></li>
<li><a href="#handling-errors" id="toc-handling-errors">5.8 Handling
Errors</a></li>
<li><a href="#specifying-a-symbology"
id="toc-specifying-a-symbology">5.9 Specifying a Symbology</a></li>
<li><a href="#adjusting-output-options"
id="toc-adjusting-output-options">5.10 Adjusting Output Options</a></li>
<li><a href="#setting-the-input-mode"
id="toc-setting-the-input-mode">5.11 Setting the Input Mode</a></li>
<li><a href="#multiple-segments-1" id="toc-multiple-segments-1">5.12
Multiple Segments</a></li>
<li><a href="#scaling-helpers" id="toc-scaling-helpers">5.13 Scaling
Helpers</a></li>
<li><a href="#verifying-symbology-availability"
id="toc-verifying-symbology-availability">5.14 Verifying Symbology
Availability</a></li>
<li><a href="#checking-symbology-capabilities"
id="toc-checking-symbology-capabilities">5.15 Checking Symbology
Capabilities</a></li>
<li><a href="#zint-version" id="toc-zint-version">5.16 Zint
Version</a></li>
</ul></li>
<li><a href="#types-of-symbology" id="toc-types-of-symbology">6. Types
of Symbology</a>
<ul>
<li><a href="#one-dimensional-symbols"
id="toc-one-dimensional-symbols">6.1 One-Dimensional Symbols</a>
<ul>
<li><a href="#code-11" id="toc-code-11">6.1.1 Code 11</a></li>
<li><a href="#code-2-of-5" id="toc-code-2-of-5">6.1.2 Code 2 of 5</a>
<ul>
<li><a href="#standard-code-2-of-5"
id="toc-standard-code-2-of-5">6.1.2.1 Standard Code 2 of 5</a></li>
<li><a href="#iata-code-2-of-5" id="toc-iata-code-2-of-5">6.1.2.2 IATA
Code 2 of 5</a></li>
<li><a href="#industrial-code-2-of-5"
id="toc-industrial-code-2-of-5">6.1.2.3 Industrial Code 2 of 5</a></li>
<li><a href="#interleaved-code-2-of-5-iso-16390"
id="toc-interleaved-code-2-of-5-iso-16390">6.1.2.4 Interleaved Code 2 of
5 (ISO 16390)</a></li>
<li><a href="#code-2-of-5-data-logic"
id="toc-code-2-of-5-data-logic">6.1.2.5 Code 2 of 5 Data Logic</a></li>
<li><a href="#itf-14" id="toc-itf-14">6.1.2.6 ITF-14</a></li>
<li><a href="#deutsche-post-leitcode"
id="toc-deutsche-post-leitcode">6.1.2.7 Deutsche Post Leitcode</a></li>
<li><a href="#deutsche-post-identcode"
id="toc-deutsche-post-identcode">6.1.2.8 Deutsche Post
Identcode</a></li>
</ul></li>
<li><a href="#upc-universal-product-code-iso-15420"
id="toc-upc-universal-product-code-iso-15420">6.1.3 UPC (Universal
Product Code) (ISO 15420)</a>
<ul>
<li><a href="#upc-version-a" id="toc-upc-version-a">6.1.3.1 UPC Version
A</a></li>
<li><a href="#upc-version-e" id="toc-upc-version-e">6.1.3.2 UPC Version
E</a></li>
</ul></li>
<li><a href="#ean-european-article-number-iso-15420"
id="toc-ean-european-article-number-iso-15420">6.1.4 EAN (European
Article Number) (ISO 15420)</a>
<ul>
<li><a href="#ean-2-ean-5-ean-8-and-ean-13"
id="toc-ean-2-ean-5-ean-8-and-ean-13">6.1.4.1 EAN-2, EAN-5, EAN-8 and
EAN-13</a></li>
<li><a href="#sbn-isbn-and-isbn-13"
id="toc-sbn-isbn-and-isbn-13">6.1.4.2 SBN, ISBN and ISBN-13</a></li>
</ul></li>
<li><a href="#plessey" id="toc-plessey">6.1.5 Plessey</a>
<ul>
<li><a href="#uk-plessey" id="toc-uk-plessey">6.1.5.1 UK
Plessey</a></li>
<li><a href="#msi-plessey" id="toc-msi-plessey">6.1.5.2 MSI
Plessey</a></li>
</ul></li>
<li><a href="#telepen" id="toc-telepen">6.1.6 Telepen</a>
<ul>
<li><a href="#telepen-alpha" id="toc-telepen-alpha">6.1.6.1 Telepen
Alpha</a></li>
<li><a href="#telepen-numeric" id="toc-telepen-numeric">6.1.6.2 Telepen
Numeric</a></li>
</ul></li>
<li><a href="#code-39" id="toc-code-39">6.1.7 Code 39</a>
<ul>
<li><a href="#standard-code-39-iso-16388"
id="toc-standard-code-39-iso-16388">6.1.7.1 Standard Code 39 (ISO
16388)</a></li>
<li><a href="#extended-code-39" id="toc-extended-code-39">6.1.7.2
Extended Code 39</a></li>
<li><a href="#code-93" id="toc-code-93">6.1.7.3 Code 93</a></li>
<li><a href="#pzn-pharmazentralnummer"
id="toc-pzn-pharmazentralnummer">6.1.7.4 PZN
(Pharmazentralnummer)</a></li>
<li><a href="#logmars" id="toc-logmars">6.1.7.5 LOGMARS</a></li>
<li><a href="#code-32" id="toc-code-32">6.1.7.6 Code 32</a></li>
<li><a href="#hibc-code-39" id="toc-hibc-code-39">6.1.7.7 HIBC Code
39</a></li>
<li><a href="#vehicle-identification-number-vin"
id="toc-vehicle-identification-number-vin">6.1.7.8 Vehicle
Identification Number (VIN)</a></li>
</ul></li>
<li><a href="#codabar-en-798" id="toc-codabar-en-798">6.1.8 Codabar (EN
798)</a></li>
<li><a href="#pharmacode-one-track" id="toc-pharmacode-one-track">6.1.9
Pharmacode One-Track</a></li>
<li><a href="#code-128" id="toc-code-128">6.1.10 Code 128</a>
<ul>
<li><a href="#standard-code-128-iso-15417"
id="toc-standard-code-128-iso-15417">6.1.10.1 Standard Code 128 (ISO
15417)</a></li>
<li><a href="#code-128-suppress-code-set-c-code-sets-a-and-b-only"
id="toc-code-128-suppress-code-set-c-code-sets-a-and-b-only">6.1.10.2
Code 128 Suppress Code Set C (Code Sets A and B only)</a></li>
<li><a href="#gs1-128" id="toc-gs1-128">6.1.10.3 GS1-128</a></li>
<li><a href="#ean-14" id="toc-ean-14">6.1.10.4 EAN-14</a></li>
<li><a href="#nve-18-sscc-18" id="toc-nve-18-sscc-18">6.1.10.5 NVE-18
(SSCC-18)</a></li>
<li><a href="#hibc-code-128" id="toc-hibc-code-128">6.1.10.6 HIBC Code
128</a></li>
<li><a href="#dpd-code" id="toc-dpd-code">6.1.10.7 DPD Code</a></li>
<li><a href="#upu-s10" id="toc-upu-s10">6.1.10.8 UPU S10</a></li>
</ul></li>
<li><a href="#gs1-databar-iso-24724"
id="toc-gs1-databar-iso-24724">6.1.11 GS1 DataBar (ISO 24724)</a>
<ul>
<li><a href="#gs1-databar-omnidirectional-and-gs1-databar-truncated"
id="toc-gs1-databar-omnidirectional-and-gs1-databar-truncated">6.1.11.1
GS1 DataBar Omnidirectional and GS1 DataBar Truncated</a></li>
<li><a href="#gs1-databar-limited" id="toc-gs1-databar-limited">6.1.11.2
GS1 DataBar Limited</a></li>
<li><a href="#gs1-databar-expanded"
id="toc-gs1-databar-expanded">6.1.11.3 GS1 DataBar Expanded</a></li>
</ul></li>
<li><a href="#korea-post-barcode" id="toc-korea-post-barcode">6.1.12
Korea Post Barcode</a></li>
<li><a href="#channel-code" id="toc-channel-code">6.1.13 Channel
Code</a></li>
<li><a href="#bc412-semi-t1-95" id="toc-bc412-semi-t1-95">6.1.14 BC412
(SEMI T1-95)</a></li>
</ul></li>
<li><a href="#stacked-symbologies" id="toc-stacked-symbologies">6.2
Stacked Symbologies</a>
<ul>
<li><a href="#basic-symbol-stacking"
id="toc-basic-symbol-stacking">6.2.1 Basic Symbol Stacking</a></li>
<li><a href="#codablock-f" id="toc-codablock-f">6.2.2
Codablock-F</a></li>
<li><a href="#code-16k-en-12323" id="toc-code-16k-en-12323">6.2.3 Code
16K (EN 12323)</a></li>
<li><a href="#pdf417-iso-15438" id="toc-pdf417-iso-15438">6.2.4 PDF417
(ISO 15438)</a></li>
<li><a href="#compact-pdf417-iso-15438"
id="toc-compact-pdf417-iso-15438">6.2.5 Compact PDF417 (ISO
15438)</a></li>
<li><a href="#micropdf417-iso-24728"
id="toc-micropdf417-iso-24728">6.2.6 MicroPDF417 (ISO 24728)</a></li>
<li><a href="#gs1-databar-stacked-iso-24724"
id="toc-gs1-databar-stacked-iso-24724">6.2.7 GS1 DataBar Stacked (ISO
24724)</a>
<ul>
<li><a href="#gs1-databar-stacked" id="toc-gs1-databar-stacked">6.2.7.1
GS1 DataBar Stacked</a></li>
<li><a href="#gs1-databar-stacked-omnidirectional"
id="toc-gs1-databar-stacked-omnidirectional">6.2.7.2 GS1 DataBar Stacked
Omnidirectional</a></li>
<li><a href="#gs1-databar-expanded-stacked"
id="toc-gs1-databar-expanded-stacked">6.2.7.3 GS1 DataBar Expanded
Stacked</a></li>
</ul></li>
<li><a href="#code-49" id="toc-code-49">6.2.8 Code 49</a></li>
</ul></li>
<li><a href="#gs1-composite-symbols-iso-24723"
id="toc-gs1-composite-symbols-iso-24723">6.3 GS1 Composite Symbols (ISO
24723)</a>
<ul>
<li><a href="#cc-a" id="toc-cc-a">6.3.1 CC-A</a></li>
<li><a href="#cc-b" id="toc-cc-b">6.3.2 CC-B</a></li>
<li><a href="#cc-c" id="toc-cc-c">6.3.3 CC-C</a></li>
</ul></li>
<li><a href="#two-track-symbols" id="toc-two-track-symbols">6.4
Two-Track Symbols</a>
<ul>
<li><a href="#pharmacode-two-track" id="toc-pharmacode-two-track">6.4.1
Pharmacode Two-Track</a></li>
<li><a href="#postnet" id="toc-postnet">6.4.2 POSTNET</a></li>
<li><a href="#planet" id="toc-planet">6.4.3 PLANET</a></li>
<li><a href="#brazilian-cepnet" id="toc-brazilian-cepnet">6.4.4
Brazilian CEPNet</a></li>
<li><a href="#dx-film-edge-barcode" id="toc-dx-film-edge-barcode">6.4.5
DX Film Edge Barcode</a></li>
</ul></li>
<li><a href="#state-postal-codes" id="toc-state-postal-codes">6.5
4-State Postal Codes</a>
<ul>
<li><a href="#australia-post-4-state-symbols"
id="toc-australia-post-4-state-symbols">6.5.1 Australia Post 4-State
Symbols</a>
<ul>
<li><a href="#customer-barcodes" id="toc-customer-barcodes">6.5.1.1
Customer Barcodes</a></li>
<li><a href="#reply-paid-barcode" id="toc-reply-paid-barcode">6.5.1.2
Reply Paid Barcode</a></li>
<li><a href="#routing-barcode" id="toc-routing-barcode">6.5.1.3 Routing
Barcode</a></li>
<li><a href="#redirect-barcode" id="toc-redirect-barcode">6.5.1.4
Redirect Barcode</a></li>
</ul></li>
<li><a href="#dutch-post-kix-code" id="toc-dutch-post-kix-code">6.5.2
Dutch Post KIX Code</a></li>
<li><a href="#royal-mail-4-state-customer-code-rm4scc"
id="toc-royal-mail-4-state-customer-code-rm4scc">6.5.3 Royal Mail
4-State Customer Code (RM4SCC)</a></li>
<li><a href="#royal-mail-4-state-mailmark"
id="toc-royal-mail-4-state-mailmark">6.5.4 Royal Mail 4-State
Mailmark</a></li>
<li><a href="#usps-intelligent-mail"
id="toc-usps-intelligent-mail">6.5.5 USPS Intelligent Mail</a></li>
<li><a href="#japanese-postal-code" id="toc-japanese-postal-code">6.5.6
Japanese Postal Code</a></li>
<li><a href="#daft-code" id="toc-daft-code">6.5.7 DAFT Code</a></li>
</ul></li>
<li><a href="#matrix-symbols" id="toc-matrix-symbols">6.6 Matrix
Symbols</a>
<ul>
<li><a href="#data-matrix-iso-16022"
id="toc-data-matrix-iso-16022">6.6.1 Data Matrix (ISO 16022)</a></li>
<li><a href="#royal-mail-2d-mailmark-cmdm-data-matrix"
id="toc-royal-mail-2d-mailmark-cmdm-data-matrix">6.6.2 Royal Mail 2D
Mailmark (CMDM) (Data Matrix)</a></li>
<li><a href="#qr-code-iso-18004" id="toc-qr-code-iso-18004">6.6.3 QR
Code (ISO 18004)</a></li>
<li><a href="#micro-qr-code-iso-18004"
id="toc-micro-qr-code-iso-18004">6.6.4 Micro QR Code (ISO
18004)</a></li>
<li><a href="#rectangular-micro-qr-code-rmqr-iso-23941"
id="toc-rectangular-micro-qr-code-rmqr-iso-23941">6.6.5 Rectangular
Micro QR Code (rMQR) (ISO 23941)</a></li>
<li><a href="#upnqr-univerzalnega-plačilnega-naloga-qr"
id="toc-upnqr-univerzalnega-plačilnega-naloga-qr">6.6.6 UPNQR
(Univerzalnega Plačilnega Naloga QR)</a></li>
<li><a href="#maxicode-iso-16023" id="toc-maxicode-iso-16023">6.6.7
MaxiCode (ISO 16023)</a></li>
<li><a href="#aztec-code-iso-24778" id="toc-aztec-code-iso-24778">6.6.8
Aztec Code (ISO 24778)</a></li>
<li><a href="#aztec-runes-iso-24778"
id="toc-aztec-runes-iso-24778">6.6.9 Aztec Runes (ISO 24778)</a></li>
<li><a href="#code-one" id="toc-code-one">6.6.10 Code One</a></li>
<li><a href="#grid-matrix" id="toc-grid-matrix">6.6.11 Grid
Matrix</a></li>
<li><a href="#dotcode" id="toc-dotcode">6.6.12 DotCode</a></li>
<li><a href="#han-xin-code-iso-20830"
id="toc-han-xin-code-iso-20830">6.6.13 Han Xin Code (ISO 20830)</a></li>
<li><a href="#ultracode" id="toc-ultracode">6.6.14 Ultracode</a></li>
</ul></li>
<li><a href="#other-barcode-like-markings"
id="toc-other-barcode-like-markings">6.7 Other Barcode-Like Markings</a>
<ul>
<li><a href="#facing-identification-mark-fim"
id="toc-facing-identification-mark-fim">6.7.1 Facing Identification Mark
(FIM)</a></li>
<li><a href="#flattermarken" id="toc-flattermarken">6.7.2
Flattermarken</a></li>
</ul></li>
</ul></li>
<li><a href="#legal-and-version-information"
id="toc-legal-and-version-information">7. Legal and Version
Information</a>
<ul>
<li><a href="#license" id="toc-license">7.1 License</a></li>
<li><a href="#patent-issues" id="toc-patent-issues">7.2 Patent
Issues</a></li>
<li><a href="#version-information" id="toc-version-information">7.3
Version Information</a></li>
<li><a href="#sources-of-information"
id="toc-sources-of-information">7.4 Sources of Information</a></li>
<li><a href="#standards-compliance" id="toc-standards-compliance">7.5
Standards Compliance</a>
<ul>
<li><a href="#symbology-standards" id="toc-symbology-standards">7.5.1
Symbology Standards</a></li>
<li><a href="#general-standards" id="toc-general-standards">7.5.2
General Standards</a></li>
</ul></li>
</ul></li>
<li><a href="#annex-a.-character-encoding"
id="toc-annex-a.-character-encoding">Annex A. Character Encoding</a>
<ul>
<li><a href="#a.1-ascii-standard" id="toc-a.1-ascii-standard">A.1 ASCII
Standard</a></li>
<li><a href="#a.2-latin-alphabet-no.-1-isoiec-8859-1"
id="toc-a.2-latin-alphabet-no.-1-isoiec-8859-1">A.2 Latin Alphabet No. 1
(ISO/IEC 8859-1)</a></li>
</ul></li>
<li><a href="#annex-b.-qt-backend-qzint"
id="toc-annex-b.-qt-backend-qzint">Annex B. Qt Backend QZint</a></li>
<li><a href="#annex-c.-tcl-backend-binding"
id="toc-annex-c.-tcl-backend-binding">Annex C. Tcl Backend
Binding</a></li>
<li><a href="#annex-d.-man-page-zint1"
id="toc-annex-d.-man-page-zint1">Annex D. Man Page ZINT(1)</a><ul>
<li><a href="#name" id="toc-name">NAME</a></li>
<li><a href="#synopsis" id="toc-synopsis">SYNOPSIS</a></li>
<li><a href="#description" id="toc-description">DESCRIPTION</a></li>
<li><a href="#options" id="toc-options">OPTIONS</a></li>
<li><a href="#exit-status" id="toc-exit-status">EXIT STATUS</a></li>
<li><a href="#examples" id="toc-examples">EXAMPLES</a></li>
<li><a href="#bugs" id="toc-bugs">BUGS</a></li>
<li><a href="#see-also" id="toc-see-also">SEE ALSO</a></li>
<li><a href="#conforming-to" id="toc-conforming-to">CONFORMING
TO</a></li>
<li><a href="#copyright" id="toc-copyright">COPYRIGHT</a></li>
<li><a href="#author" id="toc-author">AUTHOR</a></li>
</ul>
</nav>
<h1 id="introduction">1. Introduction</h1>
<p>The Zint project aims to provide a complete cross-platform open
source barcode generating solution. The package currently consists of a
Qt-based GUI, a CLI command line executable and a library with an API to
allow developers access to the capabilities of Zint. It is hoped that
Zint provides a solution which is flexible enough for professional users
while at the same time takes care of as much of the processing as
possible to allow easy translation from input data to barcode image.</p>
<p>The library which forms the main component of the Zint project is
currently able to encode data in over 50 barcode symbologies (types of
barcode), for each of which it is possible to translate that data from
either UTF-8 (Unicode) or a raw 8-bit data stream. The image can be
rendered as a</p>
<ul>
<li>Windows Bitmap (BMP),</li>
<li>Enhanced Metafile Format (EMF),</li>
<li>Encapsulated PostScript (EPS),</li>
<li>Graphics Interchange Format (GIF),</li>
<li>ZSoft Paintbrush (PCX) image,</li>
<li>Portable Network Graphic (PNG) image,</li>
<li>Tagged Image File Format (TIF), or a</li>
<li>Scalable Vector Graphic (SVG).</li>
</ul>
<p>Many options are available for setting the characteristics of the
output image including the size and colour of the image, the amount of
error correction used in the symbol and the orientation of the
image.</p>
<h2 id="glossary">1.1 Glossary</h2>
<p>Some of the words and phrases used in this document are specific to
barcoding, and so a brief explanation is given to help
understanding:</p>
<dl>
<dt>symbol</dt>
<dd>
<p>A symbol is an image which encodes data according to one of the
standards. This encompasses barcodes (linear symbols) as well as any of
the other methods of representing data used in this program.</p>
</dd>
<dt>symbology</dt>
<dd>
<p>A method of encoding data to create a certain type of symbol.</p>
</dd>
<dt>linear</dt>
<dd>
<p>A linear or one-dimensional symbol is one which consists of bars and
spaces, and is what most people associate with the term ‘barcode’.
Examples include Code 128.</p>
</dd>
<dt>stacked</dt>
<dd>
<p>A stacked symbol consists of multiple linear symbols placed one above
another and which together hold the message, usually alongside some
error correction data. Examples include PDF417.</p>
</dd>
<dt>matrix</dt>
<dd>
<p>A matrix symbol is one based on a (usually square) grid of elements
called modules. Examples include Data Matrix, but MaxiCode and DotCode
are also considered matrix symbologies.</p>
</dd>
<dt>composite</dt>
<dd>
<p>A composite symbology is one which is made up of elements which are
both linear and stacked. Those currently supported are made up of a
linear ‘primary’ message above which is printed a stacked component
based on the PDF417 symbology. These symbols also have a separator which
separates the linear and the stacked components. The stacked component
is most often referred to as the 2D (two-dimensional) component.</p>
</dd>
<dt>X-dimension</dt>
<dd>
<p>The X-dimension of a symbol is the size (usually the width) of the
smallest element. For a linear symbology this is the width of the
smallest bar. For matrix symbologies it is the width of the smallest
module (usually a square). Barcode widths and heights are expressed in
X-dimensions. Most linear symbologies can have their height varied
whereas most matrix symbologies have a fixed width-to-height ratio where
the height is determined by the width.</p>
</dd>
<dt>GS1 data</dt>
<dd>
<p>This is a structured way of representing information which consists
of ‘chunks’ of data, each of which starts with an Application Identifier
(AI). The AI identifies what type of information is being encoded.</p>
</dd>
<dt>Reader Initialisation (Programming)</dt>
<dd>
<p>Some symbologies allow a special character to be included which can
be detected by the scanning equipment as signifying that the data is
used to program or change settings in that equipment. This data is
usually not passed on to the software which handles normal input data.
This feature should only be used if you are familiar with the
programming codes relevant to your scanner.</p>
</dd>
<dt>ECI</dt>
<dd>
<p>The Extended Channel Interpretations (ECI) mechanism allows for
multi-language data to be encoded in symbols which would usually support
only Latin-1 (ISO/IEC 8859-1 plus ASCII) characters. This can be useful,
for example, if you need to encode Cyrillic characters, but should be
used with caution as not all scanners support this method.</p>
</dd>
</dl>
<p>Two other concepts that are important are raster and vector.</p>
<dl>
<dt>raster</dt>
<dd>
<p>A low level bitmap representation of an image. BMP, GIF, PCX, PNG and
TIF are raster file formats.</p>
</dd>
<dt>vector</dt>
<dd>
<p>A high level command- or data-based representation of an image. EMF,
EPS and SVG are vector file formats. They require renderers to turn them
into bitmaps.</p>
</dd>
</dl>
<h1 id="installing-zint">2. Installing Zint</h1>
<h2 id="linux">2.1 Linux</h2>
<p>The easiest way to configure compilation is to take advantage of the
CMake utilities. You will need to install CMake and
<code>libpng-dev</code> first. For instance on <code>apt</code>
systems:</p>
<div class="sourceCode" id="cb1"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">sudo</span> apt install git cmake build-essential libpng-dev</span></code></pre></div>
<p>If you want to take advantage of Zint Barcode Studio you will also
need to have Qt and its component <code>"Desktop gcc 64-bit"</code>
installed, as well as <code>mesa</code>. For details see
<code>"README.linux"</code> in the project root directory.</p>
<p>Once you have fulfilled these requirements unzip the source code
tarball or clone the latest source</p>
<div class="sourceCode" id="cb2"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="fu">git</span> clone https://git.code.sf.net/p/zint/code zint</span></code></pre></div>
<p>and follow these steps in the top directory:</p>
<div class="sourceCode" id="cb3"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="fu">mkdir</span> build</span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a><span class="bu">cd</span> build</span>
<span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a><span class="fu">cmake</span> ..</span>
<span id="cb3-4"><a href="#cb3-4" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></span>
<span id="cb3-5"><a href="#cb3-5" aria-hidden="true" tabindex="-1"></a><span class="fu">sudo</span> make install</span></code></pre></div>
<p>The CLI command line program can be accessed by typing</p>
<div class="sourceCode" id="cb4"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="pp">[</span><span class="ss">options</span><span class="pp">]</span></span></code></pre></div>
<p>The GUI can be accessed by typing</p>
<div class="sourceCode" id="cb5"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint-qt</span></span></code></pre></div>
<p>To test that the installation has been successful a shell script is
included in the <code>"frontend"</code> sub-directory. To run the test
type</p>
<div class="sourceCode" id="cb6"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./test.sh</span></span></code></pre></div>
<p>This should create numerous files in the sub-directory
<code>"frontend/test_sh_out"</code> showing the many modes of operation
which are available from Zint.</p>
<h2 id="bsd">2.2 BSD</h2>
<p>The latest Zint CLI, <code>libzint</code> library and GUI can be
installed from the <code>zint</code> package on FreeBSD:</p>
<div class="sourceCode" id="cb7"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a><span class="fu">su</span></span>
<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a><span class="ex">pkg</span> install zint</span>
<span id="cb7-3"><a href="#cb7-3" aria-hidden="true" tabindex="-1"></a><span class="bu">exit</span></span></code></pre></div>
<p>and on OpenBSD (where the GUI is in a separate <code>zint-gui</code>
package):</p>
<div class="sourceCode" id="cb8"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a><span class="fu">su</span></span>
<span id="cb8-2"><a href="#cb8-2" aria-hidden="true" tabindex="-1"></a><span class="ex">pkg_add</span> zint zint-gui</span>
<span id="cb8-3"><a href="#cb8-3" aria-hidden="true" tabindex="-1"></a><span class="bu">exit</span></span></code></pre></div>
<p>To build from source (including for NetBSD) see
<code>"README.bsd"</code> in the project root directory.</p>
<h2 id="microsoft-windows">2.3 Microsoft Windows</h2>
<p>For Microsoft Windows, Zint is distributed as a binary executable.
Simply download the ZIP file, then right-click on the ZIP file and
<code>"Extract All"</code>. A new folder will be created within which
are two binary files:</p>
<ul>
<li><code>qtZint.exe</code> - Zint Barcode Studio</li>
<li><code>zint.exe</code> - Command Line Interface</li>
</ul>
<p>For fresh releases you will get a warning message from Microsoft
Defender SmartScreen that this is an ‘unrecognised app’. This happens
because Zint is a free and open-source software project with no
advertising and hence no income, meaning we are not able to afford the
$664 per year to have the application digitally signed by Microsoft.</p>
<p>To build Zint on Windows from source, see
<code>"win32/README"</code>.</p>
<h2 id="apple-macos">2.4 Apple macOS</h2>
<p>The latest Zint CLI and <code>libzint</code> can be installed using
Homebrew.<a href="#fn1" class="footnote-ref" id="fnref1"
role="doc-noteref"><sup>1</sup></a> To install Homebrew input the
following line into the macOS terminal</p>
<div class="sourceCode" id="cb9"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a><span class="ex">/bin/bash</span> <span class="at">-c</span> <span class="st">&quot;</span><span class="va">$(</span><span class="ex">curl</span> <span class="at">-fsSL</span> <span class="dt">\</span></span>
<span id="cb9-2"><a href="#cb9-2" aria-hidden="true" tabindex="-1"></a>    https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh<span class="va">)</span><span class="st">&quot;</span></span></code></pre></div>
<p>Once Homebrew is installed use the following command to install the
CLI and library</p>
<div class="sourceCode" id="cb10"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a><span class="ex">brew</span> install zint</span></code></pre></div>
<p>To build from source (and install the GUI) see
<code>"README.macos"</code> in the project root directory.</p>
<h2 id="zint-tcl-backend">2.5 Zint Tcl Backend</h2>
<p>The Tcl backend in the <code>"backend_tcl"</code> sub-directory may
be built using the provided TEA (Tcl Extension Architecture) build on
Linux, Windows, macOS and Android. See <a
href="#annex-c.-tcl-backend-binding">Annex C. Tcl Backend Binding</a>
for further details.</p>
<h1 id="using-zint-barcode-studio">3. Using Zint Barcode Studio</h1>
<p>Zint Barcode Studio is the graphical user interface for Zint. If you
are starting from a command line interface you can start the GUI by
typing</p>
<div class="sourceCode" id="cb11"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint-qt</span></span></code></pre></div>
<p>or on Windows</p>
<div class="sourceCode" id="cb12"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb12-1"><a href="#cb12-1" aria-hidden="true" tabindex="-1"></a><span class="ex">qtZint.exe</span></span></code></pre></div>
<p>See the note in section <a href="#microsoft-windows">2.3 Microsoft
Windows</a> about Microsoft Defender SmartScreen.</p>
<p>Below is a brief guide to Zint Barcode Studio.</p>
<h2 id="main-window-and-data-tab">3.1 Main Window and Data Tab</h2>
<figure>
<img src="images/gui_main.png" title="fig:" class="win"
alt="Zint Barcode Studio on startup - main window with Data tab" />
<figcaption aria-hidden="true">Zint Barcode Studio on startup - main
window with Data tab</figcaption>
</figure>
<p>This is the main window of Zint Barcode Studio. The top of the window
shows a preview of the barcode that the current settings would create.
These settings can be changed using the controls below. The text box in
the <code>"Data to Encode"</code> groupbox on this first Data tab allows
you to enter the data to be encoded. When you are happy with your
settings you can use the <code>"Save..."</code> button to save the
resulting image to a file.</p>
<p>The <code>"Symbology"</code> drop-down box gives access to all of the
symbologies supported by Zint shown in alphabetical order. The text box
to its right can filter the drop-down to only show matching symbologies.
For instance typing <code>"mail"</code> will only show barcodes in the
drop-down whose names contain the word <code>"mail"</code>. Each word
entered will match. So typing <code>"mail post"</code> will show
barcodes whose names contain <code>"mail"</code> or <code>"post"</code>
(or both).</p>
<p>The ellipsis button <code>"..."</code> to the right of the data text
box invokes the Data Dialog - see <a href="#data-dialog">3.7 Data
Dialog</a> for details. The delete button <img
src="images/gui_delete.png" class="btn" alt="delete" /> next to it will
clear the data text box and the ECI (Extended Channel Interpretations)
drop-down if set.</p>
<p>To set the barcode as a Programming Initialisation symbol click the
<code>"Reader Init"</code> checkbox. The <code>"1234.."</code> button to
its right invokes the Sequence Dialog - see <a
href="#sequence-dialog">3.8 Sequence Dialog</a>. The zap button <img
src="images/gui_zap.png" class="btn" alt="zap" /> will clear all data
and reset all settings for the barcode to defaults.</p>
<p>The <code>"BMP"</code> and <code>"SVG"</code> buttons at the bottom
will copy the image to the clipboard in BMP format and SVG format
respectively. Further copy-to-clipboard formats are available by
clicking the <code>"Menu"</code> button, along with
<code>"CLI Equivalent..."</code>, <code>"Save As..."</code>,
<code>"Factory Reset..."</code>, <code>"Help"</code>,
<code>"About..."</code> and <code>"Quit"</code> options. Most of the
options are also available in a context menu by right-clicking the
preview.</p>
<figure>
<img src="images/gui_menus.png" title="fig:" class="win"
alt="Zint Barcode Studio main menu (left) and context menu (right)" />
<figcaption aria-hidden="true">Zint Barcode Studio main menu (left) and
context menu (right)</figcaption>
</figure>
<h2 id="gs1-composite-groupbox">3.2 GS1 Composite Groupbox</h2>
<figure>
<img src="images/gui_composite.png" title="fig:" class="win"
alt="Zint Barcode Studio encoding GS1 Composite data" />
<figcaption aria-hidden="true">Zint Barcode Studio encoding GS1
Composite data</figcaption>
</figure>
<p>In the middle of the Data tab is an area for creating composite
symbologies which appears when the currently selected symbology is
supported by the GS1 Composite symbology standard. GS1 data can then be
entered with square brackets used to separate Application Identifier
(AI) information from data as shown here. For details, see <a
href="#gs1-composite-symbols-iso-24723">6.3 GS1 Composite Symbols (ISO
24723)</a>.</p>
<h2 id="additional-ecidata-segments-groupbox">3.3 Additional ECI/Data
Segments Groupbox</h2>
<figure>
<img src="images/gui_segs.png" title="fig:" class="win"
alt="Zint Barcode Studio encoding multiple segments" />
<figcaption aria-hidden="true">Zint Barcode Studio encoding multiple
segments</figcaption>
</figure>
<p>For symbologies that support ECIs (Extended Channel Interpretations)
the middle of the Data tab is an area for entering additional data
segments with their own ECIs. Up to 4 segments (including the main
<code>"Data to Encode"</code> as segment 0) may be specified. See <a
href="#multiple-segments">4.16 Multiple Segments</a> for details.</p>
<h2 id="symbology-specific-groupbox">3.4 Symbology-specific
Groupbox</h2>
<figure>
<img src="images/gui_c25inter.png" title="fig:" class="win"
alt="Zint Barcode Studio showing Code 2 of 5 Interleaved settings" />
<figcaption aria-hidden="true">Zint Barcode Studio showing Code 2 of 5
Interleaved settings</figcaption>
</figure>
<p>Many symbologies have extra options to change the content, format and
appearance of the symbol generated. For those with few additional
options (and no support for GS1 data or ECIs), the middle of the Data
tab is an area for setting those options.</p>
<p>Here is shown the check digit options for an Interleaved Code 2 of 5
symbol (see <a href="#interleaved-code-2-of-5-iso-16390">6.1.2.4
Interleaved Code 2 of 5 (ISO 16390)</a>).</p>
<p>Symbologies with more than a few options (or support for GS1 data or
ECIs) have a second Symbology-specific tab, shown next.</p>
<h2 id="symbology-specific-tab">3.5 Symbology-specific Tab</h2>
<figure>
<img src="images/gui_aztec.png" title="fig:" class="win"
alt="Zint Barcode Studio showing Aztec Code options" />
<figcaption aria-hidden="true">Zint Barcode Studio showing Aztec Code
options</figcaption>
</figure>
<p>A second tab appears for those symbologies with more than a few extra
options.</p>
<p>Here is shown the options available for an Aztec Code symbol.</p>
<p>You can adjust its size or error correction level (see <a
href="#aztec-code-iso-24778">6.6.8 Aztec Code (ISO 24778)</a>), select
how its data is to be treated (see <a href="#input-modes">4.11 Input
Modes</a>), and set it as part of a Structured Append sequence of
symbols (see <a href="#structured-append">4.17 Structured
Append</a>).</p>
<h2 id="appearance-tab">3.6 Appearance Tab</h2>
<figure>
<img src="images/gui_appearance.png" title="fig:" class="win"
alt="Zint Barcode Studio showing Appearance tab options" />
<figcaption aria-hidden="true">Zint Barcode Studio showing Appearance
tab options</figcaption>
</figure>
<p>The Appearance tab can be used to adjust the dimensions and other
properties of the symbol.</p>
<p>The <code>"Height"</code> value affects the height of symbologies
which do not have a fixed width-to-height ratio, i.e. those other than
matrix symbologies. For such symbologies the
<code>"Automatic Height"</code> checkbox will be enabled - uncheck this
to manually adjust the height. The <code>"Compliant Height"</code>
checkbox applies to symbologies that define a standard height - see <a
href="#adjusting-height">4.4 Adjusting Height</a>.</p>
<p>Boundary bars can be added with the <code>"Border Type"</code>
drop-down and their size adjusted with <code>"Border Width"</code>, and
whitespace can be adjusted both horizontally (first spinbox) and
vertically (second spinbox), and also through the
<code>"Quiet Zones"</code> checkbox if standard quiet zones are defined
for the symbology.</p>
<p>The size of the saved image can be specified with
<code>"Printing Scale"</code>, and also by clicking the <img
src="images/gui_scaling.png" class="btn" alt="scaling" /> icon to invoke
the Set Printing Scale Dialog - see <a
href="#adjusting-image-size-x-dimension">4.9 Adjusting Image Size
(X-dimension)</a> for further details.</p>
<figure>
<img src="images/gui_set_printing_scale.png" title="fig:" class="pop"
alt="Adjusting the Print Size" />
<figcaption aria-hidden="true">Adjusting the Print Size</figcaption>
</figure>
<p>The foreground and background colours can be set either using the
text boxes which accept <code>"RRGGBBAA"</code> hexadecimal values and
<code>"C,M,Y,K"</code> decimal percentage values, or by clicking the
foreground eye <img src="images/gui_black_eye.png" class="btn"
alt="eye" /> and background eye <img src="images/gui_white_eye.png"
class="btn" alt="eye" /> buttons which invoke a colour picker.</p>
<figure>
<img src="images/gui_colour.png" title="fig:" class="pop"
alt="The colour picker tool" />
<figcaption aria-hidden="true">The colour picker tool</figcaption>
</figure>
<p>(Note that to change the colours visually, the luminence slider, the
long narrow column on the right, must be adjusted.) The color picker
only deals in RGB(A), and will overwrite any CMYK values with RGB(A)
values once <code>"OK"</code> is selected.</p>
<p>Back in the Appearance tab, the colours can be reset to
black-on-white using the <code>"Reset"</code> button, and exchanged one
for the other using the swap <img src="images/gui_swap.png" class="btn"
alt="swap" /> button next to it.</p>
<h2 id="data-dialog">3.7 Data Dialog</h2>
<figure>
<img src="images/gui_data_dialog.png" title="fig:" class="pop"
alt="Entering longer text input" />
<figcaption aria-hidden="true">Entering longer text input</figcaption>
</figure>
<p>Clicking on the ellipsis <code>"..."</code> button next to the
<code>"Data to Encode"</code> text box in the Data tab opens a larger
window which can be used to enter longer strings of text. You can also
use this window to load data from a file.</p>
<p>The dialog is also available for additional ECI/Data segments by
clicking the ellipsis button to the right of their data text boxes.</p>
<p>Note that if your data contains line feeds (<code>LF</code>) then the
data will be split into separate lines in the dialog box. On saving the
data back to the main text box any separate lines in the data will be
escaped as <code>'\n'</code> and the <code>"Parse Escapes"</code>
checkbox will be set. This only affects line feeds, not carriage returns
(<code>CR</code>) or <code>CR+LF</code> pairs, and behaves the same on
both Windows and Unix. (For details on escape sequences, see <a
href="#inputting-data">4.1 Inputting Data</a>.)</p>
<h2 id="sequence-dialog">3.8 Sequence Dialog</h2>
<figure>
<img src="images/gui_sequence.png" title="fig:" class="pop"
alt="Creating a sequence of barcode symbols" />
<figcaption aria-hidden="true">Creating a sequence of barcode
symbols</figcaption>
</figure>
<p>Clicking on the sequence button (labelled <code>"1234.."</code>) in
the Data tab opens the Sequence Dialog. This allows you to create
multiple barcode images by entering a sequence of data inputs in the
right hand panel. Sequences can also be automatically generated by
entering parameters on the left hand side or by importing the data from
a file. Zint will generate a separate barcode image for each line of
text in the right hand panel. The format field determines the format of
the automatically generated sequence where characters have the meanings
as given below:</p>
<div id="tbl:sequence_format_characters" class="tablenos">
<table id="tbl:sequence_format_characters"
data-tag=": Sequence Format Characters">
<caption><span>Table : Sequence Format Characters</span> </caption>
<thead>
<tr>
<th style="text-align: left;">Character</th>
<th style="text-align: left;">Effect</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;"><code>$</code></td>
<td style="text-align: left;">Insert leading zeroes</td>
</tr>
<tr>
<td style="text-align: left;"><code>#</code></td>
<td style="text-align: left;">Insert leading spaces</td>
</tr>
<tr>
<td style="text-align: left;"><code>*</code></td>
<td style="text-align: left;">Insert leading asterisks</td>
</tr>
<tr>
<td style="text-align: left;">Any other character</td>
<td style="text-align: left;">Interpreted literally</td>
</tr>
</tbody>
</table>
</div>
<p>Once you’re happy with the Sequence Data, click the
<code>"Export..."</code> button to bring up the Export Dialog, discussed
next.</p>
<h2 id="export-dialog">3.9 Export Dialog</h2>
<figure>
<img src="images/gui_export.png" title="fig:" class="pop"
alt="Setting filenames for an exported sequence of barcode symbols" />
<figcaption aria-hidden="true">Setting filenames for an exported
sequence of barcode symbols</figcaption>
</figure>
<p>The Export Dialog invoked by pressing the <code>"Export..."</code>
button in the Sequence Dialog sets the parameters for exporting the
sequence of barcode images. Here you can set the output directory, the
format of the output filenames and what their image type will be. Note
that the symbology, colour and other formatting information are taken
from the main window.</p>
<h2 id="cli-equivalent-dialog">3.10 CLI Equivalent Dialog</h2>
<figure>
<img src="images/gui_cli_equivalent.png" title="fig:" class="pop"
alt="CLI Equivalent Dialog" />
<figcaption aria-hidden="true">CLI Equivalent Dialog</figcaption>
</figure>
<p>The CLI Equivalent Dialog can be invoked from the main menu or the
context menu and displays the CLI command that will reproduce the
barcode as currently configured in the GUI. Press the
<code>"Copy"</code> button to copy the command to the clipboard, which
can then be pasted into the command line.</p>
<h1 id="using-the-command-line">4. Using the Command Line</h1>
<p>This section describes how to encode data using the command line
frontend (CLI) program. The examples given are for the Unix platform,
but the same options are available for Windows - just remember to
include the executable file extension if <code>".EXE"</code> is not in
your <code>PATHEXT</code> environment variable, i.e.:</p>
<div class="sourceCode" id="cb13"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb13-1"><a href="#cb13-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint.exe</span> <span class="at">-d</span> <span class="st">&quot;This Text&quot;</span></span></code></pre></div>
<p>For compatibility with Windows the examples use double quotes to
delimit data, though on Unix single quotes are generally preferable as
they stop the shell from processing any characters such as backslash or
dollar. A single quote itself is dealt with by terminating the
single-quoted text, backslashing the single quote, and then
continuing:</p>
<div class="sourceCode" id="cb14"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb14-1"><a href="#cb14-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-d</span> <span class="st">&#39;Text containing a single quote &#39;</span><span class="dt">\&#39;</span><span class="st">&#39; in the middle&#39;</span></span></code></pre></div>
<p>Some examples use backslash (<code>\</code>) to continue commands
onto the next line. For Windows, use caret (<code>^</code>) instead.</p>
<p>Certain options that take values have short names as well as long
ones, namely <code>-b</code> (<code>--barcode</code>), <code>-d</code>
(<code>--data</code>), <code>-i</code> (<code>--input</code>),
<code>-o</code> (<code>--output</code>) and <code>-w</code>
(<code>--whitesp</code>). For these a space should be used to separate
the short name from its value, to avoid ambiguity. For long names a
space or an equals sign may be used. For instance:</p>
<div class="sourceCode" id="cb15"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb15-1"><a href="#cb15-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-d</span> <span class="st">&quot;This Text&quot;</span></span>
<span id="cb15-2"><a href="#cb15-2" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">--data</span><span class="op">=</span><span class="st">&quot;This Text&quot;</span></span>
<span id="cb15-3"><a href="#cb15-3" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">--data</span> <span class="st">&quot;This Text&quot;</span></span></code></pre></div>
<p>The examples use a space separator for short option names, and an
equals sign for long option names.</p>
<h2 id="inputting-data">4.1 Inputting Data</h2>
<p>The data to encode can be entered at the command line using the
<code>-d</code> or <code>--data</code> option, for example</p>
<div class="sourceCode" id="cb16"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb16-1"><a href="#cb16-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-d</span> <span class="st">&quot;This Text&quot;</span></span></code></pre></div>
<p>This will encode the text <code>"This Text"</code>. Zint will use the
default symbology, Code 128, and output to the default file
<code>"out.png"</code> in the current directory. Alternatively, if
<code>libpng</code> was not present when Zint was built, the default
output file will be <code>"out.gif"</code>.</p>
<p>The data input to the Zint CLI is assumed to be encoded in UTF-8
(Unicode) format (Zint will correctly handle UTF-8 data on Windows). If
you are encoding characters beyond the 7-bit ASCII set using a scheme
other than UTF-8 then you will need to set the appropriate input options
as shown in <a href="#input-modes">4.11 Input Modes</a> below.</p>
<p>Non-printing characters can be entered on the command line using
backslash (<code>\</code>) as an escape character in combination with
the <code>--esc</code> switch. Permissible sequences are shown in the
table below.</p>
<div id="tbl:escape_sequences" class="tablenos">
<table id="tbl:escape_sequences" data-tag=": Escape Sequences">
<caption><span>Table : Escape Sequences</span> </caption>
<colgroup>
<col style="width: 15%" />
<col style="width: 15%" />
<col style="width: 10%" />
<col style="width: 57%" />
</colgroup>
<thead>
<tr>
<th style="text-align: left;">Escape Sequence</th>
<th style="text-align: left;">ASCII Equivalent</th>
<th style="text-align: left;">Name</th>
<th style="text-align: left;">Interpretation</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;"><code>\0</code></td>
<td style="text-align: left;">0x00</td>
<td style="text-align: left;"><code>NUL</code></td>
<td style="text-align: left;">Null character</td>
</tr>
<tr>
<td style="text-align: left;"><code>\E</code></td>
<td style="text-align: left;">0x04</td>
<td style="text-align: left;"><code>EOT</code></td>
<td style="text-align: left;">End of Transmission</td>
</tr>
<tr>
<td style="text-align: left;"><code>\a</code></td>
<td style="text-align: left;">0x07</td>
<td style="text-align: left;"><code>BEL</code></td>
<td style="text-align: left;">Bell</td>
</tr>
<tr>
<td style="text-align: left;"><code>\b</code></td>
<td style="text-align: left;">0x08</td>
<td style="text-align: left;"><code>BS</code></td>
<td style="text-align: left;">Backspace</td>
</tr>
<tr>
<td style="text-align: left;"><code>\t</code></td>
<td style="text-align: left;">0x09</td>
<td style="text-align: left;"><code>HT</code></td>
<td style="text-align: left;">Horizontal Tab</td>
</tr>
<tr>
<td style="text-align: left;"><code>\n</code></td>
<td style="text-align: left;">0x0A</td>
<td style="text-align: left;"><code>LF</code></td>
<td style="text-align: left;">Line Feed</td>
</tr>
<tr>
<td style="text-align: left;"><code>\v</code></td>
<td style="text-align: left;">0x0B</td>
<td style="text-align: left;"><code>VT</code></td>
<td style="text-align: left;">Vertical Tab</td>
</tr>
<tr>
<td style="text-align: left;"><code>\f</code></td>
<td style="text-align: left;">0x0C</td>
<td style="text-align: left;"><code>FF</code></td>
<td style="text-align: left;">Form Feed</td>
</tr>
<tr>
<td style="text-align: left;"><code>\r</code></td>
<td style="text-align: left;">0x0D</td>
<td style="text-align: left;"><code>CR</code></td>
<td style="text-align: left;">Carriage Return</td>
</tr>
<tr>
<td style="text-align: left;"><code>\e</code></td>
<td style="text-align: left;">0x1B</td>
<td style="text-align: left;"><code>ESC</code></td>
<td style="text-align: left;">Escape</td>
</tr>
<tr>
<td style="text-align: left;"><code>\G</code></td>
<td style="text-align: left;">0x1D</td>
<td style="text-align: left;"><code>GS</code></td>
<td style="text-align: left;">Group Separator</td>
</tr>
<tr>
<td style="text-align: left;"><code>\R</code></td>
<td style="text-align: left;">0x1E</td>
<td style="text-align: left;"><code>RS</code></td>
<td style="text-align: left;">Record Separator</td>
</tr>
<tr>
<td style="text-align: left;"><code>\\</code></td>
<td style="text-align: left;">0x5C</td>
<td style="text-align: left;"><code>\</code></td>
<td style="text-align: left;">Backslash</td>
</tr>
<tr>
<td style="text-align: left;"><code>\dNNN</code></td>
<td style="text-align: left;">NNN</td>
<td style="text-align: left;"></td>
<td style="text-align: left;">Any 8-bit character where NNN is decimal
(000-255)</td>
</tr>
<tr>
<td style="text-align: left;"><code>\oNNN</code></td>
<td style="text-align: left;">0oNNN</td>
<td style="text-align: left;"></td>
<td style="text-align: left;">Any 8-bit character where NNN is octal
(000-377)</td>
</tr>
<tr>
<td style="text-align: left;"><code>\xNN</code></td>
<td style="text-align: left;">0xNN</td>
<td style="text-align: left;"></td>
<td style="text-align: left;">Any 8-bit character where NN is
hexadecimal (00-FF)</td>
</tr>
<tr>
<td style="text-align: left;"><code>\uNNNN</code></td>
<td style="text-align: left;"></td>
<td style="text-align: left;"></td>
<td style="text-align: left;">Any 16-bit Unicode BMP<a href="#fn2"
class="footnote-ref" id="fnref2" role="doc-noteref"><sup>2</sup></a>
character where NNNN is hexadecimal (0000-FFFF)</td>
</tr>
<tr>
<td style="text-align: left;"><code>\UNNNNNN</code></td>
<td style="text-align: left;"></td>
<td style="text-align: left;"></td>
<td style="text-align: left;">Any 21-bit Unicode character where NNNNNN
is hexadecimal (000000-10FFFF)</td>
</tr>
</tbody>
</table>
</div>
<p>(Special escape sequences are available for Code 128 only to manually
switch Code Sets and insert special <code>FNC1</code> characters - see
<a href="#standard-code-128-iso-15417">6.1.10.1 Standard Code 128 (ISO
15417)</a> for details.)</p>
<p>Input data can be read directly from file using the <code>-i</code>
or <code>--input</code> switch as shown below. The input file is assumed
to be UTF-8 formatted unless an alternative mode is selected. This
option replaces the use of the <code>-d</code> switch.</p>
<div class="sourceCode" id="cb17"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb17-1"><a href="#cb17-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-i</span> somefile.txt</span></code></pre></div>
<p>To read from stdin specify a single hyphen <code>"-"</code> as the
input file.</p>
<p>Note that except when batch processing (see <a
href="#batch-processing">4.12 Batch Processing</a> below), the file (or
stdin) should not end with a newline (<code>LF</code> on Unix,
<code>CR+LF</code> on Windows) unless you want the newline to be encoded
in the symbol.</p>
<h2 id="directing-output">4.2 Directing Output</h2>
<p>Output can be directed to a file other than the default using the
<code>-o</code> or <code>--output</code> switch. For example:</p>
<div class="sourceCode" id="cb18"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb18-1"><a href="#cb18-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-o</span> here.png <span class="at">-d</span> <span class="st">&quot;This Text&quot;</span></span></code></pre></div>
<p>This draws a Code 128 barcode in the file <code>"here.png"</code>. If
an Encapsulated PostScript file is needed simply append the filename
with <code>".eps"</code>, and so on for the other supported file
types:</p>
<div class="sourceCode" id="cb19"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb19-1"><a href="#cb19-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-o</span> there.eps <span class="at">-d</span> <span class="st">&quot;This Text&quot;</span></span></code></pre></div>
<p>The currently supported output file formats are shown in the
following table.</p>
<div id="tbl:output_file_formats" class="tablenos">
<table id="tbl:output_file_formats" data-tag=": Output File Formats">
<caption><span>Table : Output File Formats</span> </caption>
<thead>
<tr>
<th>Extension</th>
<th style="text-align: left;">File format</th>
</tr>
</thead>
<tbody>
<tr>
<td>bmp</td>
<td style="text-align: left;">Windows Bitmap</td>
</tr>
<tr>
<td>emf</td>
<td style="text-align: left;">Enhanced Metafile Format</td>
</tr>
<tr>
<td>eps</td>
<td style="text-align: left;">Encapsulated PostScript</td>
</tr>
<tr>
<td>gif</td>
<td style="text-align: left;">Graphics Interchange Format</td>
</tr>
<tr>
<td>pcx</td>
<td style="text-align: left;">ZSoft Paintbrush image</td>
</tr>
<tr>
<td>png</td>
<td style="text-align: left;">Portable Network Graphic</td>
</tr>
<tr>
<td>svg</td>
<td style="text-align: left;">Scalable Vector Graphic</td>
</tr>
<tr>
<td>tif</td>
<td style="text-align: left;">Tagged Image File Format</td>
</tr>
<tr>
<td>txt</td>
<td style="text-align: left;">Text file (see <a
href="#other-options">4.19 Other Options</a>)</td>
</tr>
</tbody>
</table>
</div>
<p>The filename can contain directories and sub-directories also, which
will be created if they don’t already exist:</p>
<div class="sourceCode" id="cb20"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb20-1"><a href="#cb20-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-o</span> <span class="st">&quot;dir/subdir/filename.eps&quot;</span> <span class="at">-d</span> <span class="st">&quot;This Text&quot;</span></span></code></pre></div>
<p>Note that on Windows, filenames are assumed to be UTF-8 encoded.</p>
<h2 id="selecting-barcode-type">4.3 Selecting Barcode Type</h2>
<p>Selecting which type of barcode you wish to produce (i.e. which
symbology to use) can be done at the command line using the
<code>-b</code> or <code>--barcode</code> switch followed by the
appropriate integer value or name in the following table. For example to
create a Data Matrix symbol you could use:</p>
<div class="sourceCode" id="cb21"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb21-1"><a href="#cb21-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> 71 <span class="at">-o</span> datamatrix.png <span class="at">-d</span> <span class="st">&quot;Data to encode&quot;</span></span></code></pre></div>
<p>or</p>
<div class="sourceCode" id="cb22"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb22-1"><a href="#cb22-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> DATAMATRIX <span class="at">-o</span> datamatrix.png <span class="at">-d</span> <span class="st">&quot;Data to encode&quot;</span></span></code></pre></div>
<p>Names are treated case-insensitively by the CLI, and the
<code>BARCODE_</code> prefix and any underscores are optional.</p>
<div id="tbl:barcode_types" class="tablenos">
<table id="tbl:barcode_types" data-tag=": Barcode Types (Symbologies)">
<caption><span>Table : Barcode Types (Symbologies)</span> </caption>
<colgroup>
<col style="width: 11%" />
<col style="width: 33%" />
<col style="width: 55%" />
</colgroup>
<thead>
<tr>
<th style="text-align: left;">Numeric Value</th>
<th style="text-align: left;">Name<a href="#fn3" class="footnote-ref"
id="fnref3" role="doc-noteref"><sup>3</sup></a></th>
<th style="text-align: left;">Barcode Name</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">1</td>
<td style="text-align: left;"><code>BARCODE_CODE11</code></td>
<td style="text-align: left;">Code 11</td>
</tr>
<tr>
<td style="text-align: left;">2<code>*</code></td>
<td style="text-align: left;"><code>BARCODE_C25STANDARD</code></td>
<td style="text-align: left;">Standard Code 2 of 5</td>
</tr>
<tr>
<td style="text-align: left;">3</td>
<td style="text-align: left;"><code>BARCODE_C25INTER</code></td>
<td style="text-align: left;">Interleaved 2 of 5</td>
</tr>
<tr>
<td style="text-align: left;">4</td>
<td style="text-align: left;"><code>BARCODE_C25IATA</code></td>
<td style="text-align: left;">Code 2 of 5 IATA</td>
</tr>
<tr>
<td style="text-align: left;">6</td>
<td style="text-align: left;"><code>BARCODE_C25LOGIC</code></td>
<td style="text-align: left;">Code 2 of 5 Data Logic</td>
</tr>
<tr>
<td style="text-align: left;">7</td>
<td style="text-align: left;"><code>BARCODE_C25IND</code></td>
<td style="text-align: left;">Code 2 of 5 Industrial</td>
</tr>
<tr>
<td style="text-align: left;">8</td>
<td style="text-align: left;"><code>BARCODE_CODE39</code></td>
<td style="text-align: left;">Code 3 of 9 (Code 39)</td>
</tr>
<tr>
<td style="text-align: left;">9</td>
<td style="text-align: left;"><code>BARCODE_EXCODE39</code></td>
<td style="text-align: left;">Extended Code 3 of 9 (Code 39+)</td>
</tr>
<tr>
<td style="text-align: left;">13</td>
<td style="text-align: left;"><code>BARCODE_EANX</code></td>
<td style="text-align: left;">EAN (EAN-2, EAN-5, EAN-8 and EAN-13)</td>
</tr>
<tr>
<td style="text-align: left;">14</td>
<td style="text-align: left;"><code>BARCODE_EANX_CHK</code></td>
<td style="text-align: left;">EAN + Check Digit</td>
</tr>
<tr>
<td style="text-align: left;">16<code>*</code></td>
<td style="text-align: left;"><code>BARCODE_GS1_128</code></td>
<td style="text-align: left;">GS1-128 (UCC.EAN-128)</td>
</tr>
<tr>
<td style="text-align: left;">18</td>
<td style="text-align: left;"><code>BARCODE_CODABAR</code></td>
<td style="text-align: left;">Codabar</td>
</tr>
<tr>
<td style="text-align: left;">20</td>
<td style="text-align: left;"><code>BARCODE_CODE128</code></td>
<td style="text-align: left;">Code 128 (automatic Code Set
switching)</td>
</tr>
<tr>
<td style="text-align: left;">21</td>
<td style="text-align: left;"><code>BARCODE_DPLEIT</code></td>
<td style="text-align: left;">Deutsche Post Leitcode</td>
</tr>
<tr>
<td style="text-align: left;">22</td>
<td style="text-align: left;"><code>BARCODE_DPIDENT</code></td>
<td style="text-align: left;">Deutsche Post Identcode</td>
</tr>
<tr>
<td style="text-align: left;">23</td>
<td style="text-align: left;"><code>BARCODE_CODE16K</code></td>
<td style="text-align: left;">Code 16K</td>
</tr>
<tr>
<td style="text-align: left;">24</td>
<td style="text-align: left;"><code>BARCODE_CODE49</code></td>
<td style="text-align: left;">Code 49</td>
</tr>
<tr>
<td style="text-align: left;">25</td>
<td style="text-align: left;"><code>BARCODE_CODE93</code></td>
<td style="text-align: left;">Code 93</td>
</tr>
<tr>
<td style="text-align: left;">28</td>
<td style="text-align: left;"><code>BARCODE_FLAT</code></td>
<td style="text-align: left;">Flattermarken</td>
</tr>
<tr>
<td style="text-align: left;">29<code>*</code></td>
<td style="text-align: left;"><code>BARCODE_DBAR_OMN</code></td>
<td style="text-align: left;">GS1 DataBar Omnidirectional (including GS1
DataBar Truncated)</td>
</tr>
<tr>
<td style="text-align: left;">30<code>*</code></td>
<td style="text-align: left;"><code>BARCODE_DBAR_LTD</code></td>
<td style="text-align: left;">GS1 DataBar Limited</td>
</tr>
<tr>
<td style="text-align: left;">31<code>*</code></td>
<td style="text-align: left;"><code>BARCODE_DBAR_EXP</code></td>
<td style="text-align: left;">GS1 DataBar Expanded</td>
</tr>
<tr>
<td style="text-align: left;">32</td>
<td style="text-align: left;"><code>BARCODE_TELEPEN</code></td>
<td style="text-align: left;">Telepen Alpha</td>
</tr>
<tr>
<td style="text-align: left;">34</td>
<td style="text-align: left;"><code>BARCODE_UPCA</code></td>
<td style="text-align: left;">UPC-A</td>
</tr>
<tr>
<td style="text-align: left;">35</td>
<td style="text-align: left;"><code>BARCODE_UPCA_CHK</code></td>
<td style="text-align: left;">UPC-A + Check Digit</td>
</tr>
<tr>
<td style="text-align: left;">37</td>
<td style="text-align: left;"><code>BARCODE_UPCE</code></td>
<td style="text-align: left;">UPC-E</td>
</tr>
<tr>
<td style="text-align: left;">38</td>
<td style="text-align: left;"><code>BARCODE_UPCE_CHK</code></td>
<td style="text-align: left;">UPC-E + Check Digit</td>
</tr>
<tr>
<td style="text-align: left;">40</td>
<td style="text-align: left;"><code>BARCODE_POSTNET</code></td>
<td style="text-align: left;">POSTNET</td>
</tr>
<tr>
<td style="text-align: left;">47</td>
<td style="text-align: left;"><code>BARCODE_MSI_PLESSEY</code></td>
<td style="text-align: left;">MSI Plessey</td>
</tr>
<tr>
<td style="text-align: left;">49</td>
<td style="text-align: left;"><code>BARCODE_FIM</code></td>
<td style="text-align: left;">FIM</td>
</tr>
<tr>
<td style="text-align: left;">50</td>
<td style="text-align: left;"><code>BARCODE_LOGMARS</code></td>
<td style="text-align: left;">LOGMARS</td>
</tr>
<tr>
<td style="text-align: left;">51</td>
<td style="text-align: left;"><code>BARCODE_PHARMA</code></td>
<td style="text-align: left;">Pharmacode One-Track</td>
</tr>
<tr>
<td style="text-align: left;">52</td>
<td style="text-align: left;"><code>BARCODE_PZN</code></td>
<td style="text-align: left;">PZN</td>
</tr>
<tr>
<td style="text-align: left;">53</td>
<td style="text-align: left;"><code>BARCODE_PHARMA_TWO</code></td>
<td style="text-align: left;">Pharmacode Two-Track</td>
</tr>
<tr>
<td style="text-align: left;">54</td>
<td style="text-align: left;"><code>BARCODE_CEPNET</code></td>
<td style="text-align: left;">Brazilian CEPNet</td>
</tr>
<tr>
<td style="text-align: left;">55</td>
<td style="text-align: left;"><code>BARCODE_PDF417</code></td>
<td style="text-align: left;">PDF417</td>
</tr>
<tr>
<td style="text-align: left;">56<code>*</code></td>
<td style="text-align: left;"><code>BARCODE_PDF417COMP</code></td>
<td style="text-align: left;">Compact PDF417 (Truncated PDF417)</td>
</tr>
<tr>
<td style="text-align: left;">57</td>
<td style="text-align: left;"><code>BARCODE_MAXICODE</code></td>
<td style="text-align: left;">MaxiCode</td>
</tr>
<tr>
<td style="text-align: left;">58</td>
<td style="text-align: left;"><code>BARCODE_QRCODE</code></td>
<td style="text-align: left;">QR Code</td>
</tr>
<tr>
<td style="text-align: left;">60</td>
<td style="text-align: left;"><code>BARCODE_CODE128AB</code></td>
<td style="text-align: left;">Code 128 (Suppress Code Set C)</td>
</tr>
<tr>
<td style="text-align: left;">63</td>
<td style="text-align: left;"><code>BARCODE_AUSPOST</code></td>
<td style="text-align: left;">Australia Post Standard Customer</td>
</tr>
<tr>
<td style="text-align: left;">66</td>
<td style="text-align: left;"><code>BARCODE_AUSREPLY</code></td>
<td style="text-align: left;">Australia Post Reply Paid</td>
</tr>
<tr>
<td style="text-align: left;">67</td>
<td style="text-align: left;"><code>BARCODE_AUSROUTE</code></td>
<td style="text-align: left;">Australia Post Routing</td>
</tr>
<tr>
<td style="text-align: left;">68</td>
<td style="text-align: left;"><code>BARCODE_AUSDIRECT</code></td>
<td style="text-align: left;">Australia Post Redirection</td>
</tr>
<tr>
<td style="text-align: left;">69</td>
<td style="text-align: left;"><code>BARCODE_ISBNX</code></td>
<td style="text-align: left;">ISBN (EAN-13 with verification stage)</td>
</tr>
<tr>
<td style="text-align: left;">70</td>
<td style="text-align: left;"><code>BARCODE_RM4SCC</code></td>
<td style="text-align: left;">Royal Mail 4-State Customer Code
(RM4SCC)</td>
</tr>
<tr>
<td style="text-align: left;">71</td>
<td style="text-align: left;"><code>BARCODE_DATAMATRIX</code></td>
<td style="text-align: left;">Data Matrix (ECC 200)</td>
</tr>
<tr>
<td style="text-align: left;">72</td>
<td style="text-align: left;"><code>BARCODE_EAN14</code></td>
<td style="text-align: left;">EAN-14</td>
</tr>
<tr>
<td style="text-align: left;">73</td>
<td style="text-align: left;"><code>BARCODE_VIN</code></td>
<td style="text-align: left;">Vehicle Identification Number</td>
</tr>
<tr>
<td style="text-align: left;">74</td>
<td style="text-align: left;"><code>BARCODE_CODABLOCKF</code></td>
<td style="text-align: left;">Codablock-F</td>
</tr>
<tr>
<td style="text-align: left;">75</td>
<td style="text-align: left;"><code>BARCODE_NVE18</code></td>
<td style="text-align: left;">NVE-18 (SSCC-18)</td>
</tr>
<tr>
<td style="text-align: left;">76</td>
<td style="text-align: left;"><code>BARCODE_JAPANPOST</code></td>
<td style="text-align: left;">Japanese Postal Code</td>
</tr>
<tr>
<td style="text-align: left;">77</td>
<td style="text-align: left;"><code>BARCODE_KOREAPOST</code></td>
<td style="text-align: left;">Korea Post</td>
</tr>
<tr>
<td style="text-align: left;">79<code>*</code></td>
<td style="text-align: left;"><code>BARCODE_DBAR_STK</code></td>
<td style="text-align: left;">GS1 DataBar Stacked</td>
</tr>
<tr>
<td style="text-align: left;">80<code>*</code></td>
<td style="text-align: left;"><code>BARCODE_DBAR_OMNSTK</code></td>
<td style="text-align: left;">GS1 DataBar Stacked Omnidirectional</td>
</tr>
<tr>
<td style="text-align: left;">81<code>*</code></td>
<td style="text-align: left;"><code>BARCODE_DBAR_EXPSTK</code></td>
<td style="text-align: left;">GS1 DataBar Expanded Stacked</td>
</tr>
<tr>
<td style="text-align: left;">82</td>
<td style="text-align: left;"><code>BARCODE_PLANET</code></td>
<td style="text-align: left;">PLANET</td>
</tr>
<tr>
<td style="text-align: left;">84</td>
<td style="text-align: left;"><code>BARCODE_MICROPDF417</code></td>
<td style="text-align: left;">MicroPDF417</td>
</tr>
<tr>
<td style="text-align: left;">85<code>*</code></td>
<td style="text-align: left;"><code>BARCODE_USPS_IMAIL</code></td>
<td style="text-align: left;">USPS Intelligent Mail (OneCode)</td>
</tr>
<tr>
<td style="text-align: left;">86</td>
<td style="text-align: left;"><code>BARCODE_PLESSEY</code></td>
<td style="text-align: left;">UK Plessey</td>
</tr>
<tr>
<td style="text-align: left;">87</td>
<td style="text-align: left;"><code>BARCODE_TELEPEN_NUM</code></td>
<td style="text-align: left;">Telepen Numeric</td>
</tr>
<tr>
<td style="text-align: left;">89</td>
<td style="text-align: left;"><code>BARCODE_ITF14</code></td>
<td style="text-align: left;">ITF-14</td>
</tr>
<tr>
<td style="text-align: left;">90</td>
<td style="text-align: left;"><code>BARCODE_KIX</code></td>
<td style="text-align: left;">Dutch Post KIX Code</td>
</tr>
<tr>
<td style="text-align: left;">92</td>
<td style="text-align: left;"><code>BARCODE_AZTEC</code></td>
<td style="text-align: left;">Aztec Code</td>
</tr>
<tr>
<td style="text-align: left;">93</td>
<td style="text-align: left;"><code>BARCODE_DAFT</code></td>
<td style="text-align: left;">DAFT Code</td>
</tr>
<tr>
<td style="text-align: left;">96</td>
<td style="text-align: left;"><code>BARCODE_DPD</code></td>
<td style="text-align: left;">DPD Code</td>
</tr>
<tr>
<td style="text-align: left;">97</td>
<td style="text-align: left;"><code>BARCODE_MICROQR</code></td>
<td style="text-align: left;">Micro QR Code</td>
</tr>
<tr>
<td style="text-align: left;">98</td>
<td style="text-align: left;"><code>BARCODE_HIBC_128</code></td>
<td style="text-align: left;">HIBC Code 128</td>
</tr>
<tr>
<td style="text-align: left;">99</td>
<td style="text-align: left;"><code>BARCODE_HIBC_39</code></td>
<td style="text-align: left;">HIBC Code 39</td>
</tr>
<tr>
<td style="text-align: left;">102</td>
<td style="text-align: left;"><code>BARCODE_HIBC_DM</code></td>
<td style="text-align: left;">HIBC Data Matrix</td>
</tr>
<tr>
<td style="text-align: left;">104</td>
<td style="text-align: left;"><code>BARCODE_HIBC_QR</code></td>
<td style="text-align: left;">HIBC QR Code</td>
</tr>
<tr>
<td style="text-align: left;">106</td>
<td style="text-align: left;"><code>BARCODE_HIBC_PDF</code></td>
<td style="text-align: left;">HIBC PDF417</td>
</tr>
<tr>
<td style="text-align: left;">108</td>
<td style="text-align: left;"><code>BARCODE_HIBC_MICPDF</code></td>
<td style="text-align: left;">HIBC MicroPDF417</td>
</tr>
<tr>
<td style="text-align: left;">110</td>
<td style="text-align: left;"><code>BARCODE_HIBC_BLOCKF</code></td>
<td style="text-align: left;">HIBC Codablock-F</td>
</tr>
<tr>
<td style="text-align: left;">112</td>
<td style="text-align: left;"><code>BARCODE_HIBC_AZTEC</code></td>
<td style="text-align: left;">HIBC Aztec Code</td>
</tr>
<tr>
<td style="text-align: left;">115</td>
<td style="text-align: left;"><code>BARCODE_DOTCODE</code></td>
<td style="text-align: left;">DotCode</td>
</tr>
<tr>
<td style="text-align: left;">116</td>
<td style="text-align: left;"><code>BARCODE_HANXIN</code></td>
<td style="text-align: left;">Han Xin (Chinese Sensible) Code</td>
</tr>
<tr>
<td style="text-align: left;">119</td>
<td style="text-align: left;"><code>BARCODE_MAILMARK_2D</code></td>
<td style="text-align: left;">Royal Mail 2D Mailmark (CMDM) (Data
Matrix)</td>
</tr>
<tr>
<td style="text-align: left;">121</td>
<td style="text-align: left;"><code>BARCODE_MAILMARK_4S</code></td>
<td style="text-align: left;">Royal Mail 4-State Mailmark</td>
</tr>
<tr>
<td style="text-align: left;">128</td>
<td style="text-align: left;"><code>BARCODE_AZRUNE</code></td>
<td style="text-align: left;">Aztec Runes</td>
</tr>
<tr>
<td style="text-align: left;">129</td>
<td style="text-align: left;"><code>BARCODE_CODE32</code></td>
<td style="text-align: left;">Code 32</td>
</tr>
<tr>
<td style="text-align: left;">130</td>
<td style="text-align: left;"><code>BARCODE_EANX_CC</code></td>
<td style="text-align: left;">GS1 Composite Symbol with EAN linear
component</td>
</tr>
<tr>
<td style="text-align: left;">131<code>*</code></td>
<td style="text-align: left;"><code>BARCODE_GS1_128_CC</code></td>
<td style="text-align: left;">GS1 Composite Symbol with GS1-128 linear
component</td>
</tr>
<tr>
<td style="text-align: left;">132<code>*</code></td>
<td style="text-align: left;"><code>BARCODE_DBAR_OMN_CC</code></td>
<td style="text-align: left;">GS1 Composite Symbol with GS1 DataBar
Omnidirectional linear component</td>
</tr>
<tr>
<td style="text-align: left;">133<code>*</code></td>
<td style="text-align: left;"><code>BARCODE_DBAR_LTD_CC</code></td>
<td style="text-align: left;">GS1 Composite Symbol with GS1 DataBar
Limited linear component</td>
</tr>
<tr>
<td style="text-align: left;">134<code>*</code></td>
<td style="text-align: left;"><code>BARCODE_DBAR_EXP_CC</code></td>
<td style="text-align: left;">GS1 Composite Symbol with GS1 DataBar
Expanded linear component</td>
</tr>
<tr>
<td style="text-align: left;">135</td>
<td style="text-align: left;"><code>BARCODE_UPCA_CC</code></td>
<td style="text-align: left;">GS1 Composite Symbol with UPC-A linear
component</td>
</tr>
<tr>
<td style="text-align: left;">136</td>
<td style="text-align: left;"><code>BARCODE_UPCE_CC</code></td>
<td style="text-align: left;">GS1 Composite Symbol with UPC-E linear
component</td>
</tr>
<tr>
<td style="text-align: left;">137<code>*</code></td>
<td style="text-align: left;"><code>BARCODE_DBAR_STK_CC</code></td>
<td style="text-align: left;">GS1 Composite Symbol with GS1 DataBar
Stacked component</td>
</tr>
<tr>
<td style="text-align: left;">138<code>*</code></td>
<td style="text-align: left;"><code>BARCODE_DBAR_OMNSTK_CC</code></td>
<td style="text-align: left;">GS1 Composite Symbol with GS1 DataBar
Stacked Omnidirectional component</td>
</tr>
<tr>
<td style="text-align: left;">139<code>*</code></td>
<td style="text-align: left;"><code>BARCODE_DBAR_EXPSTK_CC</code></td>
<td style="text-align: left;">GS1 Composite Symbol with GS1 DataBar
Expanded Stacked component</td>
</tr>
<tr>
<td style="text-align: left;">140</td>
<td style="text-align: left;"><code>BARCODE_CHANNEL</code></td>
<td style="text-align: left;">Channel Code</td>
</tr>
<tr>
<td style="text-align: left;">141</td>
<td style="text-align: left;"><code>BARCODE_CODEONE</code></td>
<td style="text-align: left;">Code One</td>
</tr>
<tr>
<td style="text-align: left;">142</td>
<td style="text-align: left;"><code>BARCODE_GRIDMATRIX</code></td>
<td style="text-align: left;">Grid Matrix</td>
</tr>
<tr>
<td style="text-align: left;">143</td>
<td style="text-align: left;"><code>BARCODE_UPNQR</code></td>
<td style="text-align: left;">UPNQR (Univerzalnega Plačilnega Naloga
QR)</td>
</tr>
<tr>
<td style="text-align: left;">144</td>
<td style="text-align: left;"><code>BARCODE_ULTRA</code></td>
<td style="text-align: left;">Ultracode</td>
</tr>
<tr>
<td style="text-align: left;">145</td>
<td style="text-align: left;"><code>BARCODE_RMQR</code></td>
<td style="text-align: left;">Rectangular Micro QR Code (rMQR)</td>
</tr>
<tr>
<td style="text-align: left;">146</td>
<td style="text-align: left;"><code>BARCODE_BC412</code></td>
<td style="text-align: left;">IBM BC412 (SEMI T1-95)</td>
</tr>
<tr>
<td style="text-align: left;">147</td>
<td style="text-align: left;"><code>BARCODE_DXFILMEDGE</code></td>
<td style="text-align: left;">DX Film Edge Barcode</td>
</tr>
</tbody>
</table>
</div>
<h2 id="adjusting-height">4.4 Adjusting Height</h2>
<p>The height of a symbol (except those with a fixed width-to-height
ratio) can be adjusted using the <code>--height</code> switch. For
example:</p>
<div class="sourceCode" id="cb23"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb23-1"><a href="#cb23-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">--height</span><span class="op">=</span>100 <span class="at">-d</span> <span class="st">&quot;This Text&quot;</span></span></code></pre></div>
<p>This specifies a symbol height of 100 times the X-dimension of the
symbol.</p>
<p>The default height of most linear barcodes is 50.0X, but this can be
changed for barcodes whose specifications give a standard height by
using the switch <code>--compliantheight</code>. For instance</p>
<div class="sourceCode" id="cb24"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb24-1"><a href="#cb24-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> LOGMARS <span class="at">-d</span> <span class="st">&quot;This Text&quot;</span> <span class="at">--compliantheight</span></span></code></pre></div>
<p>will produce a barcode of height 45.455X instead of the normal
default of 50.0X. The flag also causes Zint to return a warning if a
non-compliant height is given:</p>
<div class="sourceCode" id="cb25"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb25-1"><a href="#cb25-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> LOGMARS <span class="at">-d</span> <span class="st">&quot;This Text&quot;</span> <span class="at">--compliantheight</span> <span class="at">--height</span><span class="op">=</span>6.2</span>
<span id="cb25-2"><a href="#cb25-2" aria-hidden="true" tabindex="-1"></a><span class="ex">Warning</span> 247: Height not compliant with standards</span></code></pre></div>
<p>Another switch is <code>--heightperrow</code>, which can be useful
for symbologies that have a variable number of linear rows, namely
Codablock-F, Code 16K, Code 49, GS1 DataBar Expanded Stacked,
MicroPDF417 and PDF417, as it changes the treatment of the height value
from overall height to per-row height, allowing you to specify a
consistent height for each linear row without having to know how many
there are. For instance</p>
<div class="sourceCode" id="cb26"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb26-1"><a href="#cb26-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> PDF417 <span class="at">-d</span> <span class="st">&quot;This Text&quot;</span> <span class="at">--height</span><span class="op">=</span>4 <span class="at">--heightperrow</span></span></code></pre></div>
<figure>
<img src="images/pdf417_heightperrow.svg" title="fig:" class="lin"
alt="zint -b PDF417 -d &quot;This Text&quot; --height=4 --heightperrow" />
<figcaption
aria-hidden="true"><code>zint -b PDF417 -d "This Text" --height=4 --heightperrow</code></figcaption>
</figure>
<p>will produce a barcode of height 32X, with each of the 8 rows 4X
high.</p>
<h2 id="adjusting-whitespace">4.5 Adjusting Whitespace</h2>
<p>The amount of horizontal whitespace to the left and right of the
generated barcode can be altered using the <code>-w</code> or
<code>--whitesp</code> switch, in integral multiples of the X-dimension.
For example:</p>
<div class="sourceCode" id="cb27"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb27-1"><a href="#cb27-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-w</span> 10 <span class="at">-d</span> <span class="st">&quot;This Text&quot;</span></span></code></pre></div>
<p>This specifies a whitespace width of 10 times the X-dimension of the
symbol both to the left and to the right of the barcode.</p>
<p>The amount of vertical whitespace above and below the barcode can be
altered using the <code>--vwhitesp</code> switch, in integral multiples
of the X-dimension. For example for 3 times the X-dimension:</p>
<div class="sourceCode" id="cb28"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb28-1"><a href="#cb28-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">--vwhitesp</span><span class="op">=</span>3 <span class="at">-d</span> <span class="st">&quot;This Text&quot;</span></span></code></pre></div>
<p>Note that the whitespace at the bottom appears below the text, if
any.</p>
<p>Horizontal and vertical whitespace can of course be used
together:</p>
<div class="sourceCode" id="cb29"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb29-1"><a href="#cb29-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> DATAMATRIX <span class="at">--whitesp</span><span class="op">=</span>1 <span class="at">--vwhitesp</span><span class="op">=</span>1 <span class="at">-d</span> <span class="st">&quot;This Text&quot;</span></span></code></pre></div>
<p>A <code>--quietzones</code> option is also available which adds quiet
zones compliant with the symbology’s specification. This is in addition
to any whitespace specified with the <code>--whitesp</code> or
<code>--vwhitesp</code> switches.</p>
<p>Note that Codablock-F, Code 16K, Code 49, ITF-14, EAN-2 to EAN-13,
ISBN, UPC-A and UPC-E have compliant quiet zones added by default. This
can be disabled with the option <code>--noquietzones</code>.</p>
<h2 id="adding-boundary-bars-and-boxes">4.6 Adding Boundary Bars and
Boxes</h2>
<p>Zint allows the symbol to be bound with ‘boundary bars’ (also known
as ‘bearer bars’) using the option <code>--bind</code>. These bars help
to prevent misreading of the symbol by corrupting a scan if the scanning
beam strays off the top or bottom of the symbol. Zint can also put a
border right around the symbol and its horizontal whitespace with the
<code>--box</code> option.</p>
<p>The width of the boundary bars or box borders, in integral multiples
of the X-dimension, must be specified using the <code>--border</code>
switch. For example:</p>
<div class="sourceCode" id="cb30"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb30-1"><a href="#cb30-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">--box</span> <span class="at">--border</span><span class="op">=</span>10 <span class="at">-w</span> 10 <span class="at">-d</span> <span class="st">&quot;This Text&quot;</span></span></code></pre></div>
<figure>
<img src="images/code128_box.svg" title="fig:" class="lin"
alt="zint --border=10 --box -d &quot;This Text&quot; -w 10" />
<figcaption
aria-hidden="true"><code>zint --border=10 --box -d "This Text" -w 10</code></figcaption>
</figure>
<p>gives a box with a width 10 times the X-dimension of the symbol. Note
that when specifying a box, horizontal whitespace is usually required in
order to create a quiet zone between the barcode and the sides of the
box. To add a boundary bar to the top only use
<code>--bindtop</code>.</p>
<p>For linear symbols, horizontal boundary bars appear tight against the
barcode, inside any vertical whitespace (or text). For matrix symbols,
however, where they are decorative rather than functional, boundary bars
appear outside any whitespace.</p>
<figure>
<img src="images/qrcode_box.svg" title="fig:" class="i2d"
alt="zint -b QRCODE --border=1 --box -d &quot;This Text&quot; --quietzones" />
<figcaption
aria-hidden="true"><code>zint -b QRCODE --border=1 --box -d "This Text" --quietzones</code></figcaption>
</figure>
<p>Codablock-F, Code 16K and Code 49 always have boundary bars, and
default to particular horizontal whitespace values. Special
considerations apply to ITF-14 and DPD - see <a href="#itf-14">6.1.2.6
ITF-14</a> and <a href="#dpd-code">6.1.10.7 DPD Code</a> for those
symbologies.</p>
<h2 id="using-colour">4.7 Using Colour</h2>
<p>The default colours of a symbol are a black symbol on a white
background. Zint allows you to change this. The <code>-r</code> or
<code>--reverse</code> switch allows the default colours to be inverted
so that a white symbol is shown on a black background (known as
“reflectance reversal” or “reversed reflectance”). For example the
command</p>
<div class="sourceCode" id="cb31"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb31-1"><a href="#cb31-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-r</span> <span class="at">-d</span> <span class="st">&quot;This Text&quot;</span></span></code></pre></div>
<p>gives an inverted Code 128 symbol. This is not practical for most
symbologies but white-on-black is allowed by the Aztec Code, Data
Matrix, DotCode, Han Xin Code, Grid Matrix and QR Code symbology
specifications.</p>
<p>For more specific needs the foreground (ink) and background (paper)
colours can be specified using the <code>--fg</code> and
<code>--bg</code> options followed by a number in <code>"RRGGBB"</code>
hexadecimal notation (the same system used in HTML) or in
<code>"C,M,Y,K"</code> decimal percentages format (the latter normally
used with the <code>--cmyk</code> option - see below). For example the
command</p>
<div class="sourceCode" id="cb32"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb32-1"><a href="#cb32-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">--fg</span><span class="op">=</span>00FF00 <span class="at">-d</span> <span class="st">&quot;This Text&quot;</span></span></code></pre></div>
<p>alters the symbol to a bright green.</p>
<figure>
<img src="images/code128_green.svg" title="fig:" class="lin"
alt="zint -d &quot;This Text&quot; --fg=00FF00" />
<figcaption
aria-hidden="true"><code>zint -d "This Text" --fg=00FF00</code></figcaption>
</figure>
<p>Zint also supports RGBA colour information for those output file
formats which support alpha channels (currently only GIF, PCX, PNG, SVG
and TIF, with GIF supporting either a background or foreground alpha but
not both) in a <code>"RRGGBBAA"</code> format. For example:</p>
<div class="sourceCode" id="cb33"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb33-1"><a href="#cb33-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">--fg</span><span class="op">=</span>00ff0055 <span class="at">-d</span> <span class="st">&quot;This Text&quot;</span></span></code></pre></div>
<figure>
<img src="images/code128_green_alpha.svg" title="fig:" class="lin"
alt="zint -d &quot;This Text&quot; --fg=00FF0055" />
<figcaption
aria-hidden="true"><code>zint -d "This Text" --fg=00FF0055</code></figcaption>
</figure>
<p>will produce a semi-transparent green foreground with a standard
(white) background. Note that transparency is treated differently by
raster and vector (SVG) output formats, as for vector output the
background will “shine through” a transparent foreground. For
instance</p>
<div class="sourceCode" id="cb34"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb34-1"><a href="#cb34-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">--bg</span><span class="op">=</span>ff0000 <span class="at">--fg</span><span class="op">=</span>ffffff00 ...</span></code></pre></div>
<p>will give different results for PNG and SVG. Experimentation is
advised!</p>
<p>In addition the <code>--nobackground</code> option will remove the
background from all output formats except BMP.<a href="#fn4"
class="footnote-ref" id="fnref4" role="doc-noteref"><sup>4</sup></a></p>
<p>The <code>--cmyk</code> option is specific to output in Encapsulated
PostScript (EPS) and TIF, and selects the CMYK colour space. Custom
colours should then usually be given in the comma-separated
<code>"C,M,Y,K"</code> format, where <code>C</code>, <code>M</code>,
<code>Y</code> and <code>K</code> are expressed as decimal percentage
values from 0 to 100. RGB values may still be used, in which case they
will be converted formulaically to CMYK approximations.</p>
<h2 id="rotating-the-symbol">4.8 Rotating the Symbol</h2>
<p>The symbol can be rotated through four orientations using the
<code>--rotate</code> option followed by the angle of rotation as shown
below.</p>
<pre><code>--rotate=0 (default)
--rotate=90
--rotate=180
--rotate=270</code></pre>
<figure>
<img src="images/code128_rotate90.svg" title="fig:" class="lin"
alt="zint -d &quot;This Text&quot; --rotate=90" />
<figcaption
aria-hidden="true"><code>zint -d "This Text" --rotate=90</code></figcaption>
</figure>
<h2 id="adjusting-image-size-x-dimension">4.9 Adjusting Image Size
(X-dimension)</h2>
<p>The size of the image can be altered using the <code>--scale</code>
option, which sets the X-dimension. The default scale is 1.0.</p>
<p>The scale is multiplied by 2 (with the exception of MaxiCode) before
being applied to the X-dimension. For MaxiCode, it is multiplied by 10
for raster output, by 40 for EMF vector output, and by 2 otherwise
(non-EMF vector output).</p>
<p>For non-MaxiCode raster output, the default scale of 1 results in an
X-dimension of 2 pixels. For example for non-MaxiCode PNG images a scale
of 5 will increase the X-dimension to 10 pixels. For MaxiCode, see <a
href="#maxicode-raster-scaling">4.9.3 MaxiCode Raster Scaling</a>
below.</p>
<p>Scales for non-MaxiCode raster output should be given in increments
of 0.5, i.e. 0.5, 1, 1.5, 2, 2.5, 3, 3.5, etc., to avoid the X-dimension
varying across the symbol due to interpolation. 0.5 increments are also
faster to render.</p>
<p>The minimum scale for non-MaxiCode raster output in non-dotty mode is
0.5, giving a minimum X-dimension of 1 pixel. For MaxiCode, it is 0.2.
The minimum scale for raster output in dotty mode is 1 (see <a
href="#working-with-dots">4.15 Working with Dots</a>). For raster
output, text will not be printed for scales less than 1.</p>
<p>The minimum scale for vector output is 0.1, giving a minimum
X-dimension of 0.2 (or for MaxiCode EMF output, 4). The maximum scale
for both raster and vector is 200.</p>
<p>To summarize the more intricate details:</p>
<div id="tbl:scaling_multiplers" class="tablenos">
<table id="tbl:scaling_multiplers" style="width:92%;"
data-tag=": Scaling Multipliers and Minima">
<caption><span>Table : Scaling Multipliers and Minima</span> </caption>
<colgroup>
<col style="width: 15%" />
<col style="width: 25%" />
<col style="width: 16%" />
<col style="width: 19%" />
<col style="width: 15%" />
</colgroup>
<thead>
<tr>
<th>MaxiCode?</th>
<th style="text-align: left;">Output</th>
<th>Multiplier</th>
<th style="text-align: left;">Min. Scale (non-dotty)</th>
<th style="text-align: left;">Min. Scale (dotty)</th>
</tr>
</thead>
<tbody>
<tr>
<td>No</td>
<td style="text-align: left;">Raster</td>
<td>2</td>
<td style="text-align: left;">0.5</td>
<td style="text-align: left;">1</td>
</tr>
<tr>
<td>No</td>
<td style="text-align: left;">Vector</td>
<td>2</td>
<td style="text-align: left;">0.1</td>
<td style="text-align: left;">0.1</td>
</tr>
<tr>
<td>Yes</td>
<td style="text-align: left;">Raster</td>
<td>10</td>
<td style="text-align: left;">0.2</td>
<td style="text-align: left;">N/A</td>
</tr>
<tr>
<td>Yes</td>
<td style="text-align: left;">Vector (non-EMF)</td>
<td>2</td>
<td style="text-align: left;">0.1</td>
<td style="text-align: left;">N/A</td>
</tr>
<tr>
<td>Yes</td>
<td style="text-align: left;">EMF</td>
<td>40</td>
<td style="text-align: left;">0.1</td>
<td style="text-align: left;">N/A</td>
</tr>
</tbody>
</table>
</div>
<h3 id="scaling-by-x-dimension-and-resolution">4.9.1 Scaling by
X-dimension and Resolution</h3>
<p>An alternative way to specify the scale, which takes the above
details into account, is to specify measurable units using the
<code>--scalexdimdp</code> option, which has the format</p>
<pre><code>--scalexdimdp=X[,R]</code></pre>
<p>where <code>X</code> is the X-dimension (in mm by default) and
<code>R</code> is the resolution (in dpmm, dots per mm, by default).
<code>R</code> is optional, and defaults to 12 dpmm, and <code>X</code>
may be zero, in which case it uses a symbology-specific default. The
units may be given in inches for <code>X</code> by appending
<code>"in"</code>, and in dpi (dots per inch) for <code>R</code> by
appending <code>"dpi"</code>. For example</p>
<div class="sourceCode" id="cb37"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb37-1"><a href="#cb37-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-d</span> <span class="st">&quot;1234&quot;</span> <span class="at">--scalexdimdp</span><span class="op">=</span>0.013in,300dpi</span></code></pre></div>
<p>Explicit metric units may also be given by appending
<code>"mm"</code> and <code>"dpmm"</code> as appropriate, and may be
mixed with U.S. units:</p>
<div class="sourceCode" id="cb38"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb38-1"><a href="#cb38-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-d</span> <span class="st">&quot;1234&quot;</span> <span class="at">--scalexdimdp</span><span class="op">=</span>0.33mm,300dpi</span></code></pre></div>
<h3 id="scaling-example">4.9.2 Scaling Example</h3>
<p>The GS1 General Specifications Section 5.2.6.6 ‘Symbol dimensions at
nominal size’ gives an example of an EAN-13 barcode using the
X-dimension of 0.33mm. To print that example as a PNG at 12 dpmm, the
approximate equivalent of 300 dpi (<code>dpi = dpmm * 25.4</code>),
specify a scale of 2, since <code>0.33 * 12 = 3.96</code> pixels, or 4
pixels rounding to the nearest pixel:</p>
<div class="sourceCode" id="cb39"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb39-1"><a href="#cb39-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> EANX <span class="at">-d</span> <span class="st">&quot;501234567890&quot;</span> <span class="at">--compliantheight</span> <span class="at">--scale</span><span class="op">=</span>2</span></code></pre></div>
<p>This will result in output of 37.29mm x 25.56mm (WxH) at 12 dpmm. The
same result can be achieved using the <code>--scalexdimdp</code> option
with</p>
<div class="sourceCode" id="cb40"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb40-1"><a href="#cb40-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> EANX <span class="at">-d</span> <span class="st">&quot;501234567890&quot;</span> <span class="at">--compliantheight</span> <span class="at">--scalexdimdp</span><span class="op">=</span>0</span></code></pre></div>
<p>as 0.33mm is the default X-dimension for EAN, and 12 dpmm the default
resolution.</p>
<h3 id="maxicode-raster-scaling">4.9.3 MaxiCode Raster Scaling</h3>
<p>For MaxiCode symbols, which use hexagons, the scale for raster output
is multiplied by 10 before being applied. The 0.5 increment recommended
for normal raster output does not apply.</p>
<p>The minimum scale is 0.2, so the minimum X-dimension is 2 pixels.
However scales below 0.5 are not recommended and may produce symbols
that are not within the following size ranges.</p>
<p>MaxiCode symbols have fixed size ranges of 24.82mm to 27.93mm in
width, and 23.71mm to 26.69mm in height, excluding quiet zones. The
default X-dimension is 0.88mm. For example, to output at the default
X-dimension at 600 dpi specify:</p>
<div class="sourceCode" id="cb41"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb41-1"><a href="#cb41-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> MAXICODE <span class="at">-d</span> <span class="st">&quot;MaxiCode (19 chars)&quot;</span> <span class="at">--scalexdimdp</span><span class="op">=</span>0,600dpi</span></code></pre></div>
<h2 id="human-readable-text-hrt-options">4.10 Human Readable Text (HRT)
Options</h2>
<p>For linear barcodes the text present<a href="#fn5"
class="footnote-ref" id="fnref5" role="doc-noteref"><sup>5</sup></a> in
the output image can be removed by using the <code>--notext</code>
option. Note also that for raster output text will not be printed for
scales less than 1 (see <a href="#adjusting-image-size-x-dimension">4.9
Adjusting Image Size (X-dimension)</a>).</p>
<p>Text can be set to bold using the <code>--bold</code> option, or a
smaller font can be substituted using the <code>--small</code> option.
The <code>--bold</code> and <code>--small</code> options can be used
together if required, but only for vector output.</p>
<figure>
<img src="images/code128_small_bold.svg" title="fig:" class="lin"
alt="zint --bold -d &quot;This Text&quot; --small" />
<figcaption
aria-hidden="true"><code>zint --bold -d "This Text" --small</code></figcaption>
</figure>
<p>The gap between the barcode and the text can be adjusted using the
<code>--textgap</code> option, where the gap is given in X-dimensions,
and may be negative (minimum -5.0X, maximum 10.0X). The default gap is
1X. Note that a very small gap may cause accented texts to overlap with
the barcode:</p>
<figure>
<img src="images/code128_textgap.svg" title="fig:" class="lin"
alt="zint -d &quot;Áccent&quot; --textgap=0.1" />
<figcaption
aria-hidden="true"><code>zint -d "Áccent" --textgap=0.1</code></figcaption>
</figure>
<p>For SVG output, the font preferred by Zint (monospaced “OCR-B” for
EAN/UPC, “Arimo” - a proportional sans-serif font metrically compatible
with “Arial” - for all others) can be embedded in the file for
portability using the <code>--embedfont</code> option:</p>
<figure>
<img src="images/code128_embedfont.svg" title="fig:" class="lin"
alt="zint -d &quot;Áccent&quot; --embedfont" />
<figcaption
aria-hidden="true"><code>zint -d "Áccent" --embedfont</code></figcaption>
</figure>
<h2 id="input-modes">4.11 Input Modes</h2>
<h3 id="unicode-data-and-gs1-modes">4.11.1 Unicode, Data, and GS1
Modes</h3>
<p>By default all CLI input data is assumed to be encoded in UTF-8
format. Many barcode symbologies encode data using the Latin-1 (ISO/IEC
8859-1 plus ASCII) character set, so input is converted from UTF-8 to
Latin-1 before being put in the symbol. In addition QR Code and its
variants and Han Xin Code can by default encode Japanese (Kanji) or
Chinese (Hanzi) characters which are also converted from UTF-8.</p>
<p>There are two exceptions to the Latin-1 default: Grid Matrix, whose
default character set is GB 2312 (Chinese); and UPNQR, whose default
character set is Latin-2 (ISO/IEC 8859-2 plus ASCII).</p>
<div id="tbl:default_character_sets" class="tablenos">
<table id="tbl:default_character_sets"
data-tag=": Default Character Sets">
<caption><span>Table : Default Character Sets</span> </caption>
<thead>
<tr>
<th style="text-align: left;">Symbology</th>
<th style="text-align: left;">Default character sets</th>
<th>Alternate if input not Latin-1</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">Aztec Code</td>
<td style="text-align: left;">Latin-1</td>
<td>None</td>
</tr>
<tr>
<td style="text-align: left;">Codablock-F</td>
<td style="text-align: left;">Latin-1</td>
<td>None</td>
</tr>
<tr>
<td style="text-align: left;">Code 128</td>
<td style="text-align: left;">Latin-1</td>
<td>None</td>
</tr>
<tr>
<td style="text-align: left;">Code 16K</td>
<td style="text-align: left;">Latin-1</td>
<td>None</td>
</tr>
<tr>
<td style="text-align: left;">Code One</td>
<td style="text-align: left;">Latin-1</td>
<td>None</td>
</tr>
<tr>
<td style="text-align: left;">Data Matrix</td>
<td style="text-align: left;">Latin-1</td>
<td>None</td>
</tr>
<tr>
<td style="text-align: left;">DotCode</td>
<td style="text-align: left;">Latin-1</td>
<td>None</td>
</tr>
<tr>
<td style="text-align: left;">Grid Matrix</td>
<td style="text-align: left;">GB 2312 (includes ASCII)</td>
<td>N/A</td>
</tr>
<tr>
<td style="text-align: left;">Han Xin</td>
<td style="text-align: left;">Latin-1</td>
<td>GB 18030 (includes ASCII)</td>
</tr>
<tr>
<td style="text-align: left;">MaxiCode</td>
<td style="text-align: left;">Latin-1</td>
<td>None</td>
</tr>
<tr>
<td style="text-align: left;">MicroPDF417</td>
<td style="text-align: left;">Latin-1</td>
<td>None</td>
</tr>
<tr>
<td style="text-align: left;">Micro QR Code</td>
<td style="text-align: left;">Latin-1</td>
<td>Shift JIS (includes ASCII<a href="#fn6" class="footnote-ref"
id="fnref6" role="doc-noteref"><sup>6</sup></a>)</td>
</tr>
<tr>
<td style="text-align: left;">PDF417</td>
<td style="text-align: left;">Latin-1</td>
<td>None</td>
</tr>
<tr>
<td style="text-align: left;">QR Code</td>
<td style="text-align: left;">Latin-1</td>
<td>Shift JIS (see above)</td>
</tr>
<tr>
<td style="text-align: left;">rMQR</td>
<td style="text-align: left;">Latin-1</td>
<td>Shift JIS (see above)</td>
</tr>
<tr>
<td style="text-align: left;">Ultracode</td>
<td style="text-align: left;">Latin-1</td>
<td>None</td>
</tr>
<tr>
<td style="text-align: left;">UPNQR</td>
<td style="text-align: left;">Latin-2</td>
<td>N/A</td>
</tr>
<tr>
<td style="text-align: left;">All others</td>
<td style="text-align: left;">ASCII</td>
<td>N/A</td>
</tr>
</tbody>
</table>
</div>
<p>If Zint encounters characters which can not be encoded using the
default character encoding then it will take advantage of the ECI
(Extended Channel Interpretations) mechanism to encode the data if the
symbology supports it - see <a href="#input-modes-and-eci">4.11.2 Input
Modes and ECI</a> below.</p>
<p>GS1 data can be encoded in a number of symbologies. Application
Identifiers (AIs) should be enclosed in <code>[square brackets]</code>
followed by the data to be encoded (see <a href="#gs1-128">6.1.10.3
GS1-128</a>). To encode GS1 data use the <code>--gs1</code> option. GS1
mode is assumed (and doesn’t need to be set) for GS1-128, EAN-14, GS1
DataBar and GS1 Composite symbologies but is also available for Aztec
Code, Code 16K, Code 49, Code One, Data Matrix, DotCode, QR Code and
Ultracode.</p>
<p>Health Industry Barcode (HIBC) data may also be encoded in the
symbologies Aztec Code, Codablock-F, Code 128, Code 39, Data Matrix,
MicroPDF417, PDF417 and QR Code. Within this mode, the leading
<code>'+'</code> and the check character are automatically added by
Zint, conforming to HIBC Labeler Identification Code (HIBC LIC). For
HIBC Provider Applications Standard (HIBC PAS), preface the data with a
slash <code>'/'</code>.</p>
<p>The <code>--binary</code> option encodes the input data as given.
Automatic code page translation to an ECI page is disabled, and no
validation of the data’s encoding takes place. This may be used for raw
binary or binary encrypted data. This switch plays together with the
built-in ECI logic and examples may be found below.</p>
<p>The <code>--fullmultibyte</code> option uses the multibyte modes of
QR Code, Micro QR Code, Rectangular Micro QR Code, Han Xin Code and Grid
Matrix for non-ASCII data, maximizing density. This is achieved by using
compression designed for Kanji/Hanzi characters; however some decoders
take blocks which are encoded this way and interpret them as Kanji/Hanzi
characters, thus causing data corruption. Symbols encoded with this
option should be checked against decoders before they are used. The
popular open-source ZXing decoder is known to exhibit this
behaviour.</p>
<h3 id="input-modes-and-eci">4.11.2 Input Modes and ECI</h3>
<p>If your data contains characters that are not in the default
character set, you may encode it using an ECI-aware symbology and an ECI
value from Table <a href="#tbl:eci_codes">: ECI Codes</a> below. The ECI
information is added to your code symbol as prefix data. The symbologies
that support ECI are</p>
<div id="tbl:eci_aware_symbologies" class="tablenos">
<table id="tbl:eci_aware_symbologies"
data-tag=": ECI-Aware Symbologies">
<caption><span>Table : ECI-Aware Symbologies</span> </caption>
<tbody>
<tr>
<td style="text-align: left;">Aztec Code</td>
<td style="text-align: left;">Grid Matrix</td>
<td style="text-align: left;">PDF417</td>
</tr>
<tr>
<td style="text-align: left;">Code One</td>
<td style="text-align: left;">Han Xin Code</td>
<td style="text-align: left;">QR Code</td>
</tr>
<tr>
<td style="text-align: left;">Data Matrix</td>
<td style="text-align: left;">MaxiCode</td>
<td style="text-align: left;">rMQR</td>
</tr>
<tr>
<td style="text-align: left;">DotCode</td>
<td style="text-align: left;">MicroPDF417</td>
<td style="text-align: left;">Ultracode</td>
</tr>
</tbody>
</table>
</div>
<p>Be aware that not all barcode readers support ECI mode, so this can
sometimes lead to unreadable barcodes. If you are using characters
beyond those supported by the default character set then you should
check that the resulting barcode can be understood by your target
barcode reader.</p>
<p>The ECI value may be specified with the <code>--eci</code> switch,
followed by the value in the column <code>"ECI Code"</code> in the table
below. The input data should be UTF-8 formatted. Zint automatically
translates the data into the target encoding.</p>
<div id="tbl:eci_codes" class="tablenos">
<table id="tbl:eci_codes" data-tag=": ECI Codes">
<caption><span>Table : ECI Codes</span> </caption>
<thead>
<tr>
<th>ECI Code</th>
<th>Character Encoding Scheme (ISO/IEC 8859 schemes include ASCII)</th>
</tr>
</thead>
<tbody>
<tr>
<td>3</td>
<td>ISO/IEC 8859-1 - Latin alphabet No. 1</td>
</tr>
<tr>
<td>4</td>
<td>ISO/IEC 8859-2 - Latin alphabet No. 2</td>
</tr>
<tr>
<td>5</td>
<td>ISO/IEC 8859-3 - Latin alphabet No. 3</td>
</tr>
<tr>
<td>6</td>
<td>ISO/IEC 8859-4 - Latin alphabet No. 4</td>
</tr>
<tr>
<td>7</td>
<td>ISO/IEC 8859-5 - Latin/Cyrillic alphabet</td>
</tr>
<tr>
<td>8</td>
<td>ISO/IEC 8859-6 - Latin/Arabic alphabet</td>
</tr>
<tr>
<td>9</td>
<td>ISO/IEC 8859-7 - Latin/Greek alphabet</td>
</tr>
<tr>
<td>10</td>
<td>ISO/IEC 8859-8 - Latin/Hebrew alphabet</td>
</tr>
<tr>
<td>11</td>
<td>ISO/IEC 8859-9 - Latin alphabet No. 5 (Turkish)</td>
</tr>
<tr>
<td>12</td>
<td>ISO/IEC 8859-10 - Latin alphabet No. 6 (Nordic)</td>
</tr>
<tr>
<td>13</td>
<td>ISO/IEC 8859-11 - Latin/Thai alphabet</td>
</tr>
<tr>
<td>15</td>
<td>ISO/IEC 8859-13 - Latin alphabet No. 7 (Baltic)</td>
</tr>
<tr>
<td>16</td>
<td>ISO/IEC 8859-14 - Latin alphabet No. 8 (Celtic)</td>
</tr>
<tr>
<td>17</td>
<td>ISO/IEC 8859-15 - Latin alphabet No. 9</td>
</tr>
<tr>
<td>18</td>
<td>ISO/IEC 8859-16 - Latin alphabet No. 10</td>
</tr>
<tr>
<td>20</td>
<td>Shift JIS (JIS X 0208 and JIS X 0201)</td>
</tr>
<tr>
<td>21</td>
<td>Windows 1250 - Latin 2 (Central Europe)</td>
</tr>
<tr>
<td>22</td>
<td>Windows 1251 - Cyrillic</td>
</tr>
<tr>
<td>23</td>
<td>Windows 1252 - Latin 1</td>
</tr>
<tr>
<td>24</td>
<td>Windows 1256 - Arabic</td>
</tr>
<tr>
<td>25</td>
<td>UTF-16BE (High order byte first)</td>
</tr>
<tr>
<td>26</td>
<td>UTF-8</td>
</tr>
<tr>
<td>27</td>
<td>ASCII (ISO/IEC 646 IRV)</td>
</tr>
<tr>
<td>28</td>
<td>Big5 (Taiwan) Chinese Character Set</td>
</tr>
<tr>
<td>29</td>
<td>GB 2312 (PRC) Chinese Character Set</td>
</tr>
<tr>
<td>30</td>
<td>Korean Character Set EUC-KR (KS X 1001:2002)</td>
</tr>
<tr>
<td>31</td>
<td>GBK Chinese Character Set</td>
</tr>
<tr>
<td>32</td>
<td>GB 18030 Chinese Character Set</td>
</tr>
<tr>
<td>33</td>
<td>UTF-16LE (Low order byte first)</td>
</tr>
<tr>
<td>34</td>
<td>UTF-32BE (High order bytes first)</td>
</tr>
<tr>
<td>35</td>
<td>UTF-32LE (Low order bytes first)</td>
</tr>
<tr>
<td>170</td>
<td>ISO/IEC 646 Invariant<a href="#fn7" class="footnote-ref" id="fnref7"
role="doc-noteref"><sup>7</sup></a></td>
</tr>
<tr>
<td>899</td>
<td>8-bit binary data</td>
</tr>
</tbody>
</table>
</div>
<p>An ECI value of 0 does not encode any ECI information in the code
symbol (unless the data contains non-default character set characters).
In this case, the default character set applies (see Table <a
href="#tbl:default_character_sets">: Default Character Sets</a>
above).</p>
<p>If no ECI is specified or a value of 0 is given, and the data does
contain characters other than in the default character set, then Zint
will automatically insert the appropriate single-byte ECI if possible
(ECIs 3 to 24, excluding ECI 20), or failing that ECI 26 (UTF-8). A
warning will be generated. This mechanism is not applied if the
<code>--binary</code> option is given.</p>
<p>Multiple ECIs can be specified using the <code>--segN</code> options
- see <a href="#multiple-segments">4.16 Multiple Segments</a>.</p>
<p>Note: the <code>--eci=3</code> specification should only be used for
special purposes. Using this parameter, the ECI information is
explicitly added to the symbol. Nevertheless, for ECI Code 3, this is
not usually required, as this is the default encoding for most barcodes,
which is also active without any ECI information.</p>
<h4 id="input-modes-and-eci-example-1">4.11.2.1 Input Modes and ECI
Example 1</h4>
<p>The Euro sign U+20AC can be encoded in ISO/IEC 8859-15. The Euro sign
has the ISO/IEC 8859-15 codepoint hex <code>"A4"</code>. It is encoded
in UTF-8 as the hex sequence: <code>"E2 82 AC"</code>. Those 3 bytes are
contained in the file <code>"utf8euro.txt"</code>. This command will
generate the corresponding code:</p>
<div class="sourceCode" id="cb42"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb42-1"><a href="#cb42-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> 71 <span class="at">--scale</span><span class="op">=</span>10 <span class="at">--eci</span><span class="op">=</span>17 <span class="at">-i</span> utf8euro.txt</span></code></pre></div>
<p>This is equivalent to the commands (using the <code>--esc</code>
switch):</p>
<div class="sourceCode" id="cb43"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb43-1"><a href="#cb43-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> 71 <span class="at">--scale</span><span class="op">=</span>10 <span class="at">--eci</span><span class="op">=</span>17 <span class="at">--esc</span> <span class="at">-d</span> <span class="st">&quot;\xE2\x82\xAC&quot;</span></span>
<span id="cb43-2"><a href="#cb43-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb43-3"><a href="#cb43-3" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> 71 <span class="at">--scale</span><span class="op">=</span>10 <span class="at">--eci</span><span class="op">=</span>17 <span class="at">--esc</span> <span class="at">-d</span> <span class="st">&quot;\u20AC&quot;</span></span></code></pre></div>
<p>and to the command:</p>
<div class="sourceCode" id="cb44"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb44-1"><a href="#cb44-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> 71 <span class="at">--scale</span><span class="op">=</span>10 <span class="at">--eci</span><span class="op">=</span>17 <span class="at">-d</span> <span class="st">&quot;€&quot;</span></span></code></pre></div>
<figure>
<img src="images/datamatrix_euro.svg" title="fig:" class="i2d"
alt="zint -b DATAMATRIX --eci=17 -d &quot;€&quot;" />
<figcaption
aria-hidden="true"><code>zint -b DATAMATRIX --eci=17 -d "€"</code></figcaption>
</figure>
<h4 id="input-modes-and-eci-example-2">4.11.2.2 Input Modes and ECI
Example 2</h4>
<p>The Chinese character with the Unicode codepoint U+5E38 can be
encoded in Big5 encoding. The Big5 representation of this character is
the two hex bytes: <code>"B1 60"</code> (contained in the file
<code>"big5char.txt"</code>). The generation command for Data Matrix
is:</p>
<div class="sourceCode" id="cb45"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb45-1"><a href="#cb45-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> 71 <span class="at">--scale</span><span class="op">=</span>10 <span class="at">--eci</span><span class="op">=</span>28 <span class="at">--binary</span> <span class="at">-i</span> big5char.txt</span></code></pre></div>
<p>This is equivalent to the command (using the <code>--esc</code>
switch):</p>
<div class="sourceCode" id="cb46"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb46-1"><a href="#cb46-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> 71 <span class="at">--scale</span><span class="op">=</span>10 <span class="at">--eci</span><span class="op">=</span>28 <span class="at">--binary</span> <span class="at">--esc</span> <span class="at">-d</span> <span class="st">&quot;\xB1\x60&quot;</span></span></code></pre></div>
<p>and to the commands (no <code>--binary</code> switch so conversion
occurs):</p>
<div class="sourceCode" id="cb47"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb47-1"><a href="#cb47-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> 71 <span class="at">--scale</span><span class="op">=</span>10 <span class="at">--eci</span><span class="op">=</span>28 <span class="at">--esc</span> <span class="at">-d</span> <span class="st">&quot;\xE5\xB8\xB8&quot;</span></span>
<span id="cb47-2"><a href="#cb47-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb47-3"><a href="#cb47-3" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> 71 <span class="at">--scale</span><span class="op">=</span>10 <span class="at">--eci</span><span class="op">=</span>28 <span class="at">--esc</span> <span class="at">-d</span> <span class="st">&quot;\u5E38&quot;</span></span>
<span id="cb47-4"><a href="#cb47-4" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb47-5"><a href="#cb47-5" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> 71 <span class="at">--scale</span><span class="op">=</span>10 <span class="at">--eci</span><span class="op">=</span>28 <span class="at">-d</span> <span class="st">&quot;常&quot;</span></span></code></pre></div>
<figure>
<img src="images/datamatrix_big5.svg" title="fig:" class="i2d"
alt="zint -b DATAMATRIX --eci=28 -d &quot;\u5E38&quot; --esc" />
<figcaption
aria-hidden="true"><code>zint -b DATAMATRIX --eci=28 -d "\u5E38" --esc</code></figcaption>
</figure>
<h4 id="input-modes-and-eci-example-3">4.11.2.3 Input Modes and ECI
Example 3</h4>
<p>Some decoders (in particular mobile app ones) for QR Code assume
UTF-8 encoding by default and do not support ECI. In this case supply
UTF-8 data and use the <code>--binary</code> switch so that the data
will be encoded as UTF-8 without conversion:</p>
<div class="sourceCode" id="cb48"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb48-1"><a href="#cb48-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> 58 <span class="at">--binary</span> <span class="at">-d</span> <span class="st">&quot;UTF-8 data&quot;</span></span></code></pre></div>
<figure>
<img src="images/qrcode_binary_utf8.svg" title="fig:" class="i2d"
alt="zint -b QRCODE --binary -d &quot;\xE2\x82\xAC\xE5\xB8\xB8&quot; --esc" />
<figcaption
aria-hidden="true"><code>zint -b QRCODE --binary -d "\xE2\x82\xAC\xE5\xB8\xB8" --esc</code></figcaption>
</figure>
<h2 id="batch-processing">4.12 Batch Processing</h2>
<p>Data can be batch processed by reading from a text file and producing
a separate barcode image for each line of text in that file. To do this
use the <code>--batch</code> switch together with <code>-i</code> to
select the input file from which to read data. For example</p>
<div class="sourceCode" id="cb49"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb49-1"><a href="#cb49-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> EANX <span class="at">--batch</span> <span class="at">-i</span> ean13nos.txt</span></code></pre></div>
<p>where <code>"ean13nos.txt"</code> contains a list of EAN-13 numbers
(GTINs), each on its own line. Zint will automatically detect the end of
a line of text (in either Unix or Windows formatted text files) and
produce a symbol each time it finds this.</p>
<p>Input files should end with a line feed character - if this is not
present then Zint will not encode the last line of text, and will warn
you that there is a problem.</p>
<p>By default Zint will output numbered filenames starting with
<code>00001.png</code>, <code>00002.png</code> etc. To change this
behaviour specify the <code>-o</code> option using special characters in
the output filename as shown in the table below:</p>
<div id="tbl:batch_filename_formatting" class="tablenos">
<table id="tbl:batch_filename_formatting"
data-tag=": Batch Filename Formatting">
<caption><span>Table : Batch Filename Formatting</span> </caption>
<thead>
<tr>
<th>Input Character</th>
<th style="text-align: left;">Interpretation</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>~</code></td>
<td style="text-align: left;">Insert a number or 0</td>
</tr>
<tr>
<td><code>#</code></td>
<td style="text-align: left;">Insert a number or space</td>
</tr>
<tr>
<td><code>@</code></td>
<td style="text-align: left;">Insert a number or <code>*</code> (or
<code>+</code> on Windows)</td>
</tr>
<tr>
<td>Any other</td>
<td style="text-align: left;">Insert literally</td>
</tr>
</tbody>
</table>
</div>
<p>For instance</p>
<div class="sourceCode" id="cb50"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb50-1"><a href="#cb50-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> EANX <span class="at">--batch</span> <span class="at">-i</span> ean13nos.txt <span class="at">-o</span> file~~~.svg</span></code></pre></div>
<p>The following table shows some examples to clarify this method:</p>
<div id="tbl:batch_filename_examples" class="tablenos">
<table id="tbl:batch_filename_examples"
data-tag=": Batch Filename Examples">
<caption><span>Table : Batch Filename Examples</span> </caption>
<thead>
<tr>
<th style="text-align: left;">Input</th>
<th style="text-align: left;">Filenames Generated</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;"><code>-o file~~~.svg</code></td>
<td style="text-align: left;"><code>"file001.svg"</code>,
<code>"file002.svg"</code>, <code>"file003.svg"</code></td>
</tr>
<tr>
<td style="text-align: left;"><code>-o @@@@bar.png</code></td>
<td style="text-align: left;"><code>"***1.png"</code>,
<code>"***2.png"</code>, <code>"***3.png"</code> (except Windows)</td>
</tr>
<tr>
<td style="text-align: left;"><code>-o @@@@bar.png</code></td>
<td style="text-align: left;"><code>"+++1.png"</code>,
<code>"+++2.png"</code>, <code>"+++3.png"</code> (on Windows)</td>
</tr>
<tr>
<td style="text-align: left;"><code>-o my~~~bar.eps</code></td>
<td style="text-align: left;"><code>"my001bar.eps"</code>,
<code>"my002bar.eps"</code>, <code>"my003bar.eps"</code></td>
</tr>
<tr>
<td style="text-align: left;"><code>-o t#es~t~.png</code></td>
<td style="text-align: left;"><code>"t es0t1.png"</code>,
<code>"t es0t2.png"</code>, <code>"t es0t3.png"</code></td>
</tr>
</tbody>
</table>
</div>
<p>The special characters can span directories also, which is useful
when creating a large number of barcodes:</p>
<div id="tbl:batch_dir_examples" class="tablenos">
<table id="tbl:batch_dir_examples"
data-tag=": Batch Directory Examples">
<caption><span>Table : Batch Directory Examples</span> </caption>
<thead>
<tr>
<th style="text-align: left;">Input</th>
<th style="text-align: left;">Filenames Generated</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;"><code>-o dir~/file~~~.svg</code></td>
<td style="text-align: left;"><code>"dir0/file001.svg"</code>,
<code>"dir0/file002.svg"</code>, …</td>
</tr>
<tr>
<td style="text-align: left;"></td>
<td style="text-align: left;">, <code>"dir0/file999.svg"</code>,
<code>"dir1/file000.svg"</code>, …</td>
</tr>
</tbody>
</table>
</div>
<p>For an alternative method of naming output files see the
<code>--mirror</code> option in <a href="#automatic-filenames">4.14
Automatic Filenames</a> below.</p>
<h2 id="direct-output-to-stdout">4.13 Direct Output to stdout</h2>
<p>The finished image files can be output directly to stdout for use as
part of a pipe by using the <code>--direct</code> option. By default
<code>--direct</code> will output data as a PNG image (or GIF image if
<code>libpng</code> is not present), but this can be altered by
supplementing the <code>--direct</code> option with a
<code>--filetype</code> option followed by the suffix of the file type
required. For example:</p>
<div class="sourceCode" id="cb51"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb51-1"><a href="#cb51-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> 84 <span class="at">--direct</span> <span class="at">--filetype</span><span class="op">=</span>pcx <span class="at">-d</span> <span class="st">&quot;Data to encode&quot;</span></span></code></pre></div>
<p>This command will output the symbol as a PCX file to stdout. For the
supported output file formats see Table <a
href="#tbl:output_file_formats">: Output File Formats</a>.</p>
<hr />
<p>CAUTION: Outputting binary files to the command shell without
catching that data in a pipe can have unpredictable results. Use with
care!</p>
<hr />
<h2 id="automatic-filenames">4.14 Automatic Filenames</h2>
<p>The <code>--mirror</code> option instructs Zint to use the data to be
encoded as an indicator of the filename to be used. This is particularly
useful if you are processing batch data. For example the input data
<code>"1234567"</code> will result in a file named
<code>"1234567.png"</code>.</p>
<p>There are restrictions, however, on what characters can be stored in
a filename, so the filename may vary from the data if the data includes
non-printable characters, for example, and may be shortened if the data
input is long.</p>
<p>To set the output file format use the <code>--filetype</code> option
as detailed above in <a href="#direct-output-to-stdout">4.13 Direct
Output to stdout</a>. To output to a specific directory use the
<code>-o</code> option giving the name of the directory (any filename
will be ignored, unless <code>--filetype</code> is not specified, in
which case the filename’s extension will be used).</p>
<h2 id="working-with-dots">4.15 Working with Dots</h2>
<p>Matrix codes can be rendered as a series of dots or circles rather
than the normal squares by using the <code>--dotty</code> option. This
option is only available for matrix symbologies, and is automatically
selected for DotCode. The size of the dots can be adjusted using the
<code>--dotsize</code> option followed by the diameter of the dot, where
that diameter is in X-dimensions. The minimum dot size is 0.01, the
maximum is 20. The default size is 0.8.</p>
<p>The default and minimum scale for raster output in dotty mode is
1.</p>
<figure>
<img src="images/codeone_s_dotty.svg" title="fig:" class="dotty"
alt="zint -b CODEONE -d &quot;123456789012345678&quot; --dotty --vers=9" />
<figcaption
aria-hidden="true"><code>zint -b CODEONE -d "123456789012345678" --dotty --vers=9</code></figcaption>
</figure>
<h2 id="multiple-segments">4.16 Multiple Segments</h2>
<p>If you need to specify different ECIs for different sections of the
input data, the <code>--seg1</code> to <code>--seg9</code> options can
be used. Each option is of the form <code>--segN=ECI,data</code> where
<code>ECI</code> is the ECI code (see Table <a href="#tbl:eci_codes">:
ECI Codes</a>) and <code>data</code> is the data to which this applies.
This is in addition to the ECI and data specified using the
<code>--eci</code> and <code>-d</code> options which must still be
present and which in effect constitute segment 0. For instance</p>
<div class="sourceCode" id="cb52"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb52-1"><a href="#cb52-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> AZTEC_CODE <span class="at">--eci</span><span class="op">=</span>9 <span class="at">-d</span> <span class="st">&quot;Κείμενο&quot;</span> <span class="at">--seg1</span><span class="op">=</span>7,<span class="st">&quot;Текст&quot;</span> <span class="at">--seg2</span><span class="op">=</span>20,<span class="st">&quot;文章&quot;</span></span></code></pre></div>
<p>specifies 3 segments: segment 0 with ECI 9 (Greek), segment 1 with
ECI 7 (Cyrillic), and segment 2 with ECI 20 (Shift JIS). Segments must
be consecutive.</p>
<p>Naturally the symbology must be ECI-aware (see Table <a
href="#tbl:eci_aware_symbologies">: ECI-Aware Symbologies</a>).</p>
<figure>
<img src="images/aztec_segs.svg" title="fig:" class="i2d"
alt="zint -b AZTEC --eci=9 -d &quot;Κείμενο&quot; --seg1=7,&quot;Текст&quot; --seg2=20,&quot;文章&quot;" />
<figcaption
aria-hidden="true"><code>zint -b AZTEC --eci=9 -d "Κείμενο" --seg1=7,"Текст" --seg2=20,"文章"</code></figcaption>
</figure>
<p>ECIs of zero may be given, in which case Zint will automatically
determine an ECI if necessary, as described in section <a
href="#input-modes-and-eci">4.11.2 Input Modes and ECI</a>.</p>
<p>Multiple segments are not currently supported for use with GS1
data.</p>
<h2 id="structured-append">4.17 Structured Append</h2>
<p>Structured Append is a method of splitting data among several symbols
so that they form a sequence that can be scanned and re-assembled in the
correct order on reading, and is available for Aztec Code, Code One,
Data Matrix, DotCode, Grid Matrix, MaxiCode, MicroPDF417, PDF417, QR
Code and Ultracode.</p>
<p>The <code>--structapp</code> option marks a symbol as part of a
Structured Append sequence, and has the format</p>
<pre><code>--structapp=I,C[,ID]</code></pre>
<figure>
<img src="images/datamatrix_structapp.svg" title="fig:" class="i2d"
alt="zint -b DATAMATRIX -d &quot;2nd of 3&quot; --structapp=&quot;2,3,5006&quot;" />
<figcaption
aria-hidden="true"><code>zint -b DATAMATRIX -d "2nd of 3" --structapp="2,3,5006"</code></figcaption>
</figure>
<p>where <code>I</code> is the index (position) of the symbol in the
Structured Append sequence, <code>C</code> is the count or total number
of symbols in the sequence, and <code>ID</code> is an optional
identifier (not available for Code One, DotCode or MaxiCode) that is the
same for all symbols belonging to the same sequence. The index is
1-based and goes from 1 to count. Count must be 2 or more. See the
individual symbologies for further details.</p>
<h2 id="help-options">4.18 Help Options</h2>
<p>There are three help options which give information about how to use
the command line. The <code>-h</code> or <code>--help</code> option will
display a list of all of the valid options available, and also gives the
exact version of the software (the version by itself can be displayed
with <code>-v</code> or <code>--version</code>).</p>
<p>The <code>-t</code> or <code>--types</code> option gives the table of
symbologies along with the symbol ID numbers and names.</p>
<p>The <code>-e</code> or <code>--ecinos</code> option gives a list of
the ECI codes.</p>
<h2 id="other-options">4.19 Other Options</h2>
<p>Zint can output a representation of the symbol data as a set of
hexadecimal values if asked to output to a text file
(<code>"*.txt"</code>) or if given the option
<code>--filetype=txt</code>. This can be used for test and diagnostic
purposes.</p>
<p>Additional options are available which are specific to certain
symbologies. These may, for example, control the amount of error
correction data or the size of the symbol. These options are discussed
in section <a href="#types-of-symbology">6. Types of Symbology</a> of
this guide.</p>
<h1 id="using-the-api">5. Using the API</h1>
<p>Zint has been written using the C language and has an API for use
with C/C++ language programs. A Qt interface (see <a
href="#annex-b.-qt-backend-qzint">Annex B. Qt Backend QZint</a>) is
available in the <code>"backend_qt"</code> sub-directory, and a Tcl
interface is available in the <code>"backend_tcl"</code> sub-directory
(see <a href="#annex-c.-tcl-backend-binding">Annex C. Tcl Backend
Binding</a>).</p>
<p>The <code>libzint</code> API has been designed to be very similar to
that used by the GNU Barcode package. This allows easy migration from
GNU Barcode to Zint. Zint, however, uses none of the same function names
or option names as GNU Barcode. This allows you to use both packages in
your application without conflict if you wish.</p>
<h2 id="creating-and-deleting-symbols">5.1 Creating and Deleting
Symbols</h2>
<p>The symbols manipulated by Zint are held in a
<code>zint_symbol</code> structure defined in <code>"zint.h"</code>.
These symbol structures are created with the
<code>ZBarcode_Create()</code> function and deleted using the
<code>ZBarcode_Delete()</code> function. For example the following code
creates and then deletes a symbol:</p>
<div class="sourceCode" id="cb54"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb54-1"><a href="#cb54-1" aria-hidden="true" tabindex="-1"></a><span class="pp">#include </span><span class="im">&lt;zint.h&gt;</span></span>
<span id="cb54-2"><a href="#cb54-2" aria-hidden="true" tabindex="-1"></a><span class="pp">#include </span><span class="im">&lt;stdio.h&gt;</span></span>
<span id="cb54-3"><a href="#cb54-3" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> main<span class="op">()</span></span>
<span id="cb54-4"><a href="#cb54-4" aria-hidden="true" tabindex="-1"></a><span class="op">{</span></span>
<span id="cb54-5"><a href="#cb54-5" aria-hidden="true" tabindex="-1"></a>    <span class="kw">struct</span> zint_symbol <span class="op">*</span>my_symbol<span class="op">;</span></span>
<span id="cb54-6"><a href="#cb54-6" aria-hidden="true" tabindex="-1"></a>    my_symbol <span class="op">=</span> ZBarcode_Create<span class="op">();</span></span>
<span id="cb54-7"><a href="#cb54-7" aria-hidden="true" tabindex="-1"></a>    <span class="cf">if</span> <span class="op">(</span>my_symbol <span class="op">!=</span> NULL<span class="op">)</span> <span class="op">{</span></span>
<span id="cb54-8"><a href="#cb54-8" aria-hidden="true" tabindex="-1"></a>        printf<span class="op">(</span><span class="st">&quot;Symbol successfully created!</span><span class="sc">\n</span><span class="st">&quot;</span><span class="op">);</span></span>
<span id="cb54-9"><a href="#cb54-9" aria-hidden="true" tabindex="-1"></a>        ZBarcode_Delete<span class="op">(</span>my_symbol<span class="op">);</span></span>
<span id="cb54-10"><a href="#cb54-10" aria-hidden="true" tabindex="-1"></a>    <span class="op">}</span></span>
<span id="cb54-11"><a href="#cb54-11" aria-hidden="true" tabindex="-1"></a>    <span class="cf">return</span> <span class="dv">0</span><span class="op">;</span></span>
<span id="cb54-12"><a href="#cb54-12" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span></code></pre></div>
<p>When compiling this code it will need to be linked with the
<code>libzint</code> library using the <code>-lzint</code> option:</p>
<div class="sourceCode" id="cb55"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb55-1"><a href="#cb55-1" aria-hidden="true" tabindex="-1"></a><span class="fu">gcc</span> <span class="at">-o</span> simple simple.c <span class="at">-lzint</span></span></code></pre></div>
<h2 id="encoding-and-saving-to-file">5.2 Encoding and Saving to
File</h2>
<p>To encode data in a barcode use the <code>ZBarcode_Encode()</code>
function. To write the symbol to a file use the
<code>ZBarcode_Print()</code> function. For example the following code
takes a string from the command line and outputs a Code 128 symbol to a
PNG file named <code>"out.png"</code> (or a GIF file
<code>"out.gif"</code> if <code>libpng</code> is not present) in the
current working directory:</p>
<div class="sourceCode" id="cb56"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb56-1"><a href="#cb56-1" aria-hidden="true" tabindex="-1"></a><span class="pp">#include </span><span class="im">&lt;zint.h&gt;</span></span>
<span id="cb56-2"><a href="#cb56-2" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> main<span class="op">(</span><span class="dt">int</span> argc<span class="op">,</span> <span class="dt">char</span> <span class="op">**</span>argv<span class="op">)</span></span>
<span id="cb56-3"><a href="#cb56-3" aria-hidden="true" tabindex="-1"></a><span class="op">{</span></span>
<span id="cb56-4"><a href="#cb56-4" aria-hidden="true" tabindex="-1"></a>    <span class="kw">struct</span> zint_symbol <span class="op">*</span>my_symbol<span class="op">;</span></span>
<span id="cb56-5"><a href="#cb56-5" aria-hidden="true" tabindex="-1"></a>    my_symbol <span class="op">=</span> ZBarcode_Create<span class="op">();</span></span>
<span id="cb56-6"><a href="#cb56-6" aria-hidden="true" tabindex="-1"></a>    ZBarcode_Encode<span class="op">(</span>my_symbol<span class="op">,</span> argv<span class="op">[</span><span class="dv">1</span><span class="op">],</span> <span class="dv">0</span><span class="op">);</span></span>
<span id="cb56-7"><a href="#cb56-7" aria-hidden="true" tabindex="-1"></a>    ZBarcode_Print<span class="op">(</span>my_symbol<span class="op">,</span> <span class="dv">0</span><span class="op">);</span></span>
<span id="cb56-8"><a href="#cb56-8" aria-hidden="true" tabindex="-1"></a>    ZBarcode_Delete<span class="op">(</span>my_symbol<span class="op">);</span></span>
<span id="cb56-9"><a href="#cb56-9" aria-hidden="true" tabindex="-1"></a>    <span class="cf">return</span> <span class="dv">0</span><span class="op">;</span></span>
<span id="cb56-10"><a href="#cb56-10" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span></code></pre></div>
<p>This can also be done in one stage using the
<code>ZBarcode_Encode_and_Print()</code> function as shown in the next
example:</p>
<div class="sourceCode" id="cb57"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb57-1"><a href="#cb57-1" aria-hidden="true" tabindex="-1"></a><span class="pp">#include </span><span class="im">&lt;zint.h&gt;</span></span>
<span id="cb57-2"><a href="#cb57-2" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> main<span class="op">(</span><span class="dt">int</span> argc<span class="op">,</span> <span class="dt">char</span> <span class="op">**</span>argv<span class="op">)</span></span>
<span id="cb57-3"><a href="#cb57-3" aria-hidden="true" tabindex="-1"></a><span class="op">{</span></span>
<span id="cb57-4"><a href="#cb57-4" aria-hidden="true" tabindex="-1"></a>    <span class="kw">struct</span> zint_symbol <span class="op">*</span>my_symbol<span class="op">;</span></span>
<span id="cb57-5"><a href="#cb57-5" aria-hidden="true" tabindex="-1"></a>    my_symbol <span class="op">=</span> ZBarcode_Create<span class="op">();</span></span>
<span id="cb57-6"><a href="#cb57-6" aria-hidden="true" tabindex="-1"></a>    ZBarcode_Encode_and_Print<span class="op">(</span>my_symbol<span class="op">,</span> argv<span class="op">[</span><span class="dv">1</span><span class="op">],</span> <span class="dv">0</span><span class="op">,</span> <span class="dv">0</span><span class="op">);</span></span>
<span id="cb57-7"><a href="#cb57-7" aria-hidden="true" tabindex="-1"></a>    ZBarcode_Delete<span class="op">(</span>my_symbol<span class="op">);</span></span>
<span id="cb57-8"><a href="#cb57-8" aria-hidden="true" tabindex="-1"></a>    <span class="cf">return</span> <span class="dv">0</span><span class="op">;</span></span>
<span id="cb57-9"><a href="#cb57-9" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span></code></pre></div>
<p>Note that when using the API, the input data is assumed to be 8-bit
binary unless the <code>input_mode</code> member of the
<code>zint_symbol</code> structure is set - see <a
href="#setting-the-input-mode">5.11 Setting the Input Mode</a> for
details.</p>
<h2 id="encoding-and-printing-functions-in-depth">5.3 Encoding and
Printing Functions in Depth</h2>
<p>The functions for encoding and printing barcodes are defined as:</p>
<div class="sourceCode" id="cb58"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb58-1"><a href="#cb58-1" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_Encode<span class="op">(</span><span class="kw">struct</span> zint_symbol <span class="op">*</span>symbol<span class="op">,</span></span>
<span id="cb58-2"><a href="#cb58-2" aria-hidden="true" tabindex="-1"></a>      <span class="dt">const</span> <span class="dt">unsigned</span> <span class="dt">char</span> <span class="op">*</span>source<span class="op">,</span> <span class="dt">int</span> length<span class="op">);</span></span>
<span id="cb58-3"><a href="#cb58-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb58-4"><a href="#cb58-4" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_Encode_File<span class="op">(</span><span class="kw">struct</span> zint_symbol <span class="op">*</span>symbol<span class="op">,</span></span>
<span id="cb58-5"><a href="#cb58-5" aria-hidden="true" tabindex="-1"></a>      <span class="dt">const</span> <span class="dt">char</span> <span class="op">*</span>filename<span class="op">);</span></span>
<span id="cb58-6"><a href="#cb58-6" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb58-7"><a href="#cb58-7" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_Print<span class="op">(</span><span class="kw">struct</span> zint_symbol <span class="op">*</span>symbol<span class="op">,</span> <span class="dt">int</span> rotate_angle<span class="op">);</span></span>
<span id="cb58-8"><a href="#cb58-8" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb58-9"><a href="#cb58-9" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_Encode_and_Print<span class="op">(</span><span class="kw">struct</span> zint_symbol <span class="op">*</span>symbol<span class="op">,</span></span>
<span id="cb58-10"><a href="#cb58-10" aria-hidden="true" tabindex="-1"></a>      <span class="dt">const</span> <span class="dt">unsigned</span> <span class="dt">char</span> <span class="op">*</span>source<span class="op">,</span> <span class="dt">int</span> length<span class="op">,</span> <span class="dt">int</span> rotate_angle<span class="op">);</span></span>
<span id="cb58-11"><a href="#cb58-11" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb58-12"><a href="#cb58-12" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_Encode_File_and_Print<span class="op">(</span><span class="kw">struct</span> zint_symbol <span class="op">*</span>symbol<span class="op">,</span></span>
<span id="cb58-13"><a href="#cb58-13" aria-hidden="true" tabindex="-1"></a>      <span class="dt">const</span> <span class="dt">char</span> <span class="op">*</span>filename<span class="op">,</span> <span class="dt">int</span> rotate_angle<span class="op">);</span></span></code></pre></div>
<p>In these definitions <code>length</code> can be used to set the
length of the input string. This allows the encoding of <code>NUL</code>
(ASCII 0) characters in those symbologies which allow this. A value of 0
(or less than 0) will disable this usage and Zint will encode data up to
the first <code>NUL</code> character in the input string, which must be
present.</p>
<p>The <code>rotate_angle</code> value can be used to rotate the image
when outputting. Valid values are 0, 90, 180 and 270.</p>
<p>The <code>ZBarcode_Encode_File()</code> and
<code>ZBarcode_Encode_File_and_Print()</code> functions can be used to
encode data read directly from a text file where the filename is given
in the <code>NUL</code>-terminated <code>filename</code> string. The
special filename <code>"-"</code> (single hyphen) can be used to read
from stdin. Note that on Windows, filenames are assumed to be UTF-8
encoded.</p>
<p>If printing more than one barcode, the <code>zint_symbol</code>
structure may be re-used by calling the <code>ZBarcode_Clear()</code>
function after each barcode to free any output buffers allocated. The
<code>zint_symbol</code> input members must be reset. To fully restore
<code>zint_symbol</code> to its default state, call
<code>ZBarcode_Reset()</code> instead.</p>
<h2 id="buffering-symbols-in-memory-raster">5.4 Buffering Symbols in
Memory (raster)</h2>
<p>In addition to saving barcode images to file Zint allows you to
access a representation of the resulting bitmap image in memory. The
following functions allow you to do this:</p>
<div class="sourceCode" id="cb59"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb59-1"><a href="#cb59-1" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_Buffer<span class="op">(</span><span class="kw">struct</span> zint_symbol <span class="op">*</span>symbol<span class="op">,</span> <span class="dt">int</span> rotate_angle<span class="op">);</span></span>
<span id="cb59-2"><a href="#cb59-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb59-3"><a href="#cb59-3" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_Encode_and_Buffer<span class="op">(</span><span class="kw">struct</span> zint_symbol <span class="op">*</span>symbol<span class="op">,</span></span>
<span id="cb59-4"><a href="#cb59-4" aria-hidden="true" tabindex="-1"></a>      <span class="dt">const</span> <span class="dt">unsigned</span> <span class="dt">char</span> <span class="op">*</span>source<span class="op">,</span> <span class="dt">int</span> length<span class="op">,</span> <span class="dt">int</span> rotate_angle<span class="op">);</span></span>
<span id="cb59-5"><a href="#cb59-5" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb59-6"><a href="#cb59-6" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_Encode_File_and_Buffer<span class="op">(</span><span class="kw">struct</span> zint_symbol <span class="op">*</span>symbol<span class="op">,</span></span>
<span id="cb59-7"><a href="#cb59-7" aria-hidden="true" tabindex="-1"></a>      <span class="dt">const</span> <span class="dt">char</span> <span class="op">*</span>filename<span class="op">,</span> <span class="dt">int</span> rotate_angle<span class="op">);</span></span></code></pre></div>
<p>The arguments here are the same as above, and rotation and colour
options can be used with the buffer functions in the same way as when
saving to a file. The difference is that instead of saving the image to
a file it is placed in a byte (<code>unsigned char</code>) array pointed
to by the <code>bitmap</code> member, with <code>bitmap_width</code> set
to the number of columns and <code>bitmap_height</code> set to the
number of rows.</p>
<p>The RGB channels are split into 3 consecutive red, green, blue bytes
per pixel, and there are <code>bitmap_width</code> pixels per row and
<code>bitmap_height</code> rows, so the total size of the
<code>bitmap</code> array is
<code>3 * bitmap_width * bitmap_height</code>.</p>
<p>If the background and/or foreground are RGBA then the byte array
<code>alphamap</code> will also be set, with a single alpha value for
each pixel. Its total size will be
<code>bitmap_width * bitmap_height</code>.</p>
<p>The pixel data can be extracted from the array (or arrays) by the
method shown in the example below, where <code>render_rgb()</code> and
<code>render_rgba()</code> are assumed to be functions for drawing an
RGB and RGBA pixel on the screen implemented by the client
application:</p>
<div class="sourceCode" id="cb60"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb60-1"><a href="#cb60-1" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> row<span class="op">,</span> col<span class="op">,</span> i <span class="op">=</span> <span class="dv">0</span><span class="op">,</span> j <span class="op">=</span> <span class="dv">0</span><span class="op">;</span></span>
<span id="cb60-2"><a href="#cb60-2" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> red<span class="op">,</span> blue<span class="op">,</span> green<span class="op">,</span> alpha<span class="op">;</span></span>
<span id="cb60-3"><a href="#cb60-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb60-4"><a href="#cb60-4" aria-hidden="true" tabindex="-1"></a><span class="cf">for</span> <span class="op">(</span>row <span class="op">=</span> <span class="dv">0</span><span class="op">;</span> row <span class="op">&lt;</span> my_symbol<span class="op">-&gt;</span>bitmap_height<span class="op">;</span> row<span class="op">++)</span> <span class="op">{</span></span>
<span id="cb60-5"><a href="#cb60-5" aria-hidden="true" tabindex="-1"></a>     <span class="cf">for</span> <span class="op">(</span>col <span class="op">=</span> <span class="dv">0</span><span class="op">;</span> col <span class="op">&lt;</span> my_symbol<span class="op">-&gt;</span>bitmap_width<span class="op">;</span> col<span class="op">++)</span> <span class="op">{</span></span>
<span id="cb60-6"><a href="#cb60-6" aria-hidden="true" tabindex="-1"></a>          red <span class="op">=</span> <span class="op">(</span><span class="dt">int</span><span class="op">)</span> my_symbol<span class="op">-&gt;</span>bitmap<span class="op">[</span>i<span class="op">];</span></span>
<span id="cb60-7"><a href="#cb60-7" aria-hidden="true" tabindex="-1"></a>          green <span class="op">=</span> <span class="op">(</span><span class="dt">int</span><span class="op">)</span> my_symbol<span class="op">-&gt;</span>bitmap<span class="op">[</span>i <span class="op">+</span> <span class="dv">1</span><span class="op">];</span></span>
<span id="cb60-8"><a href="#cb60-8" aria-hidden="true" tabindex="-1"></a>          blue <span class="op">=</span> <span class="op">(</span><span class="dt">int</span><span class="op">)</span> my_symbol<span class="op">-&gt;</span>bitmap<span class="op">[</span>i <span class="op">+</span> <span class="dv">2</span><span class="op">];</span></span>
<span id="cb60-9"><a href="#cb60-9" aria-hidden="true" tabindex="-1"></a>          <span class="cf">if</span> <span class="op">(</span>my_symbol<span class="op">-&gt;</span>alphamap<span class="op">)</span> <span class="op">{</span></span>
<span id="cb60-10"><a href="#cb60-10" aria-hidden="true" tabindex="-1"></a>              alpha <span class="op">=</span> <span class="op">(</span><span class="dt">int</span><span class="op">)</span> my_symbol<span class="op">-&gt;</span>alphamap<span class="op">[</span>j<span class="op">];</span></span>
<span id="cb60-11"><a href="#cb60-11" aria-hidden="true" tabindex="-1"></a>              render_rgba<span class="op">(</span>row<span class="op">,</span> col<span class="op">,</span> red<span class="op">,</span> green<span class="op">,</span> blue<span class="op">,</span> alpha<span class="op">);</span></span>
<span id="cb60-12"><a href="#cb60-12" aria-hidden="true" tabindex="-1"></a>              j<span class="op">++;</span></span>
<span id="cb60-13"><a href="#cb60-13" aria-hidden="true" tabindex="-1"></a>          <span class="op">}</span> <span class="cf">else</span> <span class="op">{</span></span>
<span id="cb60-14"><a href="#cb60-14" aria-hidden="true" tabindex="-1"></a>              render_rgb<span class="op">(</span>row<span class="op">,</span> col<span class="op">,</span> red<span class="op">,</span> green<span class="op">,</span> blue<span class="op">);</span></span>
<span id="cb60-15"><a href="#cb60-15" aria-hidden="true" tabindex="-1"></a>          <span class="op">}</span></span>
<span id="cb60-16"><a href="#cb60-16" aria-hidden="true" tabindex="-1"></a>          i <span class="op">+=</span> <span class="dv">3</span><span class="op">;</span></span>
<span id="cb60-17"><a href="#cb60-17" aria-hidden="true" tabindex="-1"></a>     <span class="op">}</span></span>
<span id="cb60-18"><a href="#cb60-18" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span></code></pre></div>
<p>Where speed is important, the buffer can be returned instead in a
more compact intermediate form using the output option
<code>OUT_BUFFER_INTERMEDIATE</code>. Here each byte is an ASCII value:
<code>'1'</code> for foreground colour and <code>'0'</code> for
background colour, except for Ultracode, which also uses colour codes:
<code>'W'</code> for white, <code>'C'</code> for cyan, <code>'B'</code>
for blue, <code>'M'</code> for magenta, <code>'R'</code> for red,
<code>'Y'</code> for yellow, <code>'G'</code> for green, and
<code>'K'</code> for black. Alpha values are not reported
(<code>alphamap</code> will always be <code>NULL</code>). The loop for
accessing the data is then:</p>
<div class="sourceCode" id="cb61"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb61-1"><a href="#cb61-1" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> row<span class="op">,</span> col<span class="op">,</span> i <span class="op">=</span> <span class="dv">0</span><span class="op">;</span></span>
<span id="cb61-2"><a href="#cb61-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb61-3"><a href="#cb61-3" aria-hidden="true" tabindex="-1"></a><span class="cf">for</span> <span class="op">(</span>row <span class="op">=</span> <span class="dv">0</span><span class="op">;</span> row <span class="op">&lt;</span> my_symbol<span class="op">-&gt;</span>bitmap_height<span class="op">;</span> row<span class="op">++)</span> <span class="op">{</span></span>
<span id="cb61-4"><a href="#cb61-4" aria-hidden="true" tabindex="-1"></a>     <span class="cf">for</span> <span class="op">(</span>col <span class="op">=</span> <span class="dv">0</span><span class="op">;</span> col <span class="op">&lt;</span> my_symbol<span class="op">-&gt;</span>bitmap_width<span class="op">;</span> col<span class="op">++)</span> <span class="op">{</span></span>
<span id="cb61-5"><a href="#cb61-5" aria-hidden="true" tabindex="-1"></a>          render_pixel<span class="op">(</span>row<span class="op">,</span> col<span class="op">,</span> my_symbol<span class="op">-&gt;</span>bitmap<span class="op">[</span>i<span class="op">]);</span></span>
<span id="cb61-6"><a href="#cb61-6" aria-hidden="true" tabindex="-1"></a>          i<span class="op">++;</span></span>
<span id="cb61-7"><a href="#cb61-7" aria-hidden="true" tabindex="-1"></a>     <span class="op">}</span></span>
<span id="cb61-8"><a href="#cb61-8" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span></code></pre></div>
<h2 id="buffering-symbols-in-memory-vector">5.5 Buffering Symbols in
Memory (vector)</h2>
<p>Symbols can also be saved to memory in a vector representation as
well as a bitmap one. The following functions, exactly analogous to the
ones above, allow you to do this:</p>
<div class="sourceCode" id="cb62"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb62-1"><a href="#cb62-1" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_Buffer_Vector<span class="op">(</span><span class="kw">struct</span> zint_symbol <span class="op">*</span>symbol<span class="op">,</span> <span class="dt">int</span> rotate_angle<span class="op">);</span></span>
<span id="cb62-2"><a href="#cb62-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb62-3"><a href="#cb62-3" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_Encode_and_Buffer_Vector<span class="op">(</span><span class="kw">struct</span> zint_symbol <span class="op">*</span>symbol<span class="op">,</span></span>
<span id="cb62-4"><a href="#cb62-4" aria-hidden="true" tabindex="-1"></a>      <span class="dt">const</span> <span class="dt">unsigned</span> <span class="dt">char</span> <span class="op">*</span>source<span class="op">,</span> <span class="dt">int</span> length<span class="op">,</span> <span class="dt">int</span> rotate_angle<span class="op">);</span></span>
<span id="cb62-5"><a href="#cb62-5" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb62-6"><a href="#cb62-6" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_Encode_File_and_Buffer_Vector<span class="op">(</span><span class="kw">struct</span> zint_symbol <span class="op">*</span>symbol<span class="op">,</span></span>
<span id="cb62-7"><a href="#cb62-7" aria-hidden="true" tabindex="-1"></a>      <span class="dt">const</span> <span class="dt">char</span> <span class="op">*</span>filename<span class="op">,</span> <span class="dt">int</span> rotate_angle<span class="op">);</span></span></code></pre></div>
<p>Here the <code>vector</code> member is set to point to a
<code>zint_vector</code> header structure which contains pointers to
lists of structures representing the various elements of the barcode:
rectangles, hexagons, strings and circles. To draw the barcode, each of
the element types is iterated in turn, and using the information stored
is drawn by a rendering system. For instance, to draw a barcode using a
rendering system with <code>prepare_canvas()</code>,
<code>draw_rect()</code>, <code>draw_hexagon()</code>,
<code>draw_string()</code>, and <code>draw_circle()</code> routines
available:</p>
<div class="sourceCode" id="cb63"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb63-1"><a href="#cb63-1" aria-hidden="true" tabindex="-1"></a><span class="kw">struct</span> zint_vector_rect <span class="op">*</span>rect<span class="op">;</span></span>
<span id="cb63-2"><a href="#cb63-2" aria-hidden="true" tabindex="-1"></a><span class="kw">struct</span> zint_vector_hexagon <span class="op">*</span>hex<span class="op">;</span></span>
<span id="cb63-3"><a href="#cb63-3" aria-hidden="true" tabindex="-1"></a><span class="kw">struct</span> zint_vector_string <span class="op">*</span>string<span class="op">;</span></span>
<span id="cb63-4"><a href="#cb63-4" aria-hidden="true" tabindex="-1"></a><span class="kw">struct</span> zint_vector_circle <span class="op">*</span>circle<span class="op">;</span></span>
<span id="cb63-5"><a href="#cb63-5" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb63-6"><a href="#cb63-6" aria-hidden="true" tabindex="-1"></a>prepare_canvas<span class="op">(</span>my_symbol<span class="op">-&gt;</span>vector<span class="op">-&gt;</span>width<span class="op">,</span> my_symbol<span class="op">-&gt;</span>vector<span class="op">-&gt;</span>height<span class="op">,</span></span>
<span id="cb63-7"><a href="#cb63-7" aria-hidden="true" tabindex="-1"></a>               my_symbol<span class="op">-&gt;</span>scale<span class="op">,</span> my_symbol<span class="op">-&gt;</span>fgcolour<span class="op">,</span> my_symbol<span class="op">-&gt;</span>bgcolour<span class="op">,</span></span>
<span id="cb63-8"><a href="#cb63-8" aria-hidden="true" tabindex="-1"></a>               rotate_angle<span class="op">);</span></span>
<span id="cb63-9"><a href="#cb63-9" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb63-10"><a href="#cb63-10" aria-hidden="true" tabindex="-1"></a><span class="cf">for</span> <span class="op">(</span>rect <span class="op">=</span> my_symbol<span class="op">-&gt;</span>vector<span class="op">-&gt;</span>rectangles<span class="op">;</span> rect<span class="op">;</span> rect <span class="op">=</span> rect<span class="op">-&gt;</span>next<span class="op">)</span> <span class="op">{</span></span>
<span id="cb63-11"><a href="#cb63-11" aria-hidden="true" tabindex="-1"></a>    draw_rect<span class="op">(</span>rect<span class="op">-&gt;</span>x<span class="op">,</span> rect<span class="op">-&gt;</span>y<span class="op">,</span> rect<span class="op">-&gt;</span>width<span class="op">,</span> rect<span class="op">-&gt;</span>height<span class="op">,</span></span>
<span id="cb63-12"><a href="#cb63-12" aria-hidden="true" tabindex="-1"></a>              rect<span class="op">-&gt;</span>colour<span class="op">);</span></span>
<span id="cb63-13"><a href="#cb63-13" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span>
<span id="cb63-14"><a href="#cb63-14" aria-hidden="true" tabindex="-1"></a><span class="cf">for</span> <span class="op">(</span>hex <span class="op">=</span> my_symbol<span class="op">-&gt;</span>vector<span class="op">-&gt;</span>hexagons<span class="op">;</span> hex<span class="op">;</span> hex <span class="op">=</span> hex<span class="op">-&gt;</span>next<span class="op">)</span> <span class="op">{</span></span>
<span id="cb63-15"><a href="#cb63-15" aria-hidden="true" tabindex="-1"></a>    draw_hexagon<span class="op">(</span>hex<span class="op">-&gt;</span>x<span class="op">,</span> hex<span class="op">-&gt;</span>y<span class="op">,</span> hex<span class="op">-&gt;</span>diameter<span class="op">,</span> hex<span class="op">-&gt;</span>rotation<span class="op">);</span></span>
<span id="cb63-16"><a href="#cb63-16" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span>
<span id="cb63-17"><a href="#cb63-17" aria-hidden="true" tabindex="-1"></a><span class="cf">for</span> <span class="op">(</span>string <span class="op">=</span> my_symbol<span class="op">-&gt;</span>vector<span class="op">-&gt;</span>strings<span class="op">;</span> string<span class="op">;</span> string <span class="op">=</span> string<span class="op">-&gt;</span>next<span class="op">)</span> <span class="op">{</span></span>
<span id="cb63-18"><a href="#cb63-18" aria-hidden="true" tabindex="-1"></a>    draw_string<span class="op">(</span>string<span class="op">-&gt;</span>x<span class="op">,</span> string<span class="op">-&gt;</span>y<span class="op">,</span> string<span class="op">-&gt;</span>fsize<span class="op">,</span></span>
<span id="cb63-19"><a href="#cb63-19" aria-hidden="true" tabindex="-1"></a>                string<span class="op">-&gt;</span>rotation<span class="op">,</span> string<span class="op">-&gt;</span>halign<span class="op">,</span></span>
<span id="cb63-20"><a href="#cb63-20" aria-hidden="true" tabindex="-1"></a>                string<span class="op">-&gt;</span>text<span class="op">,</span> string<span class="op">-&gt;</span>length<span class="op">);</span></span>
<span id="cb63-21"><a href="#cb63-21" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span>
<span id="cb63-22"><a href="#cb63-22" aria-hidden="true" tabindex="-1"></a><span class="cf">for</span> <span class="op">(</span>circle <span class="op">=</span> my_symbol<span class="op">-&gt;</span>vector<span class="op">-&gt;</span>circles<span class="op">;</span> circle<span class="op">;</span> circle <span class="op">=</span> circle<span class="op">-&gt;</span>next<span class="op">)</span> <span class="op">{</span></span>
<span id="cb63-23"><a href="#cb63-23" aria-hidden="true" tabindex="-1"></a>    draw_circle<span class="op">(</span>circle<span class="op">-&gt;</span>x<span class="op">,</span> circle<span class="op">-&gt;</span>y<span class="op">,</span> circle<span class="op">-&gt;</span>diameter<span class="op">,</span> circle<span class="op">-&gt;</span>width<span class="op">);</span></span>
<span id="cb63-24"><a href="#cb63-24" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span></code></pre></div>
<h2 id="buffering-symbols-in-memory-memfile">5.6 Buffering Symbols in
Memory (memfile)</h2>
<p>Symbols can also be stored as “in-memory” file buffers by giving the
<code>BARCODE_MEMORY_FILE</code> option to the
<code>output_options</code> member, which saves the print output to
member <code>memfile</code> instead of to the output file
<code>outfile</code>. The length of the buffer is given in
<code>memfile_size</code>. For instance:</p>
<div class="sourceCode" id="cb64"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb64-1"><a href="#cb64-1" aria-hidden="true" tabindex="-1"></a><span class="pp">#include </span><span class="im">&lt;zint.h&gt;</span></span>
<span id="cb64-2"><a href="#cb64-2" aria-hidden="true" tabindex="-1"></a><span class="pp">#include </span><span class="im">&lt;stdio.h&gt;</span></span>
<span id="cb64-3"><a href="#cb64-3" aria-hidden="true" tabindex="-1"></a><span class="pp">#include </span><span class="im">&lt;string.h&gt;</span></span>
<span id="cb64-4"><a href="#cb64-4" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> main<span class="op">(</span><span class="dt">int</span> argc<span class="op">,</span> <span class="dt">char</span> <span class="op">**</span>argv<span class="op">)</span></span>
<span id="cb64-5"><a href="#cb64-5" aria-hidden="true" tabindex="-1"></a><span class="op">{</span></span>
<span id="cb64-6"><a href="#cb64-6" aria-hidden="true" tabindex="-1"></a>    <span class="kw">struct</span> zint_symbol <span class="op">*</span>my_symbol<span class="op">;</span></span>
<span id="cb64-7"><a href="#cb64-7" aria-hidden="true" tabindex="-1"></a>    my_symbol <span class="op">=</span> ZBarcode_Create<span class="op">();</span></span>
<span id="cb64-8"><a href="#cb64-8" aria-hidden="true" tabindex="-1"></a>    my_symbol<span class="op">-&gt;</span>output_options <span class="op">|=</span> BARCODE_MEMORY_FILE<span class="op">;</span></span>
<span id="cb64-9"><a href="#cb64-9" aria-hidden="true" tabindex="-1"></a>    <span class="co">/* Only the extension is used, to determine output format */</span></span>
<span id="cb64-10"><a href="#cb64-10" aria-hidden="true" tabindex="-1"></a>    strcpy<span class="op">(</span>my_symbol<span class="op">-&gt;</span>outfile<span class="op">,</span> <span class="st">&quot;mem.svg&quot;</span><span class="op">);</span></span>
<span id="cb64-11"><a href="#cb64-11" aria-hidden="true" tabindex="-1"></a>    ZBarcode_Encode_and_Print<span class="op">(</span>my_symbol<span class="op">,</span> argv<span class="op">[</span><span class="dv">1</span><span class="op">],</span> <span class="dv">0</span><span class="op">,</span> <span class="dv">0</span><span class="op">);</span></span>
<span id="cb64-12"><a href="#cb64-12" aria-hidden="true" tabindex="-1"></a>    <span class="co">/* `my_symbol-&gt;memfile` now contains the SVG output */</span></span>
<span id="cb64-13"><a href="#cb64-13" aria-hidden="true" tabindex="-1"></a>    fwrite<span class="op">(</span>my_symbol<span class="op">-&gt;</span>memfile<span class="op">,</span> <span class="dv">1</span><span class="op">,</span> my_symbol<span class="op">-&gt;</span>memfile_size<span class="op">,</span> stdout<span class="op">);</span></span>
<span id="cb64-14"><a href="#cb64-14" aria-hidden="true" tabindex="-1"></a>    ZBarcode_Delete<span class="op">(</span>my_symbol<span class="op">);</span></span>
<span id="cb64-15"><a href="#cb64-15" aria-hidden="true" tabindex="-1"></a>    <span class="cf">return</span> <span class="dv">0</span><span class="op">;</span></span>
<span id="cb64-16"><a href="#cb64-16" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span></code></pre></div>
<p>will print the SVG output to <code>stdout</code> (the file
<code>"mem.svg"</code> is not created). This is particularly useful for
the textual formats EPS and SVG,<a href="#fn8" class="footnote-ref"
id="fnref8" role="doc-noteref"><sup>8</sup></a> allowing the output to
be manipulated and processed by the client.</p>
<h2 id="setting-options">5.7 Setting Options</h2>
<p>So far our application is not very useful unless we plan to only make
Code 128 symbols and we don’t mind that they only save to
<code>"out.png"</code> (or to memory, as above). As with the CLI
program, of course, these options can be altered. The way this is done
is by altering the contents of the <code>zint_symbol</code> structure
between the creation and encoding stages. The <code>zint_symbol</code>
structure consists of the following members:</p>
<div id="tbl:api_structure_zint_symbol" class="tablenos">
<table id="tbl:api_structure_zint_symbol" data-tag="$ $">
<caption><span>Table <span class="math inline"> </span>:</span> API
Structure <code>zint_symbol</code> </caption>
<colgroup>
<col style="width: 26%" />
<col style="width: 15%" />
<col style="width: 34%" />
<col style="width: 23%" />
</colgroup>
<thead>
<tr>
<th style="text-align: left;">Member Name</th>
<th style="text-align: left;">Type</th>
<th style="text-align: left;">Meaning</th>
<th style="text-align: left;">Default Value</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;"><code>symbology</code></td>
<td style="text-align: left;">integer</td>
<td style="text-align: left;">Symbol to use - see <a
href="#specifying-a-symbology">5.9 Specifying a Symbology</a>.</td>
<td style="text-align: left;"><code>BARCODE_CODE128</code></td>
</tr>
<tr>
<td style="text-align: left;"><code>height</code></td>
<td style="text-align: left;">float</td>
<td style="text-align: left;">Symbol height in X-dimensions, excluding
fixed width-to-height symbols.<a href="#fn9" class="footnote-ref"
id="fnref9" role="doc-noteref"><sup>9</sup></a></td>
<td style="text-align: left;">Symbol dependent</td>
</tr>
<tr>
<td style="text-align: left;"><code>scale</code></td>
<td style="text-align: left;">float</td>
<td style="text-align: left;">Scale factor for adjusting size of image
(sets X-dimension).</td>
<td style="text-align: left;">1.0</td>
</tr>
<tr>
<td style="text-align: left;"><code>whitespace_width</code></td>
<td style="text-align: left;">integer</td>
<td style="text-align: left;">Horizontal whitespace width in
X-dimensions.</td>
<td style="text-align: left;">0</td>
</tr>
<tr>
<td style="text-align: left;"><code>whitespace_height</code></td>
<td style="text-align: left;">integer</td>
<td style="text-align: left;">Vertical whitespace height in
X-dimensions.</td>
<td style="text-align: left;">0</td>
</tr>
<tr>
<td style="text-align: left;"><code>border_width</code></td>
<td style="text-align: left;">integer</td>
<td style="text-align: left;">Border width in X-dimensions.</td>
<td style="text-align: left;">0</td>
</tr>
<tr>
<td style="text-align: left;"><code>output_options</code></td>
<td style="text-align: left;">integer</td>
<td style="text-align: left;">Set various output parameters - see <a
href="#adjusting-output-options">5.10 Adjusting Output Options</a>.</td>
<td style="text-align: left;">0 (none)</td>
</tr>
<tr>
<td style="text-align: left;"><code>fgcolour</code></td>
<td style="text-align: left;">character string</td>
<td style="text-align: left;">Foreground (ink) colour as RGB/RGBA
hexadecimal string or <code>"C,M,Y,K"</code> decimal percentages string,
with a terminating <code>NUL</code>.</td>
<td style="text-align: left;"><code>"000000"</code></td>
</tr>
<tr>
<td style="text-align: left;"><code>bgcolour</code></td>
<td style="text-align: left;">character string</td>
<td style="text-align: left;">Background (paper) colour as RGB/RGBA
hexadecimal string or <code>"C,M,Y,K"</code> decimal percentages string,
with a terminating <code>NUL</code>.</td>
<td style="text-align: left;"><code>"ffffff"</code></td>
</tr>
<tr>
<td style="text-align: left;"><code>fgcolor</code></td>
<td style="text-align: left;">pointer</td>
<td style="text-align: left;">Points to fgcolour allowing alternate
spelling.</td>
<td style="text-align: left;"></td>
</tr>
<tr>
<td style="text-align: left;"><code>bgcolor</code></td>
<td style="text-align: left;">pointer</td>
<td style="text-align: left;">Points to bgcolour allowing alternate
spelling.</td>
<td style="text-align: left;"></td>
</tr>
<tr>
<td style="text-align: left;"><code>outfile</code></td>
<td style="text-align: left;">character string</td>
<td style="text-align: left;">Contains the name of the file to output a
resulting barcode symbol to. Must end in <code>.png</code>,
<code>.gif</code>, <code>.bmp</code>, <code>.emf</code>,
<code>.eps</code>, <code>.pcx</code>, <code>.svg</code>,
<code>.tif</code> or <code>.txt</code> followed by a terminating
<code>NUL</code>.<a href="#fn10" class="footnote-ref" id="fnref10"
role="doc-noteref"><sup>10</sup></a></td>
<td style="text-align: left;"><code>"out.png"</code></td>
</tr>
<tr>
<td style="text-align: left;"><code>primary</code></td>
<td style="text-align: left;">character string</td>
<td style="text-align: left;">Primary message data for more complex
symbols, with a terminating <code>NUL</code>.</td>
<td style="text-align: left;"><code>""</code> (empty)</td>
</tr>
<tr>
<td style="text-align: left;"><code>option_1</code></td>
<td style="text-align: left;">integer</td>
<td style="text-align: left;">Symbol specific options.</td>
<td style="text-align: left;">-1</td>
</tr>
<tr>
<td style="text-align: left;"><code>option_2</code></td>
<td style="text-align: left;">integer</td>
<td style="text-align: left;">Symbol specific options.</td>
<td style="text-align: left;">0</td>
</tr>
<tr>
<td style="text-align: left;"><code>option_3</code></td>
<td style="text-align: left;">integer</td>
<td style="text-align: left;">Symbol specific options.</td>
<td style="text-align: left;">0</td>
</tr>
<tr>
<td style="text-align: left;"><code>show_hrt</code></td>
<td style="text-align: left;">integer</td>
<td style="text-align: left;">Set to 0 to hide Human Readable Text
(HRT).</td>
<td style="text-align: left;">1</td>
</tr>
<tr>
<td style="text-align: left;"><code>input_mode</code></td>
<td style="text-align: left;">integer</td>
<td style="text-align: left;">Set encoding of input data - see <a
href="#setting-the-input-mode">5.11 Setting the Input Mode</a>.</td>
<td style="text-align: left;"><code>DATA_MODE</code></td>
</tr>
<tr>
<td style="text-align: left;"><code>eci</code></td>
<td style="text-align: left;">integer</td>
<td style="text-align: left;">Extended Channel Interpretation code.</td>
<td style="text-align: left;">0 (none)</td>
</tr>
<tr>
<td style="text-align: left;"><code>dpmm</code></td>
<td style="text-align: left;">float</td>
<td style="text-align: left;">Resolution of output in dots per mm (BMP,
EMF, PCX, PNG and TIF only).</td>
<td style="text-align: left;">0 (none)</td>
</tr>
<tr>
<td style="text-align: left;"><code>dot_size</code></td>
<td style="text-align: left;">float</td>
<td style="text-align: left;">Diameter of dots used in dotty mode (in
X-dimensions).</td>
<td style="text-align: left;">0.8</td>
</tr>
<tr>
<td style="text-align: left;"><code>text_gap</code></td>
<td style="text-align: left;">float</td>
<td style="text-align: left;">Gap between barcode and text (HRT) in
X-dimensions.</td>
<td style="text-align: left;">1.0</td>
</tr>
<tr>
<td style="text-align: left;"><code>guard_descent</code></td>
<td style="text-align: left;">float</td>
<td style="text-align: left;">Height of guard bar descent (EAN/UPC only)
in X-dimensions.</td>
<td style="text-align: left;">5.0</td>
</tr>
<tr>
<td style="text-align: left;"><code>structapp</code></td>
<td style="text-align: left;">Structured Append structure</td>
<td style="text-align: left;">Mark a symbol as part of a sequence of
symbols.</td>
<td style="text-align: left;">count 0 (disabled)</td>
</tr>
<tr>
<td style="text-align: left;"><code>debug</code></td>
<td style="text-align: left;">integer</td>
<td style="text-align: left;">Debugging flags.</td>
<td style="text-align: left;">0</td>
</tr>
<tr>
<td style="text-align: left;"><code>warn_level</code></td>
<td style="text-align: left;">integer</td>
<td style="text-align: left;">Affects error/warning value returned by
Zint API - see <a href="#handling-errors">5.8 Handling Errors</a>.</td>
<td style="text-align: left;"><code>WARN_DEFAULT</code></td>
</tr>
<tr>
<td style="text-align: left;"><code>text</code></td>
<td style="text-align: left;">unsigned character string</td>
<td style="text-align: left;">Human Readable Text, which usually
consists of input data plus one more check digit. Uses UTF-8 formatting,
with a terminating <code>NUL</code>.</td>
<td style="text-align: left;"><code>""</code> (empty) (output only)</td>
</tr>
<tr>
<td style="text-align: left;"><code>text_length</code></td>
<td style="text-align: left;">integer</td>
<td style="text-align: left;">Length of <code>text</code> in bytes.</td>
<td style="text-align: left;">0 (output only)</td>
</tr>
<tr>
<td style="text-align: left;"><code>rows</code></td>
<td style="text-align: left;">integer</td>
<td style="text-align: left;">Number of rows used by the symbol.</td>
<td style="text-align: left;">(output only)</td>
</tr>
<tr>
<td style="text-align: left;"><code>width</code></td>
<td style="text-align: left;">integer</td>
<td style="text-align: left;">Width of the generated symbol.</td>
<td style="text-align: left;">(output only)</td>
</tr>
<tr>
<td style="text-align: left;"><code>encoded_data</code></td>
<td style="text-align: left;">array of unsigned character arrays</td>
<td style="text-align: left;">Representation of the encoded data.</td>
<td style="text-align: left;">(output only)</td>
</tr>
<tr>
<td style="text-align: left;"><code>row_height</code></td>
<td style="text-align: left;">array of floats</td>
<td style="text-align: left;">Heights of each row.</td>
<td style="text-align: left;">(output only)</td>
</tr>
<tr>
<td style="text-align: left;"><code>errtxt</code></td>
<td style="text-align: left;">character string</td>
<td style="text-align: left;">Error message in the event that an error
occurred, with a terminating <code>NUL</code> - see <a
href="#handling-errors">5.8 Handling Errors</a>.</td>
<td style="text-align: left;">(output only)</td>
</tr>
<tr>
<td style="text-align: left;"><code>bitmap</code></td>
<td style="text-align: left;">pointer to unsigned character array</td>
<td style="text-align: left;">Pointer to stored bitmap image - see <a
href="#buffering-symbols-in-memory-raster">5.4 Buffering Symbols in
Memory (raster)</a>.</td>
<td style="text-align: left;">(output only)</td>
</tr>
<tr>
<td style="text-align: left;"><code>bitmap_width</code></td>
<td style="text-align: left;">integer</td>
<td style="text-align: left;">Width of stored bitmap image (in pixels) -
see <code>bitmap</code> member.</td>
<td style="text-align: left;">(output only)</td>
</tr>
<tr>
<td style="text-align: left;"><code>bitmap_height</code></td>
<td style="text-align: left;">integer</td>
<td style="text-align: left;">Height of stored bitmap image (in pixels)
- see <code>bitmap</code> member.</td>
<td style="text-align: left;">(output only)</td>
</tr>
<tr>
<td style="text-align: left;"><code>alphamap</code></td>
<td style="text-align: left;">pointer to unsigned character array</td>
<td style="text-align: left;">Pointer to array representing alpha
channel of stored bitmap image (or <code>NULL</code> if no alpha channel
used) - see <code>bitmap</code> member.</td>
<td style="text-align: left;">(output only)</td>
</tr>
<tr>
<td style="text-align: left;"><code>vector</code></td>
<td style="text-align: left;">pointer to vector structure</td>
<td style="text-align: left;">Pointer to vector header containing
pointers to vector elements - see <a
href="#buffering-symbols-in-memory-vector">5.5 Buffering Symbols in
Memory (vector)</a>.</td>
<td style="text-align: left;">(output only)</td>
</tr>
<tr>
<td style="text-align: left;"><code>memfile</code></td>
<td style="text-align: left;">pointer to unsigned character array</td>
<td style="text-align: left;">Pointer to in-memory file buffer if
<code>BARCODE_MEMORY_FILE</code> set in <code>output_options</code> -
see <a href="#buffering-symbols-in-memory-memfile">5.6 Buffering Symbols
in Memory (memfile)</a>.</td>
<td style="text-align: left;">(output only)</td>
</tr>
<tr>
<td style="text-align: left;"><code>memfile_size</code></td>
<td style="text-align: left;">integer</td>
<td style="text-align: left;">Length of in-memory file buffer.</td>
<td style="text-align: left;">(output only)</td>
</tr>
</tbody>
</table>
</div>
<p>To alter these values use the syntax shown in the example below. This
code has the same result as the previous example except the output is
now taller and plotted in green.</p>
<div class="sourceCode" id="cb65"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb65-1"><a href="#cb65-1" aria-hidden="true" tabindex="-1"></a><span class="pp">#include </span><span class="im">&lt;zint.h&gt;</span></span>
<span id="cb65-2"><a href="#cb65-2" aria-hidden="true" tabindex="-1"></a><span class="pp">#include </span><span class="im">&lt;string.h&gt;</span></span>
<span id="cb65-3"><a href="#cb65-3" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> main<span class="op">(</span><span class="dt">int</span> argc<span class="op">,</span> <span class="dt">char</span> <span class="op">**</span>argv<span class="op">)</span></span>
<span id="cb65-4"><a href="#cb65-4" aria-hidden="true" tabindex="-1"></a><span class="op">{</span></span>
<span id="cb65-5"><a href="#cb65-5" aria-hidden="true" tabindex="-1"></a>    <span class="kw">struct</span> zint_symbol <span class="op">*</span>my_symbol<span class="op">;</span></span>
<span id="cb65-6"><a href="#cb65-6" aria-hidden="true" tabindex="-1"></a>    my_symbol <span class="op">=</span> ZBarcode_Create<span class="op">();</span></span>
<span id="cb65-7"><a href="#cb65-7" aria-hidden="true" tabindex="-1"></a>    strcpy<span class="op">(</span>my_symbol<span class="op">-&gt;</span>fgcolour<span class="op">,</span> <span class="st">&quot;00ff00&quot;</span><span class="op">);</span></span>
<span id="cb65-8"><a href="#cb65-8" aria-hidden="true" tabindex="-1"></a>    my_symbol<span class="op">-&gt;</span>height <span class="op">=</span> <span class="fl">400.0</span><span class="bu">f</span><span class="op">;</span></span>
<span id="cb65-9"><a href="#cb65-9" aria-hidden="true" tabindex="-1"></a>    ZBarcode_Encode_and_Print<span class="op">(</span>my_symbol<span class="op">,</span> argv<span class="op">[</span><span class="dv">1</span><span class="op">],</span> <span class="dv">0</span><span class="op">,</span> <span class="dv">0</span><span class="op">);</span></span>
<span id="cb65-10"><a href="#cb65-10" aria-hidden="true" tabindex="-1"></a>    ZBarcode_Delete<span class="op">(</span>my_symbol<span class="op">);</span></span>
<span id="cb65-11"><a href="#cb65-11" aria-hidden="true" tabindex="-1"></a>    <span class="cf">return</span> <span class="dv">0</span><span class="op">;</span></span>
<span id="cb65-12"><a href="#cb65-12" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span></code></pre></div>
<p>Note that background removal for all outputs except BMP can be
achieved by setting the background alpha to <code>"00"</code> where the
values for R, G and B will be ignored:</p>
<div class="sourceCode" id="cb66"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb66-1"><a href="#cb66-1" aria-hidden="true" tabindex="-1"></a>    strcpy<span class="op">(</span>my_symbol<span class="op">-&gt;</span>bgcolour<span class="op">,</span> <span class="st">&quot;55555500&quot;</span><span class="op">);</span></span></code></pre></div>
<p>This is what the CLI option <code>--nobackground</code> does - see <a
href="#using-colour">4.7 Using Colour</a>.</p>
<h2 id="handling-errors">5.8 Handling Errors</h2>
<p>If errors occur during encoding a non-zero integer value is passed
back to the calling application. In addition the <code>errtxt</code>
member is set to a message detailing the nature of the error. The errors
generated by Zint are:</p>
<div id="tbl:api_warnings_errors" class="tablenos">
<table id="tbl:api_warnings_errors"
data-tag=": API Warning and Error Return Values">
<caption><span>Table : API Warning and Error Return Values</span>
</caption>
<colgroup>
<col style="width: 39%" />
<col style="width: 60%" />
</colgroup>
<thead>
<tr>
<th style="text-align: left;">Return Value</th>
<th style="text-align: left;">Meaning</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;"><code>ZINT_WARN_HRT_TRUNCATED</code></td>
<td style="text-align: left;">The Human Readable Text returned in
<code>text</code> was truncated (maximum 255 bytes).</td>
</tr>
<tr>
<td style="text-align: left;"><code>ZINT_WARN_INVALID_OPTION</code></td>
<td style="text-align: left;">One of the values in
<code>zint_struct</code> was set incorrectly but Zint has made a guess
at what it should have been and generated a barcode accordingly.</td>
</tr>
<tr>
<td style="text-align: left;"><code>ZINT_WARN_USES_ECI</code></td>
<td style="text-align: left;">Zint has automatically inserted an ECI
character. The symbol may not be readable with some readers.</td>
</tr>
<tr>
<td style="text-align: left;"><code>ZINT_WARN_NONCOMPLIANT</code></td>
<td style="text-align: left;">The symbol was created but is not
compliant with certain standards set in its specification (e.g. height,
GS1 AI data lengths).</td>
</tr>
<tr>
<td style="text-align: left;"><code>ZINT_ERROR</code></td>
<td style="text-align: left;">Marks the divide between warnings and
errors. For return values greater than or equal to this no symbol (or
only an incomplete symbol) is generated.</td>
</tr>
<tr>
<td style="text-align: left;"><code>ZINT_ERROR_TOO_LONG</code></td>
<td style="text-align: left;">The input data is too long or too short
for the selected symbology. No symbol has been generated.</td>
</tr>
<tr>
<td style="text-align: left;"><code>ZINT_ERROR_INVALID_DATA</code></td>
<td style="text-align: left;">The data to be encoded includes characters
which are not permitted by the selected symbology (e.g. alphabetic
characters in an EAN symbol). No symbol has been generated.</td>
</tr>
<tr>
<td style="text-align: left;"><code>ZINT_ERROR_INVALID_CHECK</code></td>
<td style="text-align: left;">Data with an incorrect check digit has
been entered. No symbol has been generated.</td>
</tr>
<tr>
<td
style="text-align: left;"><code>ZINT_ERROR_INVALID_OPTION</code></td>
<td style="text-align: left;">One of the values in
<code>zint_struct</code> was set incorrectly and Zint was unable (or
unwilling) to guess what it should have been. No symbol has been
generated.</td>
</tr>
<tr>
<td
style="text-align: left;"><code>ZINT_ERROR_ENCODING_PROBLEM</code></td>
<td style="text-align: left;">A problem has occurred during encoding of
the data. This should never happen. Please contact the developer if you
encounter this error.</td>
</tr>
<tr>
<td style="text-align: left;"><code>ZINT_ERROR_FILE_ACCESS</code></td>
<td style="text-align: left;">Zint was unable to open the requested
output file. This is usually a file permissions problem.</td>
</tr>
<tr>
<td style="text-align: left;"><code>ZINT_ERROR_MEMORY</code></td>
<td style="text-align: left;">Zint ran out of memory. This should only
be a problem with legacy systems.</td>
</tr>
<tr>
<td style="text-align: left;"><code>ZINT_ERROR_FILE_WRITE</code></td>
<td style="text-align: left;">Zint failed to write all contents to the
requested output file. This should only occur if the output device
becomes full.</td>
</tr>
<tr>
<td style="text-align: left;"><code>ZINT_ERROR_USES_ECI</code></td>
<td style="text-align: left;">Returned if <code>warn_level</code> set to
<code>WARN_FAIL_ALL</code> and <code>ZINT_WARN_USES_ECI</code>
occurs.</td>
</tr>
<tr>
<td style="text-align: left;"><code>ZINT_ERROR_NONCOMPLIANT</code></td>
<td style="text-align: left;">Returned if <code>warn_level</code> set to
<code>WARN_FAIL_ALL</code> and <code>ZINT_WARN_NONCOMPLIANT</code>
occurs.</td>
</tr>
<tr>
<td style="text-align: left;"><code>ZINT_ERROR_HRT_TRUNCATED</code></td>
<td style="text-align: left;">Returned if <code>warn_level</code> set to
<code>WARN_FAIL_ALL</code> and <code>ZINT_WARN_HRT_TRUNCATED</code>
occurs.</td>
</tr>
</tbody>
</table>
</div>
<p>To catch errors use an integer variable as shown in the code
below:</p>
<div class="sourceCode" id="cb67"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb67-1"><a href="#cb67-1" aria-hidden="true" tabindex="-1"></a><span class="pp">#include </span><span class="im">&lt;zint.h&gt;</span></span>
<span id="cb67-2"><a href="#cb67-2" aria-hidden="true" tabindex="-1"></a><span class="pp">#include </span><span class="im">&lt;stdio.h&gt;</span></span>
<span id="cb67-3"><a href="#cb67-3" aria-hidden="true" tabindex="-1"></a><span class="pp">#include </span><span class="im">&lt;string.h&gt;</span></span>
<span id="cb67-4"><a href="#cb67-4" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> main<span class="op">(</span><span class="dt">int</span> argc<span class="op">,</span> <span class="dt">char</span> <span class="op">**</span>argv<span class="op">)</span></span>
<span id="cb67-5"><a href="#cb67-5" aria-hidden="true" tabindex="-1"></a><span class="op">{</span></span>
<span id="cb67-6"><a href="#cb67-6" aria-hidden="true" tabindex="-1"></a>    <span class="kw">struct</span> zint_symbol <span class="op">*</span>my_symbol<span class="op">;</span></span>
<span id="cb67-7"><a href="#cb67-7" aria-hidden="true" tabindex="-1"></a>    <span class="dt">int</span> error<span class="op">;</span></span>
<span id="cb67-8"><a href="#cb67-8" aria-hidden="true" tabindex="-1"></a>    my_symbol <span class="op">=</span> ZBarcode_Create<span class="op">();</span></span>
<span id="cb67-9"><a href="#cb67-9" aria-hidden="true" tabindex="-1"></a>    <span class="co">/* Set invalid foreground colour */</span></span>
<span id="cb67-10"><a href="#cb67-10" aria-hidden="true" tabindex="-1"></a>    strcpy<span class="op">(</span>my_symbol<span class="op">-&gt;</span>fgcolour<span class="op">,</span> <span class="st">&quot;nonsense&quot;</span><span class="op">);</span></span>
<span id="cb67-11"><a href="#cb67-11" aria-hidden="true" tabindex="-1"></a>    error <span class="op">=</span> ZBarcode_Encode_and_Print<span class="op">(</span>my_symbol<span class="op">,</span> argv<span class="op">[</span><span class="dv">1</span><span class="op">],</span> <span class="dv">0</span><span class="op">,</span> <span class="dv">0</span><span class="op">);</span></span>
<span id="cb67-12"><a href="#cb67-12" aria-hidden="true" tabindex="-1"></a>    <span class="cf">if</span> <span class="op">(</span>error <span class="op">!=</span> <span class="dv">0</span><span class="op">)</span> <span class="op">{</span></span>
<span id="cb67-13"><a href="#cb67-13" aria-hidden="true" tabindex="-1"></a>        <span class="co">/* Some warning or error occurred */</span></span>
<span id="cb67-14"><a href="#cb67-14" aria-hidden="true" tabindex="-1"></a>        printf<span class="op">(</span><span class="st">&quot;</span><span class="sc">%s\n</span><span class="st">&quot;</span><span class="op">,</span> my_symbol<span class="op">-&gt;</span>errtxt<span class="op">);</span></span>
<span id="cb67-15"><a href="#cb67-15" aria-hidden="true" tabindex="-1"></a>        <span class="cf">if</span> <span class="op">(</span>error <span class="op">&gt;=</span> ZINT_ERROR<span class="op">)</span> <span class="op">{</span></span>
<span id="cb67-16"><a href="#cb67-16" aria-hidden="true" tabindex="-1"></a>            <span class="co">/* Stop now */</span></span>
<span id="cb67-17"><a href="#cb67-17" aria-hidden="true" tabindex="-1"></a>            ZBarcode_Delete<span class="op">(</span>my_symbol<span class="op">);</span></span>
<span id="cb67-18"><a href="#cb67-18" aria-hidden="true" tabindex="-1"></a>            <span class="cf">return</span> <span class="dv">1</span><span class="op">;</span></span>
<span id="cb67-19"><a href="#cb67-19" aria-hidden="true" tabindex="-1"></a>        <span class="op">}</span></span>
<span id="cb67-20"><a href="#cb67-20" aria-hidden="true" tabindex="-1"></a>    <span class="op">}</span></span>
<span id="cb67-21"><a href="#cb67-21" aria-hidden="true" tabindex="-1"></a>    <span class="co">/* Otherwise carry on with the rest of the application */</span></span>
<span id="cb67-22"><a href="#cb67-22" aria-hidden="true" tabindex="-1"></a>    ZBarcode_Delete<span class="op">(</span>my_symbol<span class="op">);</span></span>
<span id="cb67-23"><a href="#cb67-23" aria-hidden="true" tabindex="-1"></a>    <span class="cf">return</span> <span class="dv">0</span><span class="op">;</span></span>
<span id="cb67-24"><a href="#cb67-24" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span></code></pre></div>
<p>This code will exit with the appropriate message:</p>
<pre><code>Error 881: Malformed foreground RGB colour &#39;nonsense&#39; (hexadecimal only)</code></pre>
<p>To treat all warnings as errors, set
<code>symbol-&gt;warn_level</code> to <code>WARN_FAIL_ALL</code>.</p>
<h2 id="specifying-a-symbology">5.9 Specifying a Symbology</h2>
<p>Symbologies can be specified by number or by name as shown in the
Table <a href="#tbl:barcode_types">: Barcode Types (Symbologies)</a>.
For example</p>
<div class="sourceCode" id="cb69"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb69-1"><a href="#cb69-1" aria-hidden="true" tabindex="-1"></a>symbol<span class="op">-&gt;</span>symbology <span class="op">=</span> BARCODE_LOGMARS<span class="op">;</span></span></code></pre></div>
<p>means the same as</p>
<div class="sourceCode" id="cb70"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb70-1"><a href="#cb70-1" aria-hidden="true" tabindex="-1"></a>symbol<span class="op">-&gt;</span>symbology <span class="op">=</span> <span class="dv">50</span><span class="op">;</span></span></code></pre></div>
<h2 id="adjusting-output-options">5.10 Adjusting Output Options</h2>
<p>The <code>output_options</code> member can be used to adjust various
aspects of the output file. To select more than one option from the
table below simply <code>OR</code> them together when adjusting this
value:</p>
<div class="sourceCode" id="cb71"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb71-1"><a href="#cb71-1" aria-hidden="true" tabindex="-1"></a>my_symbol<span class="op">-&gt;</span>output_options <span class="op">|=</span> BARCODE_BIND <span class="op">|</span> READER_INIT<span class="op">;</span></span></code></pre></div>
<div id="tbl:api_output_options" class="tablenos">
<table id="tbl:api_output_options" data-tag="$ $">
<caption><span>Table <span class="math inline"> </span>:</span> API
<code>output_options</code> Values </caption>
<colgroup>
<col style="width: 34%" />
<col style="width: 65%" />
</colgroup>
<thead>
<tr>
<th style="text-align: left;">Value</th>
<th style="text-align: left;">Effect</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">0</td>
<td style="text-align: left;">No options selected.</td>
</tr>
<tr>
<td style="text-align: left;"><code>BARCODE_BIND_TOP</code></td>
<td style="text-align: left;">Boundary bar above the symbol only.<a
href="#fn11" class="footnote-ref" id="fnref11"
role="doc-noteref"><sup>11</sup></a></td>
</tr>
<tr>
<td style="text-align: left;"><code>BARCODE_BIND</code></td>
<td style="text-align: left;">Boundary bars above and below the symbol
and between rows if stacking multiple symbols.<a href="#fn12"
class="footnote-ref" id="fnref12"
role="doc-noteref"><sup>12</sup></a></td>
</tr>
<tr>
<td style="text-align: left;"><code>BARCODE_BOX</code></td>
<td style="text-align: left;">Add a box surrounding the symbol and
whitespace.</td>
</tr>
<tr>
<td style="text-align: left;"><code>BARCODE_STDOUT</code></td>
<td style="text-align: left;">Output the file to stdout.</td>
</tr>
<tr>
<td style="text-align: left;"><code>READER_INIT</code></td>
<td style="text-align: left;">Create as a Reader Initialisation
(Programming) symbol.</td>
</tr>
<tr>
<td style="text-align: left;"><code>SMALL_TEXT</code></td>
<td style="text-align: left;">Use a smaller font for the Human Readable
Text.</td>
</tr>
<tr>
<td style="text-align: left;"><code>BOLD_TEXT</code></td>
<td style="text-align: left;">Embolden the Human Readable Text.</td>
</tr>
<tr>
<td style="text-align: left;"><code>CMYK_COLOUR</code></td>
<td style="text-align: left;">Select the CMYK colour space option for
Encapsulated PostScript and TIF files.</td>
</tr>
<tr>
<td style="text-align: left;"><code>BARCODE_DOTTY_MODE</code></td>
<td style="text-align: left;">Plot a matrix symbol using dots rather
than squares.</td>
</tr>
<tr>
<td style="text-align: left;"><code>GS1_GS_SEPARATOR</code></td>
<td style="text-align: left;">Use <code>GS</code> (Group Separator)
instead of <code>FNC1</code> as GS1 separator (Data Matrix only).</td>
</tr>
<tr>
<td style="text-align: left;"><code>OUT_BUFFER_INTERMEDIATE</code></td>
<td style="text-align: left;">Return the bitmap buffer as ASCII values
instead of separate colour channels - see <a
href="#buffering-symbols-in-memory-raster">5.4 Buffering Symbols in
Memory (raster)</a>.</td>
</tr>
<tr>
<td style="text-align: left;"><code>BARCODE_QUIET_ZONES</code></td>
<td style="text-align: left;">Add compliant quiet zones (additional to
any specified whitespace).<a href="#fn13" class="footnote-ref"
id="fnref13" role="doc-noteref"><sup>13</sup></a></td>
</tr>
<tr>
<td style="text-align: left;"><code>BARCODE_NO_QUIET_ZONES</code></td>
<td style="text-align: left;">Disable quiet zones, notably those with
defaults.</td>
</tr>
<tr>
<td style="text-align: left;"><code>COMPLIANT_HEIGHT</code></td>
<td style="text-align: left;">Warn if height specified not compliant, or
use standard height (if any) as default.</td>
</tr>
<tr>
<td style="text-align: left;"><code>EANUPC_GUARD_WHITESPACE</code></td>
<td style="text-align: left;">Add quiet zone indicators
(<code>"&lt;"</code> and/or <code>"&gt;"</code>) to HRT whitespace
(EAN/UPC).</td>
</tr>
<tr>
<td style="text-align: left;"><code>EMBED_VECTOR_FONT</code></td>
<td style="text-align: left;">Embed font in vector output - currently
available for SVG output only.</td>
</tr>
<tr>
<td style="text-align: left;"><code>BARCODE_MEMORY_FILE</code></td>
<td style="text-align: left;">Write output to in-memory buffer
<code>symbol-&gt;memfile</code> instead of to <code>outfile</code>
file.</td>
</tr>
</tbody>
</table>
</div>
<h2 id="setting-the-input-mode">5.11 Setting the Input Mode</h2>
<p>The way in which the input data is encoded can be set using the
<code>input_mode</code> member. Valid values are shown in the table
below.</p>
<div id="tbl:api_input_mode" class="tablenos">
<table id="tbl:api_input_mode" data-tag="$ $">
<caption><span>Table <span class="math inline"> </span>:</span> API
<code>input_mode</code> Values </caption>
<colgroup>
<col style="width: 25%" />
<col style="width: 74%" />
</colgroup>
<thead>
<tr>
<th style="text-align: left;">Value</th>
<th style="text-align: left;">Effect</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;"><code>DATA_MODE</code></td>
<td style="text-align: left;">Uses full 8-bit range interpreted as
binary data.</td>
</tr>
<tr>
<td style="text-align: left;"><code>UNICODE_MODE</code></td>
<td style="text-align: left;">Uses UTF-8 input.</td>
</tr>
<tr>
<td style="text-align: left;"><code>GS1_MODE</code></td>
<td style="text-align: left;">Encodes GS1 data using <code>FNC1</code>
characters.</td>
</tr>
<tr>
<td style="text-align: left;"></td>
<td style="text-align: left;"><em>The above are exclusive, the following
optional and OR-ed.</em></td>
</tr>
<tr>
<td style="text-align: left;"><code>ESCAPE_MODE</code></td>
<td style="text-align: left;">Process input data for escape
sequences.</td>
</tr>
<tr>
<td style="text-align: left;"><code>GS1PARENS_MODE</code></td>
<td style="text-align: left;">Parentheses (round brackets) used in GS1
data instead of square brackets to delimit Application Identifiers
(parentheses must not otherwise occur in the data).</td>
</tr>
<tr>
<td style="text-align: left;"><code>GS1NOCHECK_MODE</code></td>
<td style="text-align: left;">Do not check GS1 data for validity,
i.e. suppress checks for valid AIs and data lengths. Invalid characters
(e.g. control characters, extended ASCII characters) are still checked
for.</td>
</tr>
<tr>
<td style="text-align: left;"><code>HEIGHTPERROW_MODE</code></td>
<td style="text-align: left;">Interpret the <code>height</code> member
as per-row rather than as overall height.</td>
</tr>
<tr>
<td style="text-align: left;"><code>FAST_MODE</code></td>
<td style="text-align: left;">Use faster if less optimal encodation or
other shortcuts if available (affects <code>DATAMATRIX</code>,
<code>MICROPDF417</code>, <code>PDF417</code>, <code>QRCODE</code> and
<code>UPNQR</code> only).</td>
</tr>
<tr>
<td style="text-align: left;"><code>EXTRA_ESCAPE_MODE</code></td>
<td style="text-align: left;">Process special symbology-specific escape
sequences (<code>CODE128</code> only).</td>
</tr>
</tbody>
</table>
</div>
<p>The default mode is <code>DATA_MODE</code>. (Note that this differs
from the default for the CLI and GUI, which is
<code>UNICODE_MODE</code>.)</p>
<p><code>DATA_MODE</code>, <code>UNICODE_MODE</code> and
<code>GS1_MODE</code> are mutually exclusive, whereas
<code>ESCAPE_MODE</code>, <code>GS1PARENS_MODE</code>,
<code>GS1NOCHECK_MODE</code>, <code>HEIGHTPERROW_MODE</code>,
<code>FAST_MODE</code> and <code>EXTRA_ESCAPE_MODE</code> are optional.
So, for example, you can set</p>
<div class="sourceCode" id="cb72"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb72-1"><a href="#cb72-1" aria-hidden="true" tabindex="-1"></a>my_symbol<span class="op">-&gt;</span>input_mode <span class="op">=</span> UNICODE_MODE <span class="op">|</span> ESCAPE_MODE<span class="op">;</span></span></code></pre></div>
<p>or</p>
<div class="sourceCode" id="cb73"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb73-1"><a href="#cb73-1" aria-hidden="true" tabindex="-1"></a>my_symbol<span class="op">-&gt;</span>input_mode <span class="op">=</span> GS1_MODE <span class="op">|</span> GS1PARENS_MODE <span class="op">|</span> GS1NOCHECK_MODE<span class="op">;</span></span></code></pre></div>
<p>whereas</p>
<div class="sourceCode" id="cb74"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb74-1"><a href="#cb74-1" aria-hidden="true" tabindex="-1"></a>my_symbol<span class="op">-&gt;</span>input_mode <span class="op">=</span> DATA_MODE <span class="op">|</span> GS1_MODE<span class="op">;</span></span></code></pre></div>
<p>is not valid.</p>
<p>Permissible escape sequences (<code>ESCAPE_MODE</code>) are listed in
Table <a href="#tbl:escape_sequences">: Escape Sequences</a>, and the
special Code 128-only <code>EXTRA_ESCAPE_MODE</code> escape sequences
are given in <a href="#standard-code-128-iso-15417">6.1.10.1 Standard
Code 128 (ISO 15417)</a>. An example of <code>GS1PARENS_MODE</code>
usage is given in section <a href="#gs1-128">6.1.10.3 GS1-128</a>.</p>
<p><code>GS1NOCHECK_MODE</code> is for use with legacy systems that have
data that does not conform to the current GS1 standard. Printable ASCII
input is still checked for, as is the validity of GS1 data specified
without AIs (e.g. linear data for GS1 DataBar
Omnidirectional/Limited/etc.). Also checked is GS1 DataBar Expanded and
GS1 Composite input that is not in the GS1 encodable character set 82
(see GS1 General Specifications Figure 7.11.1 ‘GS1 AI encodable
character set 82’), otherwise encodation would fail.</p>
<p>For <code>HEIGHTPERROW_MODE</code>, see <code>--heightperrow</code>
in section <a href="#adjusting-height">4.4 Adjusting Height</a>. The
<code>height</code> member should be set to the desired per-row value on
input (it will be set to the overall height on output).</p>
<p><code>FAST_MODE</code> causes a less optimal encodation scheme to be
used for Data Matrix, MicroPDF417 and PDF417. For QR Code and UPNQR, it
affects Zint’s automatic mask selection - see <a
href="#qr-code-iso-18004">6.6.3 QR Code (ISO 18004)</a> for details.</p>
<h2 id="multiple-segments-1">5.12 Multiple Segments</h2>
<p>For input data requiring multiple ECIs, the following functions may
be used:</p>
<div class="sourceCode" id="cb75"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb75-1"><a href="#cb75-1" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_Encode_Segs<span class="op">(</span><span class="kw">struct</span> zint_symbol <span class="op">*</span>symbol<span class="op">,</span></span>
<span id="cb75-2"><a href="#cb75-2" aria-hidden="true" tabindex="-1"></a>      <span class="dt">const</span> <span class="kw">struct</span> zint_seg segs<span class="op">[],</span> <span class="dt">const</span> <span class="dt">int</span> seg_count<span class="op">);</span></span>
<span id="cb75-3"><a href="#cb75-3" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb75-4"><a href="#cb75-4" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_Encode_Segs_and_Print<span class="op">(</span><span class="kw">struct</span> zint_symbol <span class="op">*</span>symbol<span class="op">,</span></span>
<span id="cb75-5"><a href="#cb75-5" aria-hidden="true" tabindex="-1"></a>      <span class="dt">const</span> <span class="kw">struct</span> zint_seg segs<span class="op">[],</span> <span class="dt">const</span> <span class="dt">int</span> seg_count<span class="op">,</span> <span class="dt">int</span> rotate_angle<span class="op">);</span></span>
<span id="cb75-6"><a href="#cb75-6" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb75-7"><a href="#cb75-7" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_Encode_Segs_and_Buffer<span class="op">(</span><span class="kw">struct</span> zint_symbol <span class="op">*</span>symbol<span class="op">,</span></span>
<span id="cb75-8"><a href="#cb75-8" aria-hidden="true" tabindex="-1"></a>      <span class="dt">const</span> <span class="kw">struct</span> zint_seg segs<span class="op">[],</span> <span class="dt">const</span> <span class="dt">int</span> seg_count<span class="op">,</span> <span class="dt">int</span> rotate_angle<span class="op">);</span></span>
<span id="cb75-9"><a href="#cb75-9" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb75-10"><a href="#cb75-10" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_Encode_Segs_and_Buffer_Vector<span class="op">(</span><span class="kw">struct</span> zint_symbol <span class="op">*</span>symbol<span class="op">,</span></span>
<span id="cb75-11"><a href="#cb75-11" aria-hidden="true" tabindex="-1"></a>      <span class="dt">const</span> <span class="kw">struct</span> zint_seg segs<span class="op">[],</span> <span class="dt">const</span> <span class="dt">int</span> seg_count<span class="op">,</span> <span class="dt">int</span> rotate_angle<span class="op">);</span></span></code></pre></div>
<p>These are direct analogues of the previously mentioned
<code>ZBarcode_Encode()</code>,
<code>ZBarcode_Encode_and_Print()</code>,
<code>ZBarcode_Encode_and_Buffer()</code> and
<code>ZBarcode_Encode_and_Buffer_Vector()</code> respectively, where
instead of a pair consisting of <code>"source, length"</code>, a pair
consisting of <code>"segs, seg_count"</code> is given, with
<code>segs</code> being an array of <code>struct zint_seg</code>
segments and <code>seg_count</code> being the number of elements it
contains. The zint_seg structure is of the form:</p>
<div class="sourceCode" id="cb76"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb76-1"><a href="#cb76-1" aria-hidden="true" tabindex="-1"></a><span class="kw">struct</span> zint_seg <span class="op">{</span></span>
<span id="cb76-2"><a href="#cb76-2" aria-hidden="true" tabindex="-1"></a>    <span class="dt">unsigned</span> <span class="dt">char</span> <span class="op">*</span>source<span class="op">;</span> <span class="co">/* Data to encode */</span></span>
<span id="cb76-3"><a href="#cb76-3" aria-hidden="true" tabindex="-1"></a>    <span class="dt">int</span> length<span class="op">;</span>            <span class="co">/* Length of `source`. If 0, `source` must be</span></span>
<span id="cb76-4"><a href="#cb76-4" aria-hidden="true" tabindex="-1"></a><span class="co">                              NUL-terminated */</span></span>
<span id="cb76-5"><a href="#cb76-5" aria-hidden="true" tabindex="-1"></a>    <span class="dt">int</span> eci<span class="op">;</span>               <span class="co">/* Extended Channel Interpretation */</span></span>
<span id="cb76-6"><a href="#cb76-6" aria-hidden="true" tabindex="-1"></a><span class="op">};</span></span></code></pre></div>
<p>The symbology must support ECIs (see Table <a
href="#tbl:eci_aware_symbologies">: ECI-Aware Symbologies</a>). For
example:</p>
<div class="sourceCode" id="cb77"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb77-1"><a href="#cb77-1" aria-hidden="true" tabindex="-1"></a><span class="pp">#include </span><span class="im">&lt;zint.h&gt;</span></span>
<span id="cb77-2"><a href="#cb77-2" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> main<span class="op">(</span><span class="dt">int</span> argc<span class="op">,</span> <span class="dt">char</span> <span class="op">**</span>argv<span class="op">)</span></span>
<span id="cb77-3"><a href="#cb77-3" aria-hidden="true" tabindex="-1"></a><span class="op">{</span></span>
<span id="cb77-4"><a href="#cb77-4" aria-hidden="true" tabindex="-1"></a>    <span class="kw">struct</span> zint_seg segs<span class="op">[]</span> <span class="op">=</span> <span class="op">{</span></span>
<span id="cb77-5"><a href="#cb77-5" aria-hidden="true" tabindex="-1"></a>        <span class="op">{</span> <span class="st">&quot;Κείμενο&quot;</span><span class="op">,</span> <span class="dv">0</span><span class="op">,</span> <span class="dv">9</span> <span class="op">},</span></span>
<span id="cb77-6"><a href="#cb77-6" aria-hidden="true" tabindex="-1"></a>        <span class="op">{</span> <span class="st">&quot;Текст&quot;</span><span class="op">,</span> <span class="dv">0</span><span class="op">,</span> <span class="dv">7</span> <span class="op">},</span></span>
<span id="cb77-7"><a href="#cb77-7" aria-hidden="true" tabindex="-1"></a>        <span class="op">{</span> <span class="st">&quot;文章&quot;</span><span class="op">,</span> <span class="dv">0</span><span class="op">,</span> <span class="dv">20</span> <span class="op">}</span></span>
<span id="cb77-8"><a href="#cb77-8" aria-hidden="true" tabindex="-1"></a>    <span class="op">};</span></span>
<span id="cb77-9"><a href="#cb77-9" aria-hidden="true" tabindex="-1"></a>    <span class="kw">struct</span> zint_symbol <span class="op">*</span>my_symbol<span class="op">;</span></span>
<span id="cb77-10"><a href="#cb77-10" aria-hidden="true" tabindex="-1"></a>    my_symbol <span class="op">=</span> ZBarcode_Create<span class="op">();</span></span>
<span id="cb77-11"><a href="#cb77-11" aria-hidden="true" tabindex="-1"></a>    my_symbol<span class="op">-&gt;</span>symbology <span class="op">=</span> BARCODE_AZTEC<span class="op">;</span></span>
<span id="cb77-12"><a href="#cb77-12" aria-hidden="true" tabindex="-1"></a>    my_symbol<span class="op">-&gt;</span>input_mode <span class="op">=</span> UNICODE_MODE<span class="op">;</span></span>
<span id="cb77-13"><a href="#cb77-13" aria-hidden="true" tabindex="-1"></a>    ZBarcode_Encode_Segs<span class="op">(</span>my_symbol<span class="op">,</span> segs<span class="op">,</span> <span class="dv">3</span><span class="op">);</span></span>
<span id="cb77-14"><a href="#cb77-14" aria-hidden="true" tabindex="-1"></a>    ZBarcode_Print<span class="op">(</span>my_symbol<span class="op">,</span> <span class="dv">0</span><span class="op">);</span></span>
<span id="cb77-15"><a href="#cb77-15" aria-hidden="true" tabindex="-1"></a>    ZBarcode_Delete<span class="op">(</span>my_symbol<span class="op">);</span></span>
<span id="cb77-16"><a href="#cb77-16" aria-hidden="true" tabindex="-1"></a>    <span class="cf">return</span> <span class="dv">0</span><span class="op">;</span></span>
<span id="cb77-17"><a href="#cb77-17" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span></code></pre></div>
<p>A maximum of 256 segments may be specified. Use of multiple segments
with GS1 data is not currently supported.</p>
<h2 id="scaling-helpers">5.13 Scaling Helpers</h2>
<p>To help with scaling the output, the following three function are
available:</p>
<div class="sourceCode" id="cb78"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb78-1"><a href="#cb78-1" aria-hidden="true" tabindex="-1"></a><span class="dt">float</span> ZBarcode_Default_Xdim<span class="op">(</span><span class="dt">int</span> symbol_id<span class="op">);</span></span>
<span id="cb78-2"><a href="#cb78-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb78-3"><a href="#cb78-3" aria-hidden="true" tabindex="-1"></a><span class="dt">float</span> ZBarcode_Scale_From_XdimDp<span class="op">(</span><span class="dt">int</span> symbol_id<span class="op">,</span> <span class="dt">float</span> x_dim_mm<span class="op">,</span> <span class="dt">float</span> dpmm<span class="op">,</span></span>
<span id="cb78-4"><a href="#cb78-4" aria-hidden="true" tabindex="-1"></a>        <span class="dt">const</span> <span class="dt">char</span> <span class="op">*</span>filetype<span class="op">)</span> <span class="op">{</span></span>
<span id="cb78-5"><a href="#cb78-5" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb78-6"><a href="#cb78-6" aria-hidden="true" tabindex="-1"></a><span class="dt">float</span> ZBarcode_XdimDP_From_Scale<span class="op">(</span><span class="dt">int</span> symbol_id<span class="op">,</span> <span class="dt">float</span> scale<span class="op">,</span></span>
<span id="cb78-7"><a href="#cb78-7" aria-hidden="true" tabindex="-1"></a>        <span class="dt">float</span> x_dim_mm_or_dpmm<span class="op">,</span> <span class="dt">const</span> <span class="dt">char</span> <span class="op">*</span>filetype<span class="op">);</span></span></code></pre></div>
<p>The first <code>ZBarcode_Default_Xdim()</code> returns the default
X-dimension suggested by Zint for symbology <code>symbol_id</code>.</p>
<p>The second <code>ZBarcode_Scale_From_XdimDp()</code> returns the
scale to use to output to a file of type <code>filetype</code> with
X-dimension <code>x_dim_mm</code> at <code>dpmm</code> dots per mm. The
given X-dimension must be non-zero and less than or equal to 10mm,
however <code>dpmm</code> may be zero and defaults to 12 dpmm, and
<code>filetype</code> may be NULL or empty in which case a GIF filetype
is assumed. For raster output (BMP/GIF/PCX/PNG/TIF) the scale is rounded
to half-integer increments.</p>
<p>For example:</p>
<div class="sourceCode" id="cb79"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb79-1"><a href="#cb79-1" aria-hidden="true" tabindex="-1"></a><span class="co">/* Royal Mail 4-State Customer Code */</span></span>
<span id="cb79-2"><a href="#cb79-2" aria-hidden="true" tabindex="-1"></a>my_symbol<span class="op">-&gt;</span>symbology <span class="op">=</span> BARCODE_RM4SCC<span class="op">;</span></span>
<span id="cb79-3"><a href="#cb79-3" aria-hidden="true" tabindex="-1"></a>my_symbol<span class="op">-&gt;</span>dpmm <span class="op">=</span> <span class="fl">600.0</span><span class="bu">f</span> <span class="op">/</span> <span class="fl">25.4</span><span class="bu">f</span><span class="op">;</span> <span class="co">/* 600 dpi */</span></span>
<span id="cb79-4"><a href="#cb79-4" aria-hidden="true" tabindex="-1"></a>my_symbol<span class="op">-&gt;</span>scale <span class="op">=</span> ZBarcode_Scale_From_XdimDp<span class="op">(</span></span>
<span id="cb79-5"><a href="#cb79-5" aria-hidden="true" tabindex="-1"></a>                        my_symbol<span class="op">-&gt;</span>symbology<span class="op">,</span></span>
<span id="cb79-6"><a href="#cb79-6" aria-hidden="true" tabindex="-1"></a>                        ZBarcode_Default_Xdim<span class="op">(</span>my_symbol<span class="op">-&gt;</span>symbology<span class="op">),</span></span>
<span id="cb79-7"><a href="#cb79-7" aria-hidden="true" tabindex="-1"></a>                        my_symbol<span class="op">-&gt;</span>dpmm<span class="op">,</span> <span class="st">&quot;PNG&quot;</span><span class="op">);</span> <span class="co">/* Returns 7.5 */</span></span></code></pre></div>
<p>The third function <code>ZBarcode_XdimDP_From_Scale()</code> is the
“reverse” of <code>ZBarcode_Scale_From_XdimDp()</code>, returning the
X-dimension (in mm) or the dot density (in dpmm) given a scale
<code>scale</code>. Both <code>scale</code> and
<code>x_dim_mm_or_dpmm</code> must be non-zero. The returned value is
bound to the maximum value of dpmm (1000), so must be further bound to
10 on return if the X-dimension is sought.</p>
<p>Note that the X-dimension to use is application dependent, and varies
not only due to the symbology, resolution and filetype but also due to
the type of scanner used, the intended scanning distance, and what media
(“substrates”) the barcode appears on.</p>
<h2 id="verifying-symbology-availability">5.14 Verifying Symbology
Availability</h2>
<p>An additional function available in the API is:</p>
<div class="sourceCode" id="cb80"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb80-1"><a href="#cb80-1" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_ValidID<span class="op">(</span><span class="dt">int</span> symbol_id<span class="op">);</span></span></code></pre></div>
<p>which allows you to check whether a given symbology is available,
returning a non-zero value if so. For example:</p>
<div class="sourceCode" id="cb81"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb81-1"><a href="#cb81-1" aria-hidden="true" tabindex="-1"></a><span class="cf">if</span> <span class="op">(</span>ZBarcode_ValidID<span class="op">(</span>BARCODE_PDF417<span class="op">)</span> <span class="op">!=</span> <span class="dv">0</span><span class="op">)</span> <span class="op">{</span></span>
<span id="cb81-2"><a href="#cb81-2" aria-hidden="true" tabindex="-1"></a>    printf<span class="op">(</span><span class="st">&quot;PDF417 available</span><span class="sc">\n</span><span class="st">&quot;</span><span class="op">);</span></span>
<span id="cb81-3"><a href="#cb81-3" aria-hidden="true" tabindex="-1"></a><span class="op">}</span> <span class="cf">else</span> <span class="op">{</span></span>
<span id="cb81-4"><a href="#cb81-4" aria-hidden="true" tabindex="-1"></a>    printf<span class="op">(</span><span class="st">&quot;PDF417 not available</span><span class="sc">\n</span><span class="st">&quot;</span><span class="op">);</span></span>
<span id="cb81-5"><a href="#cb81-5" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span></code></pre></div>
<p>Another function that may be useful is:</p>
<div class="sourceCode" id="cb82"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb82-1"><a href="#cb82-1" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_BarcodeName<span class="op">(</span><span class="dt">int</span> symbol_id<span class="op">,</span> <span class="dt">char</span> name<span class="op">[</span><span class="dv">32</span><span class="op">]);</span></span></code></pre></div>
<p>which copies the name of a symbology into the supplied
<code>name</code> buffer, which should be 32 characters in length. The
name is <code>NUL</code>-terminated, and zero is returned on success.
For instance:</p>
<div class="sourceCode" id="cb83"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb83-1"><a href="#cb83-1" aria-hidden="true" tabindex="-1"></a><span class="dt">char</span> name<span class="op">[</span><span class="dv">32</span><span class="op">];</span></span>
<span id="cb83-2"><a href="#cb83-2" aria-hidden="true" tabindex="-1"></a><span class="cf">if</span> <span class="op">(</span>ZBarcode_BarcodeName<span class="op">(</span>BARCODE_PDF417<span class="op">,</span> name<span class="op">)</span> <span class="op">==</span> <span class="dv">0</span><span class="op">)</span> <span class="op">{</span></span>
<span id="cb83-3"><a href="#cb83-3" aria-hidden="true" tabindex="-1"></a>    printf<span class="op">(</span><span class="st">&quot;</span><span class="sc">%s\n</span><span class="st">&quot;</span><span class="op">,</span> name<span class="op">);</span></span>
<span id="cb83-4"><a href="#cb83-4" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span></code></pre></div>
<p>will print <code>BARCODE_PDF417</code>.</p>
<h2 id="checking-symbology-capabilities">5.15 Checking Symbology
Capabilities</h2>
<p>It can be useful for frontend programs to know the capabilities of a
symbology. This can be determined using another additional function:</p>
<div class="sourceCode" id="cb84"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb84-1"><a href="#cb84-1" aria-hidden="true" tabindex="-1"></a><span class="dt">unsigned</span> <span class="dt">int</span> ZBarcode_Cap<span class="op">(</span><span class="dt">int</span> symbol_id<span class="op">,</span> <span class="dt">unsigned</span> <span class="dt">int</span> cap_flag<span class="op">);</span></span></code></pre></div>
<p>by <code>OR</code>-ing the flags below in the <code>cap_flag</code>
argument and checking the return to see which are set.</p>
<div id="tbl:api_cap" class="tablenos">
<table id="tbl:api_cap" data-tag=": API Capability Flags">
<caption><span>Table : API Capability Flags</span> </caption>
<colgroup>
<col style="width: 35%" />
<col style="width: 64%" />
</colgroup>
<thead>
<tr>
<th style="text-align: left;">Value</th>
<th style="text-align: left;">Meaning</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;"><code>ZINT_CAP_HRT</code></td>
<td style="text-align: left;">Can the symbology print Human Readable
Text?</td>
</tr>
<tr>
<td style="text-align: left;"><code>ZINT_CAP_STACKABLE</code></td>
<td style="text-align: left;">Is the symbology stackable?</td>
</tr>
<tr>
<td style="text-align: left;"><code>ZINT_CAP_EANUPC</code><a
href="#fn14" class="footnote-ref" id="fnref14"
role="doc-noteref"><sup>14</sup></a></td>
<td style="text-align: left;">Is the symbology EAN/UPC?</td>
</tr>
<tr>
<td style="text-align: left;"><code>ZINT_CAP_COMPOSITE</code></td>
<td style="text-align: left;">Does the symbology support composite data?
(see <a href="#gs1-composite-symbols-iso-24723">6.3 GS1 Composite
Symbols (ISO 24723)</a> below)</td>
</tr>
<tr>
<td style="text-align: left;"><code>ZINT_CAP_ECI</code></td>
<td style="text-align: left;">Does the symbology support Extended
Channel Interpretations?</td>
</tr>
<tr>
<td style="text-align: left;"><code>ZINT_CAP_GS1</code></td>
<td style="text-align: left;">Does the symbology support GS1 data?</td>
</tr>
<tr>
<td style="text-align: left;"><code>ZINT_CAP_DOTTY</code></td>
<td style="text-align: left;">Can the symbology be outputted as
dots?</td>
</tr>
<tr>
<td style="text-align: left;"><code>ZINT_CAP_QUIET_ZONES</code></td>
<td style="text-align: left;">Does the symbology have default quiet
zones?</td>
</tr>
<tr>
<td style="text-align: left;"><code>ZINT_CAP_FIXED_RATIO</code></td>
<td style="text-align: left;">Does the symbology have a fixed
width-to-height (aspect) ratio?</td>
</tr>
<tr>
<td style="text-align: left;"><code>ZINT_CAP_READER_INIT</code></td>
<td style="text-align: left;">Does the symbology support Reader
Initialisation?</td>
</tr>
<tr>
<td style="text-align: left;"><code>ZINT_CAP_FULL_MULTIBYTE</code></td>
<td style="text-align: left;">Is the <code>ZINT_FULL_MULTIBYTE</code>
option applicable?</td>
</tr>
<tr>
<td style="text-align: left;"><code>ZINT_CAP_MASK</code></td>
<td style="text-align: left;">Is mask selection applicable?</td>
</tr>
<tr>
<td style="text-align: left;"><code>ZINT_CAP_STRUCTAPP</code></td>
<td style="text-align: left;">Does the symbology support Structured
Append?</td>
</tr>
<tr>
<td
style="text-align: left;"><code>ZINT_CAP_COMPLIANT_HEIGHT</code></td>
<td style="text-align: left;">Does the symbology have a compliant height
defined?</td>
</tr>
</tbody>
</table>
</div>
<p>For example:</p>
<div class="sourceCode" id="cb85"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb85-1"><a href="#cb85-1" aria-hidden="true" tabindex="-1"></a><span class="dt">unsigned</span> <span class="dt">int</span> cap<span class="op">;</span></span>
<span id="cb85-2"><a href="#cb85-2" aria-hidden="true" tabindex="-1"></a>cap <span class="op">=</span> ZBarcode_Cap<span class="op">(</span>BARCODE_PDF417<span class="op">,</span> ZINT_CAP_HRT <span class="op">|</span> ZINT_CAP_ECI<span class="op">);</span></span>
<span id="cb85-3"><a href="#cb85-3" aria-hidden="true" tabindex="-1"></a><span class="cf">if</span> <span class="op">(</span>cap <span class="op">&amp;</span> ZINT_CAP_HRT<span class="op">)</span> <span class="op">{</span></span>
<span id="cb85-4"><a href="#cb85-4" aria-hidden="true" tabindex="-1"></a>    printf<span class="op">(</span><span class="st">&quot;PDF417 supports HRT</span><span class="sc">\n</span><span class="st">&quot;</span><span class="op">);</span></span>
<span id="cb85-5"><a href="#cb85-5" aria-hidden="true" tabindex="-1"></a><span class="op">}</span> <span class="cf">else</span> <span class="op">{</span></span>
<span id="cb85-6"><a href="#cb85-6" aria-hidden="true" tabindex="-1"></a>    printf<span class="op">(</span><span class="st">&quot;PDF417 does not support HRT</span><span class="sc">\n</span><span class="st">&quot;</span><span class="op">);</span></span>
<span id="cb85-7"><a href="#cb85-7" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span>
<span id="cb85-8"><a href="#cb85-8" aria-hidden="true" tabindex="-1"></a><span class="cf">if</span> <span class="op">(</span>cap <span class="op">&amp;</span> ZINT_CAP_ECI<span class="op">)</span> <span class="op">{</span></span>
<span id="cb85-9"><a href="#cb85-9" aria-hidden="true" tabindex="-1"></a>    printf<span class="op">(</span><span class="st">&quot;PDF417 supports ECI</span><span class="sc">\n</span><span class="st">&quot;</span><span class="op">);</span></span>
<span id="cb85-10"><a href="#cb85-10" aria-hidden="true" tabindex="-1"></a><span class="op">}</span> <span class="cf">else</span> <span class="op">{</span></span>
<span id="cb85-11"><a href="#cb85-11" aria-hidden="true" tabindex="-1"></a>    printf<span class="op">(</span><span class="st">&quot;PDF417 does not support ECI</span><span class="sc">\n</span><span class="st">&quot;</span><span class="op">);</span></span>
<span id="cb85-12"><a href="#cb85-12" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span></code></pre></div>
<h2 id="zint-version">5.16 Zint Version</h2>
<p>Whether the Zint library linked to was built with PNG support may be
determined with:</p>
<div class="sourceCode" id="cb86"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb86-1"><a href="#cb86-1" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_NoPng<span class="op">();</span></span></code></pre></div>
<p>which returns 1 if no PNG support is available, else zero.</p>
<p>Lastly, the version of the Zint library linked to is returned by:</p>
<div class="sourceCode" id="cb87"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb87-1"><a href="#cb87-1" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_Version<span class="op">();</span></span></code></pre></div>
<p>The version parts are separated by hundreds. For instance, version
<code>"2.9.1"</code> is returned as <code>"20901"</code>.</p>
<h1 id="types-of-symbology">6. Types of Symbology</h1>
<h2 id="one-dimensional-symbols">6.1 One-Dimensional Symbols</h2>
<p>One-dimensional or linear symbols are what most people associate with
the term barcode. They consist of a number of bars and a number of
spaces of differing widths.</p>
<h3 id="code-11">6.1.1 Code 11</h3>
<figure>
<img src="images/code11.svg" title="fig:" class="lin"
alt="zint -b CODE11 -d &quot;9212320967&quot;" />
<figcaption
aria-hidden="true"><code>zint -b CODE11 -d "9212320967"</code></figcaption>
</figure>
<p>Developed by Intermec in 1977, Code 11 is similar to Code 2 of 5
Matrix and is primarily used in telecommunications. The symbol can
encode data consisting of the digits 0-9 and the dash character
(<code>-</code>) up to a maximum of 140 characters. Two modulo-11 check
digits are added by default. To add just one check digit, set
<code>--vers=1</code> (API <code>option_2 = 1</code>). To add no check
digits, set <code>--vers=2</code> (API <code>option_2 = 2</code>).</p>
<h3 id="code-2-of-5">6.1.2 Code 2 of 5</h3>
<p>Code 2 of 5 is a family of one-dimensional symbols, 8 of which are
supported by Zint. Note that the names given to these standards alters
from one source to another so you should take care to ensure that you
have the right barcode type before using these standards.</p>
<h4 id="standard-code-2-of-5">6.1.2.1 Standard Code 2 of 5</h4>
<figure>
<img src="images/c25standard.svg" title="fig:" class="lin"
alt="zint -b C25STANDARD -d &quot;9212320967&quot;" />
<figcaption
aria-hidden="true"><code>zint -b C25STANDARD -d "9212320967"</code></figcaption>
</figure>
<p>Also known as Code 2 of 5 Matrix, this is a self-checking code used
in industrial applications and photo development. Standard Code 2 of 5
will encode numeric input (digits 0-9) up to a maximum of 112 digits. No
check digit is added by default. To add a check digit, set
<code>--vers=1</code> (API <code>option_2 = 1</code>). To add a check
digit but not show it in the Human Readable Text, set
<code>--vers=2</code> (API <code>option_2 = 2</code>).</p>
<h4 id="iata-code-2-of-5">6.1.2.2 IATA Code 2 of 5</h4>
<figure>
<img src="images/c25iata.svg" title="fig:" class="lin"
alt="zint -b C25IATA -d &quot;9212320967&quot;" />
<figcaption
aria-hidden="true"><code>zint -b C25IATA -d "9212320967"</code></figcaption>
</figure>
<p>Used for baggage handling in the air-transport industry by the
International Air Transport Agency, this self-checking code will encode
numeric input (digits 0-9) up to a maximum of 80 digits. No check digit
is added by default, but can be set the same as for <a
href="#standard-code-2-of-5">6.1.2.1 Standard Code 2 of 5</a>.</p>
<h4 id="industrial-code-2-of-5">6.1.2.3 Industrial Code 2 of 5</h4>
<figure>
<img src="images/c25ind.svg" title="fig:" class="lin"
alt="zint -b C25IND -d &quot;9212320967&quot;" />
<figcaption
aria-hidden="true"><code>zint -b C25IND -d "9212320967"</code></figcaption>
</figure>
<p>Industrial Code 2 of 5 can encode numeric input (digits 0-9) up to a
maximum of 79 digits. No check digit is added by default, but can be set
the same as for <a href="#standard-code-2-of-5">6.1.2.1 Standard Code 2
of 5</a>.</p>
<h4 id="interleaved-code-2-of-5-iso-16390">6.1.2.4 Interleaved Code 2 of
5 (ISO 16390)</h4>
<figure>
<img src="images/c25inter.svg" title="fig:" class="lin"
alt="zint -b C25INTER --compliantheight -d &quot;9212320967&quot;" />
<figcaption
aria-hidden="true"><code>zint -b C25INTER --compliantheight -d "9212320967"</code></figcaption>
</figure>
<p>This self-checking symbology encodes pairs of numbers, and so can
only encode an even number of digits (0-9). If an odd number of digits
is entered a leading zero is added by Zint. A maximum of 62 pairs (124
digits) can be encoded. No check digit is added by default, but can be
set the same as for <a href="#standard-code-2-of-5">6.1.2.1 Standard
Code 2 of 5</a>.</p>
<h4 id="code-2-of-5-data-logic">6.1.2.5 Code 2 of 5 Data Logic</h4>
<figure>
<img src="images/c25logic.svg" title="fig:" class="lin"
alt="zint -b C25LOGIC -d &quot;9212320967&quot;" />
<figcaption
aria-hidden="true"><code>zint -b C25LOGIC -d "9212320967"</code></figcaption>
</figure>
<p>Data Logic does not include a check digit by default and can encode
numeric input (digits 0-9) up to a maximum of 113 digits. Check digit
options are the same as for <a href="#standard-code-2-of-5">6.1.2.1
Standard Code 2 of 5</a>.</p>
<h4 id="itf-14">6.1.2.6 ITF-14</h4>
<figure>
<img src="images/itf14.svg" title="fig:" class="lin"
alt="zint -b ITF14 --compliantheight -d &quot;9212320967145&quot;" />
<figcaption
aria-hidden="true"><code>zint -b ITF14 --compliantheight -d "9212320967145"</code></figcaption>
</figure>
<p>ITF-14, also known as UPC Shipping Container Symbol or Case Code, is
based on Interleaved Code 2 of 5 and requires a 13-digit numeric input
(digits 0-9). One modulo-10 check digit is added by Zint.</p>
<p>If no border option is specified Zint defaults to adding a bounding
box with a border width of 5. This behaviour can be overridden by using
the <code>--bind</code> option (API
<code>output_options |= BARCODE_BIND</code>). Similarly the border width
can be overridden using <code>--border</code> (API
<code>border_width</code>). If a symbol with no border is required this
can be achieved by explicitly setting the border type to box (or bind or
bindtop) and leaving the border width 0.</p>
<figure>
<img src="images/itf14_border0.svg" title="fig:" class="lin"
alt="zint -b ITF14 --box --compliantheight -d &quot;9212320967145&quot;" />
<figcaption
aria-hidden="true"><code>zint -b ITF14 --box --compliantheight -d "9212320967145"</code></figcaption>
</figure>
<h4 id="deutsche-post-leitcode">6.1.2.7 Deutsche Post Leitcode</h4>
<figure>
<img src="images/dpleit.svg" title="fig:" class="lin"
alt="zint -b DPLEIT -d &quot;9212320967145&quot;" />
<figcaption
aria-hidden="true"><code>zint -b DPLEIT -d "9212320967145"</code></figcaption>
</figure>
<p>Leitcode is based on Interleaved Code 2 of 5 and is used by Deutsche
Post for routing purposes. Leitcode requires a 13-digit numerical input
to which Zint adds a check digit.</p>
<h4 id="deutsche-post-identcode">6.1.2.8 Deutsche Post Identcode</h4>
<figure>
<img src="images/dpident.svg" title="fig:" class="lin"
alt="zint -b DPIDENT -d &quot;91232096712&quot;" />
<figcaption
aria-hidden="true"><code>zint -b DPIDENT -d "91232096712"</code></figcaption>
</figure>
<p>Identcode is based on Interleaved Code 2 of 5 and is used by Deutsche
Post for identification purposes. Identcode requires an 11-digit
numerical input to which Zint adds a check digit.</p>
<h3 id="upc-universal-product-code-iso-15420">6.1.3 UPC (Universal
Product Code) (ISO 15420)</h3>
<h4 id="upc-version-a">6.1.3.1 UPC Version A</h4>
<figure>
<img src="images/upca.svg" title="fig:" class="upcean"
alt="zint -b UPCA --compliantheight -d &quot;72527270270&quot;" />
<figcaption
aria-hidden="true"><code>zint -b UPCA --compliantheight -d "72527270270"</code></figcaption>
</figure>
<p>UPC-A is used in the United States for retail applications. The
symbol requires an 11-digit article number. The check digit is
calculated by Zint. In addition EAN-2 and EAN-5 add-on symbols can be
added using the <code>+</code> character. For example, to draw a UPC-A
symbol with the data 72527270270 with an EAN-5 add-on showing the data
12345 use the command:</p>
<div class="sourceCode" id="cb88"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb88-1"><a href="#cb88-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> UPCA <span class="at">-d</span> <span class="st">&quot;72527270270+12345&quot;</span></span></code></pre></div>
<p>or using the API encode a data string with the <code>+</code>
character included:</p>
<div class="sourceCode" id="cb89"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb89-1"><a href="#cb89-1" aria-hidden="true" tabindex="-1"></a>my_symbol<span class="op">-&gt;</span>symbology <span class="op">=</span> BARCODE_UPCA<span class="op">;</span></span>
<span id="cb89-2"><a href="#cb89-2" aria-hidden="true" tabindex="-1"></a>error <span class="op">=</span> ZBarcode_Encode_and_Print<span class="op">(</span>my_symbol<span class="op">,</span> <span class="st">&quot;72527270270+12345&quot;</span><span class="op">,</span> <span class="dv">0</span><span class="op">,</span> <span class="dv">0</span><span class="op">);</span></span></code></pre></div>
<figure>
<img src="images/upca_5.svg" title="fig:" class="upcean"
alt="zint -b UPCA --compliantheight -d &quot;72527270270+12345&quot;" />
<figcaption
aria-hidden="true"><code>zint -b UPCA --compliantheight -d "72527270270+12345"</code></figcaption>
</figure>
<p>If your input data already includes the check digit symbology
<code>BARCODE_UPCA_CHK</code> (35) can be used which takes a 12-digit
input and validates the check digit before encoding.</p>
<p>A quiet zone indicator can be added to the HRT by setting
<code>--guardwhitespace</code> (API
<code>output_options |= EANUPC_GUARD_WHITESPACE</code>). For UPC, this
is only relevant when there is add-on:</p>
<div class="sourceCode" id="cb90"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb90-1"><a href="#cb90-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> UPCA <span class="at">-d</span> <span class="st">&quot;72527270270+12345&quot;</span> <span class="at">--guardwhitespace</span></span></code></pre></div>
<p>or using the API:</p>
<div class="sourceCode" id="cb91"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb91-1"><a href="#cb91-1" aria-hidden="true" tabindex="-1"></a>my_symbol<span class="op">-&gt;</span>symbology <span class="op">=</span> BARCODE_UPCA<span class="op">;</span></span>
<span id="cb91-2"><a href="#cb91-2" aria-hidden="true" tabindex="-1"></a>my_symbol<span class="op">-&gt;</span>output_options <span class="op">|=</span> EANUPC_GUARD_WHITESPACE<span class="op">;</span></span>
<span id="cb91-3"><a href="#cb91-3" aria-hidden="true" tabindex="-1"></a>error <span class="op">=</span> ZBarcode_Encode_and_Print<span class="op">(</span>my_symbol<span class="op">,</span> <span class="st">&quot;72527270270+12345&quot;</span><span class="op">,</span> <span class="dv">0</span><span class="op">,</span> <span class="dv">0</span><span class="op">);</span></span></code></pre></div>
<figure>
<img src="images/upca_5_gws.svg" title="fig:" class="upcean"
alt="zint -b UPCA --compliantheight -d &quot;72527270270+12345&quot; --guardwhitespace" />
<figcaption
aria-hidden="true"><code>zint -b UPCA --compliantheight -d "72527270270+12345" --guardwhitespace</code></figcaption>
</figure>
<p>You can adjust the gap between the main symbol and an add-on in
integral multiples of the X-dimension by setting <code>--addongap</code>
(API <code>option_2</code>) to a value between 9 (default) and 12. The
height in X-dimensions that the guard bars descend below the main bars
can be adjusted by setting <code>--guarddescent</code> (API
<code>guard_descent</code>) to a value between 0.0 and 20.0 (default
5.0).</p>
<h4 id="upc-version-e">6.1.3.2 UPC Version E</h4>
<figure>
<img src="images/upce.svg" title="fig:" class="upcean"
alt="zint -b UPCE --compliantheight -d &quot;1123456&quot;" />
<figcaption
aria-hidden="true"><code>zint -b UPCE --compliantheight -d "1123456"</code></figcaption>
</figure>
<p>UPC-E is a zero-compressed version of UPC-A developed for smaller
packages. The code requires a 6-digit article number (digits 0-9). The
check digit is calculated by Zint. EAN-2 and EAN-5 add-on symbols can be
added using the + character as with UPC-A. In addition Zint also
supports Number System 1 encoding by entering a 7-digit article number
starting with the digit 1. For example:</p>
<div class="sourceCode" id="cb92"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb92-1"><a href="#cb92-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> UPCE <span class="at">-d</span> <span class="st">&quot;1123456&quot;</span></span></code></pre></div>
<p>or</p>
<div class="sourceCode" id="cb93"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb93-1"><a href="#cb93-1" aria-hidden="true" tabindex="-1"></a>my_symbol<span class="op">-&gt;</span>symbology <span class="op">=</span> BARCODE_UPCE<span class="op">;</span></span>
<span id="cb93-2"><a href="#cb93-2" aria-hidden="true" tabindex="-1"></a>error <span class="op">=</span> ZBarcode_Encode_and_Print<span class="op">(</span>my_symbol<span class="op">,</span> <span class="st">&quot;1123456&quot;</span><span class="op">,</span> <span class="dv">0</span><span class="op">,</span> <span class="dv">0</span><span class="op">);</span></span></code></pre></div>
<p>If your input data already includes the check digit symbology
<code>BARCODE_UPCE_CHK</code> (38) can be used which takes a 7 or
8-digit input and validates the check digit before encoding.</p>
<p>As with UPC-A, a quiet zone indicator can be added when there is an
add-on by setting <code>--guardwhitespace</code> (API
<code>output_options |= EANUPC_GUARD_WHITESPACE</code>):</p>
<div class="sourceCode" id="cb94"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb94-1"><a href="#cb94-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> UPCE <span class="at">-d</span> <span class="st">&quot;1123456+12&quot;</span> <span class="at">--guardwhitespace</span></span></code></pre></div>
<figure>
<img src="images/upce_2_gws.svg" title="fig:" class="upcean"
alt="zint -b UPCE --compliantheight -d &quot;1123456+12&quot; --guardwhitespace" />
<figcaption
aria-hidden="true"><code>zint -b UPCE --compliantheight -d "1123456+12" --guardwhitespace</code></figcaption>
</figure>
<p>You can adjust the gap between the main symbol and an add-on in
integral multiples of the X-dimension by setting <code>--addongap</code>
(API <code>option_2</code>) to a value between 7 (default) and 12. The
height in X-dimensions that the guard bars descend below the main bars
can be adjusted by setting <code>--guarddescent</code> (API
<code>guard_descent</code>) to a value between 0.0 and 20.0 (default
5.0).</p>
<h3 id="ean-european-article-number-iso-15420">6.1.4 EAN (European
Article Number) (ISO 15420)</h3>
<h4 id="ean-2-ean-5-ean-8-and-ean-13">6.1.4.1 EAN-2, EAN-5, EAN-8 and
EAN-13</h4>
<figure>
<img src="images/eanx13.svg" title="fig:" class="upcean"
alt="zint -b EANX --compliantheight -d &quot;4512345678906&quot;" />
<figcaption
aria-hidden="true"><code>zint -b EANX --compliantheight -d "4512345678906"</code></figcaption>
</figure>
<p>The EAN system is used in retail across Europe and includes standards
for EAN-2, EAN-5, EAN-8 and EAN-13 which encode 2, 5, 7 or 12-digit
numbers respectively. Zint will decide which symbology to use depending
on the length of the input data. In addition EAN-2 and EAN-5 add-on
symbols can be added to EAN-8 and EAN-13 symbols using the
<code>+</code> character as with UPC symbols. For example:</p>
<div class="sourceCode" id="cb95"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb95-1"><a href="#cb95-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> EANX <span class="at">-d</span> <span class="st">&quot;54321&quot;</span></span></code></pre></div>
<figure>
<img src="images/eanx5.svg" title="fig:" class="upcean"
alt="zint -b EANX --compliantheight -d &quot;54321&quot;" />
<figcaption
aria-hidden="true"><code>zint -b EANX --compliantheight -d "54321"</code></figcaption>
</figure>
<p>will encode a stand-alone EAN-5, whereas</p>
<div class="sourceCode" id="cb96"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb96-1"><a href="#cb96-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> EANX <span class="at">-d</span> <span class="st">&quot;7432365+54321&quot;</span></span></code></pre></div>
<p>will encode an EAN-8 symbol with an EAN-5 add-on. As before these
results can be achieved using the API:</p>
<div class="sourceCode" id="cb97"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb97-1"><a href="#cb97-1" aria-hidden="true" tabindex="-1"></a>my_symbol<span class="op">-&gt;</span>symbology <span class="op">=</span> BARCODE_EANX<span class="op">;</span></span>
<span id="cb97-2"><a href="#cb97-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb97-3"><a href="#cb97-3" aria-hidden="true" tabindex="-1"></a>error <span class="op">=</span> ZBarcode_Encode_and_Print<span class="op">(</span>my_symbol<span class="op">,</span> <span class="st">&quot;54321&quot;</span><span class="op">,</span> <span class="dv">0</span><span class="op">,</span> <span class="dv">0</span><span class="op">);</span></span>
<span id="cb97-4"><a href="#cb97-4" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb97-5"><a href="#cb97-5" aria-hidden="true" tabindex="-1"></a>error <span class="op">=</span> ZBarcode_Encode_and_Print<span class="op">(</span>my_symbol<span class="op">,</span> <span class="st">&quot;7432365+54321&quot;</span><span class="op">,</span> <span class="dv">0</span><span class="op">,</span> <span class="dv">0</span><span class="op">);</span></span></code></pre></div>
<figure>
<img src="images/eanx8_5.svg" title="fig:" class="upcean"
alt="zint -b EANX --compliantheight -d &quot;7432365+54321&quot;" />
<figcaption
aria-hidden="true"><code>zint -b EANX --compliantheight -d "7432365+54321"</code></figcaption>
</figure>
<p>All of the EAN symbols include check digits which are added by
Zint.</p>
<p>If you are encoding an EAN-8 or EAN-13 symbol and your data already
includes the check digit then you can use symbology
<code>BARCODE_EANX_CHK</code> (14) which takes an 8 or 13-digit input
and validates the check digit before encoding.</p>
<p>Options to add quiet zone indicators and to adjust the add-on gap and
the guard bar descent height are the same as for <a
href="#upc-version-e">6.1.3.2 UPC Version E</a>. For instance:</p>
<div class="sourceCode" id="cb98"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb98-1"><a href="#cb98-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> EANX_CHK <span class="at">-d</span> <span class="st">&quot;74323654&quot;</span> <span class="at">--guardwhitespace</span></span></code></pre></div>
<figure>
<img src="images/eanx8_gws.svg" title="fig:" class="upcean"
alt="zint -b EANX_CHK --compliantheight -d &quot;74323654&quot; –guardwhitespace" />
<figcaption
aria-hidden="true"><code>zint -b EANX_CHK --compliantheight -d "74323654"</code>
–guardwhitespace</figcaption>
</figure>
<h4 id="sbn-isbn-and-isbn-13">6.1.4.2 SBN, ISBN and ISBN-13</h4>
<figure>
<img src="images/isbnx.svg" title="fig:" class="upcean"
alt="zint -b ISBNX --compliantheight -d &quot;9789295055124&quot;" />
<figcaption
aria-hidden="true"><code>zint -b ISBNX --compliantheight -d "9789295055124"</code></figcaption>
</figure>
<p>EAN-13 symbols (also known as Bookland EAN-13) can also be produced
from 9-digit SBN, 10-digit ISBN or 13-digit ISBN-13 data. The relevant
check digit needs to be present in the input data and will be verified
before the symbol is generated.</p>
<p>As with EAN-13, a quiet zone indicator can be added using
<code>--guardwhitespace</code>:</p>
<figure>
<img src="images/isbnx_gws.svg" title="fig:" class="upcean"
alt="zint -b ISBNX --compliantheight -d &quot;9789295055124&quot; --guardwhitespace" />
<figcaption
aria-hidden="true"><code>zint -b ISBNX --compliantheight -d "9789295055124" --guardwhitespace</code></figcaption>
</figure>
<p>EAN-2 and EAN-5 add-on symbols can be added using the <code>+</code>
character, and there are options to adjust the add-on gap and the guard
bar descent height - see <a href="#upc-version-e">6.1.3.2 UPC Version
E</a>.</p>
<h3 id="plessey">6.1.5 Plessey</h3>
<h4 id="uk-plessey">6.1.5.1 UK Plessey</h4>
<figure>
<img src="images/plessey.svg" title="fig:" class="lin"
alt="zint -b PLESSEY -d &quot;C64&quot;" />
<figcaption
aria-hidden="true"><code>zint -b PLESSEY -d "C64"</code></figcaption>
</figure>
<p>Also known as Plessey Code, this symbology was developed by the
Plessey Company Ltd. in the UK. The symbol can encode data consisting of
digits (0-9) or letters A-F (i.e. hexadecimal digits) up to a maximum of
67 characters and includes two hidden CRC check digits, which may be
shown in the Human Readable Text by setting <code>--vers=1</code> (API
<code>option_2 |= 1</code>).</p>
<h4 id="msi-plessey">6.1.5.2 MSI Plessey</h4>
<figure>
<img src="images/msi_plessey.svg" title="fig:" class="lin"
alt="zint -b MSI_PLESSEY -d &quot;6502&quot; --vers=2" />
<figcaption
aria-hidden="true"><code>zint -b MSI_PLESSEY -d "6502" --vers=2</code></figcaption>
</figure>
<p>Based on Plessey and developed by MSI Data Corporation, MSI Plessey
can encode numeric (digits 0-9) input of up to 92 digits. It has a range
of check digit options that are selectable by setting
<code>--vers</code> (API <code>option_2</code>), shown in the table
below:</p>
<div id="tbl:msi_plessey_check_digits" class="tablenos">
<table id="tbl:msi_plessey_check_digits"
data-tag=": MSI Plessey Check Digit Options">
<caption><span>Table : MSI Plessey Check Digit Options</span>
</caption>
<thead>
<tr>
<th>Value</th>
<th style="text-align: left;">Check Digits</th>
</tr>
</thead>
<tbody>
<tr>
<td>0</td>
<td style="text-align: left;">None</td>
</tr>
<tr>
<td>1</td>
<td style="text-align: left;">Modulo-10 (Luhn)</td>
</tr>
<tr>
<td>2</td>
<td style="text-align: left;">Modulo-10 &amp; Modulo-10</td>
</tr>
<tr>
<td>3</td>
<td style="text-align: left;">Modulo-11 (IBM)</td>
</tr>
<tr>
<td>4</td>
<td style="text-align: left;">Modulo-11 (IBM) &amp; Modulo-10</td>
</tr>
<tr>
<td>5</td>
<td style="text-align: left;">Modulo-11 (NCR)</td>
</tr>
<tr>
<td>6</td>
<td style="text-align: left;">Modulo-11 (NCR) &amp; Modulo-10</td>
</tr>
</tbody>
</table>
</div>
<p>To not show the check digit or digits in the Human Readable Text, add
10 to the <code>--vers</code> value. For example <code>--vers=12</code>
(API <code>option_2 = 12</code>) will add two hidden modulo-10 check
digits.</p>
<h3 id="telepen">6.1.6 Telepen</h3>
<h4 id="telepen-alpha">6.1.6.1 Telepen Alpha</h4>
<figure>
<img src="images/telepen.svg" title="fig:" class="lin"
alt="zint -b TELEPEN --compliantheight -d &quot;Z80&quot;" />
<figcaption
aria-hidden="true"><code>zint -b TELEPEN --compliantheight -d "Z80"</code></figcaption>
</figure>
<p>Telepen Alpha was developed by SB Electronic Systems Limited and can
encode ASCII text input, up to a maximum of 69 characters. Telepen
includes a hidden modulo-127 check digit, added by Zint.</p>
<h4 id="telepen-numeric">6.1.6.2 Telepen Numeric</h4>
<figure>
<img src="images/telepen_num.svg" title="fig:" class="lin"
alt="zint -b TELEPEN_NUM --compliantheight -d &quot;466X33&quot;" />
<figcaption
aria-hidden="true"><code>zint -b TELEPEN_NUM --compliantheight -d "466X33"</code></figcaption>
</figure>
<p>Telepen Numeric allows compression of numeric data into a Telepen
symbol. Data can consist of pairs of numbers or pairs consisting of a
numerical digit followed an X character. For example: 466333 and 466X33
are valid codes whereas 46X333 is not (the digit pair <code>"X3"</code>
is not valid). Up to 136 digits can be encoded. Telepen Numeric includes
a hidden modulo-127 check digit which is added by Zint.</p>
<h3 id="code-39">6.1.7 Code 39</h3>
<h4 id="standard-code-39-iso-16388">6.1.7.1 Standard Code 39 (ISO
16388)</h4>
<figure>
<img src="images/code39.svg" title="fig:" class="lin"
alt="zint -b CODE39 --compliantheight -d &quot;1A&quot; --vers=1" />
<figcaption
aria-hidden="true"><code>zint -b CODE39 --compliantheight -d "1A" --vers=1</code></figcaption>
</figure>
<p>Standard Code 39 was developed in 1974 by Intermec. Input data can be
up to 86 characters in length and can include the characters 0-9, A-Z,
dash (<code>-</code>), full stop (<code>.</code>), space, asterisk
(<code>*</code>), dollar (<code>$</code>), slash (<code>/</code>), plus
(<code>+</code>) and percent (<code>%</code>). The standard does not
require a check digit but a modulo-43 check digit can be added if
desired by setting <code>--vers=1</code> (API
<code>option_2 = 1</code>). To add a check digit but not show it in the
Human Readable Text, set <code>--vers=2</code> (API
<code>option_2 = 2</code>).</p>
<h4 id="extended-code-39">6.1.7.2 Extended Code 39</h4>
<figure>
<img src="images/excode39.svg" title="fig:" class="lin"
alt="zint -b EXCODE39 --compliantheight -d &quot;123.45$@fd&quot;" />
<figcaption
aria-hidden="true"><code>zint -b EXCODE39 --compliantheight -d "123.45$@fd"</code></figcaption>
</figure>
<p>Also known as Code 39e and Code39+, this symbology expands on
Standard Code 39 to provide support for the full 7-bit ASCII character
set. The check digit options are the same as for <a
href="#standard-code-39-iso-16388">6.1.7.1 Standard Code 39 (ISO
16388)</a>.</p>
<h4 id="code-93">6.1.7.3 Code 93</h4>
<figure>
<img src="images/code93.svg" title="fig:" class="lin"
alt="zint -b CODE93 --compliantheight -d &quot;C93&quot;" />
<figcaption
aria-hidden="true"><code>zint -b CODE93 --compliantheight -d "C93"</code></figcaption>
</figure>
<p>A variation of Extended Code 39, Code 93 also supports full ASCII
text, accepting up to 123 characters. Two check characters are added by
Zint. By default these check characters are not shown in the Human
Readable Text, but may be shown by setting <code>--vers=1</code> (API
<code>option_2 = 1</code>).</p>
<h4 id="pzn-pharmazentralnummer">6.1.7.4 PZN (Pharmazentralnummer)</h4>
<figure>
<img src="images/pzn.svg" title="fig:" class="lin"
alt="zint -b PZN --compliantheight -d &quot;2758089&quot;" />
<figcaption
aria-hidden="true"><code>zint -b PZN --compliantheight -d "2758089"</code></figcaption>
</figure>
<p>PZN is a Code 39 based symbology used by the pharmaceutical industry
in Germany. PZN encodes a 7-digit number to which Zint will add a
modulo-11 check digit (PZN8). Input less than 7 digits will be
zero-filled. An 8-digit input can be supplied in which case Zint will
validate the check digit.</p>
<p>To encode a PZN7 (obsolete since 2013) instead set
<code>--vers=1</code> (API <code>option_2 = 1</code>) and supply up to 7
digits. As with PZN8, a modulo-11 check digit will be added or if 7
digits supplied the check digit validated.</p>
<h4 id="logmars">6.1.7.5 LOGMARS</h4>
<figure>
<img src="images/logmars.svg" title="fig:" class="lin"
alt="zint -b LOGMARS --compliantheight -d &quot;12345/ABCDE&quot; --vers=1" />
<figcaption
aria-hidden="true"><code>zint -b LOGMARS --compliantheight -d "12345/ABCDE" --vers=1</code></figcaption>
</figure>
<p>LOGMARS (Logistics Applications of Automated Marking and Reading
Symbols) is a variation of the Code 39 symbology used by the U.S.
Department of Defense. LOGMARS encodes the same character set as <a
href="#standard-code-39-iso-16388">6.1.7.1 Standard Code 39 (ISO
16388)</a>, and the check digit options are also the same. Input is
restricted to a maximum of 30 characters.</p>
<h4 id="code-32">6.1.7.6 Code 32</h4>
<figure>
<img src="images/code32.svg" title="fig:" class="lin"
alt="zint -b CODE32 --compliantheight -d &quot;14352312&quot;" />
<figcaption
aria-hidden="true"><code>zint -b CODE32 --compliantheight -d "14352312"</code></figcaption>
</figure>
<p>A variation of Code 39 used by the Italian Ministry of Health
(“Ministero della Sanità”) for encoding identifiers on pharmaceutical
products. This symbology requires a numeric input up to 8 digits in
length. A check digit is added by Zint.</p>
<h4 id="hibc-code-39">6.1.7.7 HIBC Code 39</h4>
<figure>
<img src="images/hibc_39.svg" title="fig:" class="lin"
alt="zint -b HIBC_39 --compliantheight -d &quot;14352312&quot;" />
<figcaption
aria-hidden="true"><code>zint -b HIBC_39 --compliantheight -d "14352312"</code></figcaption>
</figure>
<p>This variant adds a leading <code>'+'</code> character and a trailing
modulo-49 check digit to a standard Code 39 symbol as required by the
Health Industry Barcode standards.</p>
<h4 id="vehicle-identification-number-vin">6.1.7.8 Vehicle
Identification Number (VIN)</h4>
<figure>
<img src="images/vin.svg" title="fig:" class="lin"
alt="zint -b VIN -d &quot;2FTPX28L0XCA15511&quot; --vers=1" />
<figcaption
aria-hidden="true"><code>zint -b VIN -d "2FTPX28L0XCA15511" --vers=1</code></figcaption>
</figure>
<p>A variation of Code 39 that for vehicle identification numbers used
in North America (first character <code>'1'</code> to <code>'5'</code>)
has a check character verification stage. A 17 character input (0-9, and
A-Z excluding <code>'I'</code>, <code>'O'</code> and <code>'Q'</code>)
is required. An invisible Import character prefix <code>'I'</code> can
be added by setting <code>--vers=1</code> (API
<code>option_2 = 1</code>).</p>
<h3 id="codabar-en-798">6.1.8 Codabar (EN 798)</h3>
<figure>
<img src="images/codabar.svg" title="fig:" class="lin"
alt="zint -b CODABAR --compliantheight -d &quot;A37859B&quot;" />
<figcaption
aria-hidden="true"><code>zint -b CODABAR --compliantheight -d "A37859B"</code></figcaption>
</figure>
<p>Also known as NW-7, Monarch, ABC Codabar, USD-4, Ames Code and Code
27, this symbology was developed in 1972 by Monarch Marketing Systems
for retail purposes. The American Blood Commission adopted Codabar in
1977 as the standard symbology for blood identification. Codabar can
encode up to 103 characters starting and ending with the letters A-D and
containing between these letters the numbers 0-9, dash (<code>-</code>),
dollar (<code>$</code>), colon (<code>:</code>), slash (<code>/</code>),
full stop (<code>.</code>) or plus (<code>+</code>). No check character
is generated by default, but a modulo-16 one can be added by setting
<code>--vers=1</code> (API <code>option_2 = 1</code>). To have the check
character appear in the Human Readable Text, set <code>--vers=2</code>
(API <code>option_2 = 2</code>).</p>
<h3 id="pharmacode-one-track">6.1.9 Pharmacode One-Track</h3>
<figure>
<img src="images/pharma.svg" title="fig:" class="lin"
alt="zint -b PHARMA --compliantheight -d &quot;130170&quot;" />
<figcaption
aria-hidden="true"><code>zint -b PHARMA --compliantheight -d "130170"</code></figcaption>
</figure>
<p>Developed by Laetus, Pharmacode One-Track is used for the
identification of pharmaceuticals. The symbology is able to encode whole
numbers between 3 and 131070.</p>
<h3 id="code-128">6.1.10 Code 128</h3>
<h4 id="standard-code-128-iso-15417">6.1.10.1 Standard Code 128 (ISO
15417)</h4>
<figure>
<img src="images/code128.svg" title="fig:" class="lin"
alt="zint -b CODE128 --bind -d &quot;130170X178&quot;" />
<figcaption
aria-hidden="true"><code>zint -b CODE128 --bind -d "130170X178"</code></figcaption>
</figure>
<p>One of the most ubiquitous one-dimensional barcode symbologies, Code
128 was developed in 1981 by Computer Identics. This symbology supports
full ASCII text and uses a three-Code Set system to compress the data
into a smaller symbol. Zint automatically switches between Code Sets A,
B and C (but see below) and adds a hidden modulo-103 check digit.</p>
<p>Code 128 is the default barcode symbology used by Zint. In addition
Zint supports the encoding of ISO/IEC 8859-1 (non-English) characters in
Code 128 symbols. The ISO/IEC 8859-1 character set is shown in Annex <a
href="#a.2-latin-alphabet-no.-1-isoiec-8859-1">A.2 Latin Alphabet No. 1
(ISO/IEC 8859-1)</a>.</p>
<p>Manual switching of Code Sets is possible using the
<code>--extraesc</code> option (API
<code>input_mode |= EXTRA_ESCAPE_MODE</code>), which apart from
processing normal escape sequences also processes the Code 128-specific
escapes <code>\^A</code>, <code>\^B</code>, <code>\^C</code> and
<code>\^@</code> (the latter turns off manual Code Set selection). For
instance the following will force switching to Code Set B for the data
<code>"5678"</code> (normally Code Set C would be used throughout):</p>
<div class="sourceCode" id="cb99"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb99-1"><a href="#cb99-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> CODE128 <span class="at">-d</span> <span class="st">&quot;1234\^B5678&quot;</span> <span class="at">--extraesc</span></span></code></pre></div>
<p>The manually selected Code Set will apply until the next Code Set
escape sequence or until a <code>\^@</code>, with the exception that
data that cannot be represented in that Code Set will be switched as
appropriate. If the data contains an extra escape sequence, it can be
escaped by doubling the caret (<code>^</code>). For instance</p>
<div class="sourceCode" id="cb100"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb100-1"><a href="#cb100-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> CODE128 <span class="at">-d</span> <span class="st">&quot;\^AABC\^^BDEF&quot;</span> <span class="at">--extraesc</span></span></code></pre></div>
<p>will encode the data <code>"ABC\^BDEF"</code> in Code Set A.</p>
<p>There is also the extra escape <code>\^1</code>, which will encode a
special Function Code 1 character (<code>FNC1</code>) anywhere you chose
in the data, for instance</p>
<div class="sourceCode" id="cb101"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb101-1"><a href="#cb101-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> CODE128 <span class="at">-d</span> <span class="st">&quot;A\^1BC\^1DEF&quot;</span> <span class="at">--extraesc</span></span></code></pre></div>
<p>Zint can encode a maximum of 102 symbol characters, which allows for
e.g. 202 all-numeric or 101 all-uppercase characters. Sizes above 120
digits (60 alphanumerics) are not recommended.</p>
<h4 id="code-128-suppress-code-set-c-code-sets-a-and-b-only">6.1.10.2
Code 128 Suppress Code Set C (Code Sets A and B only)</h4>
<figure>
<img src="images/code128ab.svg" title="fig:" class="lin"
alt="zint -b CODE128AB -d &quot;130170X178&quot;" />
<figcaption
aria-hidden="true"><code>zint -b CODE128AB -d "130170X178"</code></figcaption>
</figure>
<p>It is sometimes advantageous to stop Code 128 from using Code Set C
which compresses numerical data. The <code>BARCODE_CODE128AB</code><a
href="#fn15" class="footnote-ref" id="fnref15"
role="doc-noteref"><sup>15</sup></a> variant (symbology 60) suppresses
Code Set C in favour of Code Sets A and B.</p>
<p>Note that the special extra escapes mentioned above are not available
for this variant (nor for any other).</p>
<h4 id="gs1-128">6.1.10.3 GS1-128</h4>
<figure>
<img src="images/gs1_128.svg" title="fig:" class="lin"
alt="zint -b GS1_128 --compliantheight -d &quot;[01]98898765432106[3202]012345[15]991231&quot;" />
<figcaption
aria-hidden="true"><code>zint -b GS1_128 --compliantheight -d "[01]98898765432106[3202]012345[15]991231"</code></figcaption>
</figure>
<p>A variation of Code 128 previously known as UCC/EAN-128, this
symbology is defined by the GS1 General Specifications. Application
Identifiers (AIs) should be entered using [square bracket] notation.
These will be converted to parentheses (round brackets) for the Human
Readable Text. This will allow round brackets to be used in the data
strings to be encoded.</p>
<p>For compatibility with data entry in other systems, if the data does
not include round brackets, the option <code>--gs1parens</code> (API
<code>input_mode |= GS1PARENS_MODE</code>) may be used to signal that
AIs are encased in round brackets instead of square ones.</p>
<p>Fixed length data should be entered at the appropriate length for
correct encoding. GS1-128 does not support extended ASCII (ISO/IEC
8859-1) characters. Check digits for GTIN data AI (01) are not generated
and need to be included in the input data. The following is an example
of a valid GS1-128 input:</p>
<div class="sourceCode" id="cb102"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb102-1"><a href="#cb102-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> 16 <span class="at">-d</span> <span class="st">&quot;[01]98898765432106[3202]012345[15]991231&quot;</span></span></code></pre></div>
<p>or using the <code>--gs1parens</code> option:</p>
<div class="sourceCode" id="cb103"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb103-1"><a href="#cb103-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> 16 <span class="at">--gs1parens</span> <span class="at">-d</span> <span class="st">&quot;(01)98898765432106(3202)012345(15)991231&quot;</span></span></code></pre></div>
<h4 id="ean-14">6.1.10.4 EAN-14</h4>
<figure>
<img src="images/ean14.svg" title="fig:" class="lin"
alt="zint -b EAN14 --compliantheight -d &quot;9889876543210&quot;" />
<figcaption
aria-hidden="true"><code>zint -b EAN14 --compliantheight -d "9889876543210"</code></figcaption>
</figure>
<p>A shorter version of GS1-128 which encodes GTIN data only. A 13-digit
number is required. The GTIN check digit and HRT-only AI
<code>"(01)"</code> are added by Zint.</p>
<h4 id="nve-18-sscc-18">6.1.10.5 NVE-18 (SSCC-18)</h4>
<figure>
<img src="images/nve18.svg" title="fig:" class="lin"
alt="zint -b NVE18 --compliantheight -d &quot;37612345000001003&quot;" />
<figcaption
aria-hidden="true"><code>zint -b NVE18 --compliantheight -d "37612345000001003"</code></figcaption>
</figure>
<p>A variation of Code 128 the ‘Nummer der Versandeinheit’ standard,
also known as SSCC-18 (Serial Shipping Container Code), includes both a
visible modulo-10 and a hidden modulo-103 check digit. NVE-18 requires a
17-digit numerical input. Check digits and HRT-only AI
<code>"(00)"</code> are added by Zint.</p>
<h4 id="hibc-code-128">6.1.10.6 HIBC Code 128</h4>
<figure>
<img src="images/hibc_128.svg" title="fig:" class="lin"
alt="zint -b HIBC_128 -d &quot;A123BJC5D6E71&quot;" />
<figcaption
aria-hidden="true"><code>zint -b HIBC_128 -d "A123BJC5D6E71"</code></figcaption>
</figure>
<p>This option adds a leading <code>'+'</code> character and a trailing
modulo-49 check digit to a standard Code 128 symbol as required by the
Health Industry Barcode standards.</p>
<h4 id="dpd-code">6.1.10.7 DPD Code</h4>
<figure>
<img src="images/dpd.svg" title="fig:" class="lin"
alt="zint -b DPD --compliantheight -d &quot;000393206219912345678101040&quot;" />
<figcaption
aria-hidden="true"><code>zint -b DPD --compliantheight -d "000393206219912345678101040"</code></figcaption>
</figure>
<p>Another variation of Code 128 as used by DPD (Deutscher Paketdienst).
Requires a 27 or 28 character input. For 28 character input, the first
character is an identification tag (Barcode ID), which should usually be
<code>"%"</code> (ASCII 37). If 27 characters are supplied,
<code>"%"</code> will be prefixed by Zint (except if marked as a
“relabel”, see below). The rest of the 27-character input must be
alphanumeric, and is of the form:</p>
<div id="tbl:dpd_input_fields" class="tablenos">
<table id="tbl:dpd_input_fields" data-tag=": DPD Input Fields">
<caption><span>Table : DPD Input Fields</span> </caption>
<colgroup>
<col style="width: 26%" />
<col style="width: 27%" />
<col style="width: 16%" />
<col style="width: 29%" />
</colgroup>
<thead>
<tr>
<th style="text-align: left;">Destination Post Code</th>
<th style="text-align: left;">Tracking Number</th>
<th style="text-align: left;">Service Code</th>
<th style="text-align: left;">Destination Country Code</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">PPPPPPP (7 alphanumerics)</td>
<td style="text-align: left;">TTTTTTTTTTTTTT (14 alphanumerics)</td>
<td style="text-align: left;">SSS (3 digits)</td>
<td style="text-align: left;">CCC (3-digit ISO 3166-1)</td>
</tr>
</tbody>
</table>
</div>
<p>A warning will be generated if the Service Code, the Destination
Country Code, or the last 10 characters of the Tracking Number are
non-numeric.</p>
<p>Zint formats the Human Readable Text as specified by DPD, leaving out
the identication tag, and adds a modulo-36 check character to the text
(not to the barcode itself), thus:</p>
<p><code>PPPP PPP TTTT TTTT TTTT TT SSS CCC D</code></p>
<p>By default a top boundary bar is added, with default width 3X. The
width can be overridden using <code>--border</code> (API
<code>border_width</code>). For a symbol with no top boundary bar,
explicitly set the border type to bindtop (or bind or box) and leave the
border width 0.</p>
<p>A DPD Code can be marked as a “relabel” by specifying
<code>--vers=1</code> (API <code>option_2 = 1</code>), which omits the
identification tag and prints the barcode at half height. In this case,
an input of 27 alphanumeric characters is required.</p>
<h4 id="upu-s10">6.1.10.8 UPU S10</h4>
<figure>
<img src="images/upu_s10.svg" title="fig:" class="lin"
alt="zint -b UPU_S10 --compliantheight -d &quot;EE876543216CA&quot;" />
<figcaption
aria-hidden="true"><code>zint -b UPU_S10 --compliantheight -d "EE876543216CA"</code></figcaption>
</figure>
<p>The Universal Postal Union S10 variant of Code 128 encodes 13
characters in the format <code>"SSNNNNNNNNXCC"</code>, where
<code>"SS"</code> is a two-character alphabetic service indicator,
<code>"NNNNNNNN"</code> is an 8-digit serial number, <code>"X"</code> is
a modulo-11 check digit, and <code>"CC"</code> is a two-character ISO
3166-1 country code.</p>
<p>The check digit may be omitted in which case Zint will add it.
Warnings will be generated if the service indicator is non-standard or
the country code is not ISO 3361-1.</p>
<h3 id="gs1-databar-iso-24724">6.1.11 GS1 DataBar (ISO 24724)</h3>
<p>Previously known as RSS (Reduced Spaced Symbology), these symbols are
due to replace GS1-128 symbols in accordance with the GS1 General
Specifications. If a GS1 DataBar symbol is to be printed with a 2D
component as specified in ISO/IEC 24723 set <code>--mode=2</code> (API
<code>option_1 = 2</code>). See <a
href="#gs1-composite-symbols-iso-24723">6.3 GS1 Composite Symbols (ISO
24723)</a> to find out how to generate DataBar symbols with 2D
components.</p>
<h4 id="gs1-databar-omnidirectional-and-gs1-databar-truncated">6.1.11.1
GS1 DataBar Omnidirectional and GS1 DataBar Truncated</h4>
<figure>
<img src="images/dbar_omn.svg" title="fig:" class="lin"
alt="zint -b DBAR_OMN --compliantheight -d &quot;0950110153001&quot;" />
<figcaption
aria-hidden="true"><code>zint -b DBAR_OMN --compliantheight -d "0950110153001"</code></figcaption>
</figure>
<p>Previously known as RSS-14 this standard encodes a 13-digit item
code. A check digit and HRT-only Application Identifier of
<code>"(01)"</code> are added by Zint. (A 14-digit code that appends the
check digit may be given, in which case the check digit will be
verified.)</p>
<p>GS1 DataBar Omnidirectional symbols should have a height of 33 or
greater. To produce a GS1 DataBar Truncated symbol set the symbol height
to a value between 13 and 32. Truncated symbols may not be scannable by
omnidirectional scanners.</p>
<figure>
<img src="images/dbar_truncated.svg" title="fig:" class="lin"
alt="zint -b DBAR_OMN -d &quot;0950110153001&quot; --height=13" />
<figcaption
aria-hidden="true"><code>zint -b DBAR_OMN -d "0950110153001" --height=13</code></figcaption>
</figure>
<h4 id="gs1-databar-limited">6.1.11.2 GS1 DataBar Limited</h4>
<figure>
<img src="images/dbar_ltd.svg" title="fig:" class="lin"
alt="zint -b DBAR_LTD --compliantheight -d &quot;0950110153001&quot;" />
<figcaption
aria-hidden="true"><code>zint -b DBAR_LTD --compliantheight -d "0950110153001"</code></figcaption>
</figure>
<p>Previously known as RSS Limited this standard encodes a 13-digit item
code and can be used in the same way as GS1 DataBar Omnidirectional
above. GS1 DataBar Limited, however, is limited to data starting with
digits 0 and 1 (i.e. numbers in the range 0 to 1999999999999). As with
GS1 DataBar Omnidirectional a check digit and HRT-only Application
Identifier of <code>"(01)"</code> are added by Zint, and a 14-digit code
may be given in which case the check digit will be verified.</p>
<h4 id="gs1-databar-expanded">6.1.11.3 GS1 DataBar Expanded</h4>
<figure>
<img src="images/dbar_exp.svg" title="fig:" class="lin"
alt="zint -b DBAR_EXP --compliantheight -d &quot;[01]98898765432106[3202]012345[15]991231&quot;" />
<figcaption
aria-hidden="true"><code>zint -b DBAR_EXP --compliantheight -d "[01]98898765432106[3202]012345[15]991231"</code></figcaption>
</figure>
<p>Previously known as RSS Expanded this is a variable length symbology
capable of encoding data from a number of AIs in a single symbol. AIs
should be encased in [square brackets] in the input data, which will be
converted to parentheses (round brackets) before being included in the
Human Readable Text attached to the symbol. This method allows the
inclusion of parentheses in the data to be encoded. If the data does not
include parentheses, the AIs may alternatively be encased in parentheses
using the <code>--gs1parens</code> switch. See <a
href="#gs1-128">6.1.10.3 GS1-128</a>.</p>
<p>GTIN data AI (01) should also include the check digit data as this is
not calculated by Zint when this symbology is encoded. Fixed length data
should be entered at the appropriate length for correct encoding. The
following is an example of a valid GS1 DataBar Expanded input:</p>
<div class="sourceCode" id="cb104"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb104-1"><a href="#cb104-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> 31 <span class="at">-d</span> <span class="st">&quot;[01]98898765432106[3202]012345[15]991231&quot;</span></span></code></pre></div>
<h3 id="korea-post-barcode">6.1.12 Korea Post Barcode</h3>
<figure>
<img src="images/koreapost.svg" title="fig:" class="lin"
alt="zint -b KOREAPOST -d &quot;923457&quot;" />
<figcaption
aria-hidden="true"><code>zint -b KOREAPOST -d "923457"</code></figcaption>
</figure>
<p>The Korean Postal Barcode is used to encode a 6-digit number and
includes one check digit.</p>
<h3 id="channel-code">6.1.13 Channel Code</h3>
<figure>
<img src="images/channel.svg" title="fig:" class="lin"
alt="zint -b CHANNEL -d &quot;453678&quot; --compliantheight" />
<figcaption
aria-hidden="true"><code>zint -b CHANNEL -d "453678" --compliantheight</code></figcaption>
</figure>
<p>A highly compressed symbol for numeric data. The number of channels
in the symbol can be between 3 and 8 and this can be specified by
setting the value of the <code>--vers</code> option (API
<code>option_2</code>). It can also be determined by the length of the
input data: e.g. a three character input string generates a 4 channel
code by default.</p>
<p>The maximum values permitted depend on the number of channels used as
shown in the table below:</p>
<div id="tbl:channel_maxima" class="tablenos">
<table id="tbl:channel_maxima" data-tag=": Channel Value Ranges">
<caption><span>Table : Channel Value Ranges</span> </caption>
<thead>
<tr>
<th style="text-align: left;">Channels</th>
<th style="text-align: left;">Minimum Value</th>
<th style="text-align: left;">Maximum Value</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">3</td>
<td style="text-align: left;">00</td>
<td style="text-align: left;">26</td>
</tr>
<tr>
<td style="text-align: left;">4</td>
<td style="text-align: left;">000</td>
<td style="text-align: left;">292</td>
</tr>
<tr>
<td style="text-align: left;">5</td>
<td style="text-align: left;">0000</td>
<td style="text-align: left;">3493</td>
</tr>
<tr>
<td style="text-align: left;">6</td>
<td style="text-align: left;">00000</td>
<td style="text-align: left;">44072</td>
</tr>
<tr>
<td style="text-align: left;">7</td>
<td style="text-align: left;">000000</td>
<td style="text-align: left;">576688</td>
</tr>
<tr>
<td style="text-align: left;">8</td>
<td style="text-align: left;">0000000</td>
<td style="text-align: left;">7742862</td>
</tr>
</tbody>
</table>
</div>
<h3 id="bc412-semi-t1-95">6.1.14 BC412 (SEMI T1-95)</h3>
<figure>
<img src="images/bc412.svg" title="fig:" class="lin"
alt="zint -b BC412 -d &quot;AQ45670&quot; --compliantheight" />
<figcaption
aria-hidden="true"><code>zint -b BC412 -d "AQ45670" --compliantheight</code></figcaption>
</figure>
<p>Designed by IBM for marking silicon wafers, each BC412 character is
represented by 4 bars of a single size, interleaved with 4 spaces of
varying sizes that total 8 (hence 4 bars in 12). Zint implements the
SEMI T1-95 standard, where input must be alphanumeric, excluding the
letter <code>O</code>, and must be from 7 to 18 characters in length. A
single check character is added by Zint, appearing in the 2nd character
position. Lowercase input is automatically made uppercase.</p>
<h2 id="stacked-symbologies">6.2 Stacked Symbologies</h2>
<h3 id="basic-symbol-stacking">6.2.1 Basic Symbol Stacking</h3>
<p>An early innovation to get more information into a symbol, used
primarily in the vehicle industry, is to simply stack one-dimensional
codes on top of each other. This can be achieved at the command prompt
by giving more than one set of input data. For example</p>
<div class="sourceCode" id="cb105"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb105-1"><a href="#cb105-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-d</span> <span class="st">&quot;This&quot;</span> <span class="at">-d</span> <span class="st">&quot;That&quot;</span></span></code></pre></div>
<p>will draw two Code 128 symbols, one on top of the other. The same
result can be achieved using the API by executing the
<code>ZBarcode_Encode()</code> function more than once on a symbol. For
example:</p>
<div class="sourceCode" id="cb106"><pre
class="sourceCode c"><code class="sourceCode c"><span id="cb106-1"><a href="#cb106-1" aria-hidden="true" tabindex="-1"></a>my_symbol<span class="op">-&gt;</span>symbology <span class="op">=</span> BARCODE_CODE128<span class="op">;</span></span>
<span id="cb106-2"><a href="#cb106-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb106-3"><a href="#cb106-3" aria-hidden="true" tabindex="-1"></a>error <span class="op">=</span> ZBarcode_Encode<span class="op">(</span>my_symbol<span class="op">,</span> <span class="st">&quot;This&quot;</span><span class="op">,</span> <span class="dv">0</span><span class="op">);</span></span>
<span id="cb106-4"><a href="#cb106-4" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb106-5"><a href="#cb106-5" aria-hidden="true" tabindex="-1"></a>error <span class="op">=</span> ZBarcode_Encode<span class="op">(</span>my_symbol<span class="op">,</span> <span class="st">&quot;That&quot;</span><span class="op">,</span> <span class="dv">0</span><span class="op">);</span></span>
<span id="cb106-6"><a href="#cb106-6" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb106-7"><a href="#cb106-7" aria-hidden="true" tabindex="-1"></a>error <span class="op">=</span> ZBarcode_Print<span class="op">(</span>my_symbol<span class="op">);</span></span></code></pre></div>
<figure>
<img src="images/code128_stacked.svg" title="fig:" class="lin"
alt="zint -d &quot;This&quot; -d &quot;That&quot;" />
<figcaption
aria-hidden="true"><code>zint -d "This" -d "That"</code></figcaption>
</figure>
<p>Note that the Human Readable Text will be that of the last data, so
it’s best to use the option <code>--notext</code> (API
<code>show_hrt = 0</code>).</p>
<p>The stacked barcode rows can be separated by row separator bars by
specifying <code>--bind</code> (API
<code>output_options |= BARCODE_BIND</code>). The height of the row
separator bars in integral multiples of the X-dimension (minimum and
default 1, maximum 4) can be set by <code>--separator</code> (API
<code>option_3</code>):</p>
<div class="sourceCode" id="cb107"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb107-1"><a href="#cb107-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">--bind</span> <span class="at">--notext</span> <span class="at">--separator</span><span class="op">=</span>2 <span class="at">-d</span> <span class="st">&quot;This&quot;</span> <span class="at">-d</span> <span class="st">&quot;That&quot;</span></span></code></pre></div>
<figure>
<img src="images/code128_stacked_sep2.svg" title="fig:" class="lin"
alt="zint --notext --bind --separator=2 -d &quot;This&quot; -d &quot;That&quot;" />
<figcaption
aria-hidden="true"><code>zint --notext --bind --separator=2 -d "This" -d "That"</code></figcaption>
</figure>
<p>A more sophisticated method is to use some type of line indexing
which indicates to the barcode reader which order the stacked symbols
should be read in. This is demonstrated by the symbologies below.</p>
<h3 id="codablock-f">6.2.2 Codablock-F</h3>
<figure>
<img src="images/codablockf.svg" title="fig:" class="lin"
alt="zint -b CODABLOCKF -d &quot;CODABLOCK F Symbology&quot; --rows=3" />
<figcaption
aria-hidden="true"><code>zint -b CODABLOCKF -d "CODABLOCK F Symbology" --rows=3</code></figcaption>
</figure>
<p>This is a stacked symbology based on Code 128 which can encode
Latin-1 data up to a maximum length of 2726 symbol characters, meaning
for instance up to 2726 all ASCII characters, or 5452 all numeric, or up
to 1363 all extended ASCII (ISO/IEC 8859-1).</p>
<p>The width of the Codablock-F symbol can be set using the
<code>--cols</code> option (API <code>option_2</code>), to a value
between 9 and 67. The height (number of rows) can be set using the
<code>--rows</code> option (API <code>option_1</code>), with a maximum
of 44. Zint does not currently support encoding of GS1 data in
Codablock-F symbols.</p>
<p>A separate symbology ID (<code>BARCODE_HIBC_BLOCKF</code>) can be
used to encode Health Industry Barcode (HIBC) data which adds a leading
<code>'+'</code> character and a modulo-49 check digit to the encoded
data.</p>
<h3 id="code-16k-en-12323">6.2.3 Code 16K (EN 12323)</h3>
<figure>
<img src="images/code16k.svg" title="fig:" class="lin"
alt="zint -b CODE16K --compliantheight -d &quot;ab0123456789&quot;" />
<figcaption
aria-hidden="true"><code>zint -b CODE16K --compliantheight -d "ab0123456789"</code></figcaption>
</figure>
<p>Code 16K uses a Code 128 based system which can stack up to 16 rows
in a block. This gives a maximum data capacity of 77 characters or 154
numerical digits and includes two modulo-107 check digits. Code 16K also
supports ISO/IEC 8859-1 character encoding in the same manner as Code
128. GS1 data encoding is also supported. The minimum number of rows to
use can be set using the <code>--rows</code> option (API
<code>option_1</code>), with values from 2 to 16.</p>
<h3 id="pdf417-iso-15438">6.2.4 PDF417 (ISO 15438)</h3>
<figure>
<img src="images/pdf417.svg" title="fig:" class="lin"
alt="zint -b PDF417 -d &quot;PDF417&quot;" />
<figcaption
aria-hidden="true"><code>zint -b PDF417 -d "PDF417"</code></figcaption>
</figure>
<p>Heavily used in the parcel industry, the PDF417 symbology can encode
a vast amount of data into a small space. Zint supports encoding up to
the ISO standard maximum symbol size of 925 codewords which (at error
correction level 0) allows a maximum data size of 1850 text characters,
or 2710 digits.</p>
<p>The width of the generated PDF417 symbol can be specified at the
command line using the <code>--cols</code> switch (API
<code>option_2</code>) followed by a number between 1 and 30, the number
of rows using the <code>--rows</code> switch (API <code>option_3</code>)
followed by a number between 3 and 90, and the amount of error
correction information can be specified by using the
<code>--secure</code> switch (API <code>option_1</code>) followed by a
number between 0 and 8 where the number of codewords used for error
correction is determined by <code>2^(value + 1)</code>. The default
level of error correction is determined by the amount of data being
encoded.</p>
<p>This symbology uses Latin-1 character encoding by default but also
supports the ECI encoding mechanism. A separate symbology ID
(<code>BARCODE_HIBC_PDF</code>) can be used to encode Health Industry
Barcode (HIBC) data.</p>
<p>For a faster but less optimal encodation, the <code>--fast</code>
option (API <code>input_mode |= FAST_MODE</code>) may be used.</p>
<p>PDF417 supports Structured Append of up to 99,999 symbols and an
optional numeric ID of up to 30 digits, which can be set by using the
<code>--structapp</code> option (see <a href="#structured-append">4.17
Structured Append</a>) (API <code>structapp</code>). The ID consists of
up to 10 triplets, each ranging from <code>"000"</code> to
<code>"899"</code>. For instance <code>"123456789"</code> would be a
valid ID of 3 triplets. However <code>"123456900"</code> would not, as
the last triplet <code>"900"</code> exceeds <code>"899"</code>. The
triplets are 0-filled, for instance <code>"1234"</code> becomes
<code>"123004"</code>. If an ID is not given, no ID is encoded.</p>
<h3 id="compact-pdf417-iso-15438">6.2.5 Compact PDF417 (ISO 15438)</h3>
<figure>
<img src="images/pdf417comp.svg" title="fig:" class="lin"
alt="zint -b PDF417COMP -d &quot;PDF417&quot;" />
<figcaption
aria-hidden="true"><code>zint -b PDF417COMP -d "PDF417"</code></figcaption>
</figure>
<p>Previously known as Truncated PDF417, Compact PDF417 omits some
per-row overhead to produce a narrower but less robust symbol. Options
are the same as for PDF417 above.</p>
<h3 id="micropdf417-iso-24728">6.2.6 MicroPDF417 (ISO 24728)</h3>
<figure>
<img src="images/micropdf417.svg" title="fig:" class="lin"
alt="zint -b MICROPDF417 -d &quot;12345678&quot;" />
<figcaption
aria-hidden="true"><code>zint -b MICROPDF417 -d "12345678"</code></figcaption>
</figure>
<p>A variation of the PDF417 standard, MicroPDF417 is intended for
applications where symbol size needs to be kept to a minimum. 34
predefined symbol sizes are available with 1 - 4 columns and 4 - 44
rows. The maximum amount a MicroPDF417 symbol can hold is 250
alphanumeric characters or 366 digits. The amount of error correction
used is dependent on symbol size. The number of columns used can be
determined using the <code>--cols</code> switch (API
<code>option_2</code>) as with PDF417.</p>
<p>This symbology uses Latin-1 character encoding by default but also
supports the ECI encoding mechanism. A separate symbology ID
(<code>BARCODE_HIBC_MICPDF</code>) can be used to encode Health Industry
Barcode (HIBC) data. MicroPDF417 supports <code>FAST_MODE</code> and
Structured Append the same as PDF417, for which see details.</p>
<h3 id="gs1-databar-stacked-iso-24724">6.2.7 GS1 DataBar Stacked (ISO
24724)</h3>
<h4 id="gs1-databar-stacked">6.2.7.1 GS1 DataBar Stacked</h4>
<figure>
<img src="images/dbar_stk.svg" title="fig:" class="lin"
alt="zint -b DBAR_STK --compliantheight -d &quot;9889876543210&quot;" />
<figcaption
aria-hidden="true"><code>zint -b DBAR_STK --compliantheight -d "9889876543210"</code></figcaption>
</figure>
<p>A stacked variation of the GS1 DataBar Truncated symbol requiring the
same input (see <a
href="#gs1-databar-omnidirectional-and-gs1-databar-truncated">6.1.11.1
GS1 DataBar Omnidirectional and GS1 DataBar Truncated</a>), this symbol
is the same as the following GS1 DataBar Stacked Omnidirectional symbol
except that its height is reduced and its central separator is a single
row, making it suitable for small items when omnidirectional scanning is
not required. It can be generated with a two-dimensional component to
make a composite symbol.</p>
<h4 id="gs1-databar-stacked-omnidirectional">6.2.7.2 GS1 DataBar Stacked
Omnidirectional</h4>
<figure>
<img src="images/dbar_omnstk.svg" title="fig:" class="lin"
alt="zint -b DBAR_OMNSTK --compliantheight -d &quot;9889876543210&quot;" />
<figcaption
aria-hidden="true"><code>zint -b DBAR_OMNSTK --compliantheight -d "9889876543210"</code></figcaption>
</figure>
<p>A stacked variation of the GS1 DataBar Omnidirectional symbol
requiring the same input (see <a
href="#gs1-databar-omnidirectional-and-gs1-databar-truncated">6.1.11.1
GS1 DataBar Omnidirectional and GS1 DataBar Truncated</a>). The data is
encoded in two rows of bars with a central 3-row separator. This symbol
can be generated with a two-dimensional component to make a composite
symbol.</p>
<h4 id="gs1-databar-expanded-stacked">6.2.7.3 GS1 DataBar Expanded
Stacked</h4>
<figure>
<img src="images/dbar_expstk.svg" title="fig:" class="lin"
alt="zint -b DBAR_EXPSTK --compliantheight -d &quot;[01]98898765432106[3202]012345[15]991231&quot;" />
<figcaption
aria-hidden="true"><code>zint -b DBAR_EXPSTK --compliantheight -d "[01]98898765432106[3202]012345[15]991231"</code></figcaption>
</figure>
<p>A stacked variation of the GS1 DataBar Expanded symbol for smaller
packages. Input is the same as for GS1 DataBar Expanded (see <a
href="#gs1-databar-expanded">6.1.11.3 GS1 DataBar Expanded</a>). In
addition the width of the symbol can be altered using the
<code>--cols</code> switch (API <code>option_2</code>). In this case the
number of columns (values 1 to 11) relates to the number of character
pairs on each row of the symbol. Alternatively the <code>--rows</code>
switch (API <code>option_3</code>) can be used to specify the maximum
number of rows (values 2 to 11), and the number of columns will be
adjusted accordingly. This symbol can be generated with a
two-dimensional component to make a composite symbol. For symbols with a
2D component the number of columns must be at least 2.</p>
<h3 id="code-49">6.2.8 Code 49</h3>
<figure>
<img src="images/code49.svg" title="fig:" class="lin"
alt="zint -b CODE49 --compliantheight -d &quot;MULTIPLE ROWS IN CODE 49&quot;" />
<figcaption
aria-hidden="true"><code>zint -b CODE49 --compliantheight -d "MULTIPLE ROWS IN CODE 49"</code></figcaption>
</figure>
<p>Developed in 1987 at Intermec, Code 49 is a cross between UPC and
Code 39. It is one of the earliest stacked symbologies and influenced
the design of Code 16K a few years later. It supports full 7-bit ASCII
input up to a maximum of 49 characters or 81 numeric digits. GS1 data
encoding is also supported. The minimum number of rows to use can be set
using the <code>--rows</code> option (API <code>option_1</code>), with
values from 2 to 8.</p>
<h2 id="gs1-composite-symbols-iso-24723">6.3 GS1 Composite Symbols (ISO
24723)</h2>
<p>GS1 Composite symbols employ a mixture of components to give more
comprehensive information about a product. The permissible contents of a
composite symbol is determined by the terms of the GS1 General
Specifications. Composite symbols consist of a linear component which
can be an EAN, UPC, GS1-128 or GS1 DataBar symbol, a two-dimensional
(2D) component which is based on PDF417 or MicroPDF417, and a separator
pattern. The type of linear component to be used is determined using the
<code>-b</code> or <code>--barcode</code> switch (API
<code>symbology</code>) as with other encoding methods. Valid values are
shown below.</p>
<div id="tbl:composite_symbologies" class="tablenos">
<table id="tbl:composite_symbologies"
data-tag=": GS1 Composite Symbology Values">
<caption><span>Table : GS1 Composite Symbology Values</span> </caption>
<colgroup>
<col style="width: 11%" />
<col style="width: 34%" />
<col style="width: 53%" />
</colgroup>
<thead>
<tr>
<th style="text-align: left;">Numeric Value</th>
<th style="text-align: left;">Name</th>
<th style="text-align: left;">Barcode Name</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">130</td>
<td style="text-align: left;"><code>BARCODE_EANX_CC</code></td>
<td style="text-align: left;">GS1 Composite Symbol with EAN linear
component</td>
</tr>
<tr>
<td style="text-align: left;">131</td>
<td style="text-align: left;"><code>BARCODE_GS1_128_CC</code></td>
<td style="text-align: left;">GS1 Composite Symbol with GS1-128 linear
component</td>
</tr>
<tr>
<td style="text-align: left;">132</td>
<td style="text-align: left;"><code>BARCODE_DBAR_OMN_CC</code></td>
<td style="text-align: left;">GS1 Composite Symbol with GS1 DataBar
Omnidirectional linear component</td>
</tr>
<tr>
<td style="text-align: left;">133</td>
<td style="text-align: left;"><code>BARCODE_DBAR_LTD_CC</code></td>
<td style="text-align: left;">GS1 Composite Symbol with GS1 DataBar
Limited linear component</td>
</tr>
<tr>
<td style="text-align: left;">134</td>
<td style="text-align: left;"><code>BARCODE_DBAR_EXP_CC</code></td>
<td style="text-align: left;">GS1 Composite Symbol with GS1 DataBar
Expanded linear component</td>
</tr>
<tr>
<td style="text-align: left;">135</td>
<td style="text-align: left;"><code>BARCODE_UPCA_CC</code></td>
<td style="text-align: left;">GS1 Composite Symbol with UPC-A linear
component</td>
</tr>
<tr>
<td style="text-align: left;">136</td>
<td style="text-align: left;"><code>BARCODE_UPCE_CC</code></td>
<td style="text-align: left;">GS1 Composite Symbol with UPC-E linear
component</td>
</tr>
<tr>
<td style="text-align: left;">137</td>
<td style="text-align: left;"><code>BARCODE_DBAR_STK_CC</code></td>
<td style="text-align: left;">GS1 Composite Symbol with GS1 DataBar
Stacked component</td>
</tr>
<tr>
<td style="text-align: left;">138</td>
<td style="text-align: left;"><code>BARCODE_DBAR_OMNSTK_CC</code></td>
<td style="text-align: left;">GS1 Composite Symbol with GS1 DataBar
Stacked Omnidirectional component</td>
</tr>
<tr>
<td style="text-align: left;">139</td>
<td style="text-align: left;"><code>BARCODE_DBAR_EXPSTK_CC</code></td>
<td style="text-align: left;">GS1 Composite Symbol with GS1 DataBar
Expanded Stacked component</td>
</tr>
</tbody>
</table>
</div>
<p>The data to be encoded in the linear component of a composite symbol
should be entered into a primary string with the data for the 2D
component being entered in the normal way. To do this at the command
prompt use the <code>--primary</code> switch (API <code>primary</code>).
For example:</p>
<div class="sourceCode" id="cb108"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb108-1"><a href="#cb108-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> EANX_CC <span class="at">--mode</span><span class="op">=</span>1 <span class="at">--primary</span><span class="op">=</span>331234567890 <span class="at">-d</span> <span class="st">&quot;[99]1234-abcd&quot;</span></span></code></pre></div>
<p>This creates an EAN-13 linear component with the data
<code>"331234567890"</code> and a 2D CC-A (see <a
href="#cc-a">below</a>) component with the data
<code>"(99)1234-abcd"</code>. The same results can be achieved using the
API as shown below:</p>
<div class="sourceCode" id="cb109"><pre
class="sourceCode c"><code class="sourceCode c"><span id="cb109-1"><a href="#cb109-1" aria-hidden="true" tabindex="-1"></a>my_symbol<span class="op">-&gt;</span>symbology <span class="op">=</span> BARCODE_EANX_CC<span class="op">;</span></span>
<span id="cb109-2"><a href="#cb109-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb109-3"><a href="#cb109-3" aria-hidden="true" tabindex="-1"></a>my_symbol<span class="op">-&gt;</span>option_1 <span class="op">=</span> <span class="dv">1</span><span class="op">;</span></span>
<span id="cb109-4"><a href="#cb109-4" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb109-5"><a href="#cb109-5" aria-hidden="true" tabindex="-1"></a>strcpy<span class="op">(</span>my_symbol<span class="op">-&gt;</span>primary<span class="op">,</span> <span class="st">&quot;331234567890&quot;</span><span class="op">);</span></span>
<span id="cb109-6"><a href="#cb109-6" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb109-7"><a href="#cb109-7" aria-hidden="true" tabindex="-1"></a>ZBarcode_Encode_and_Print<span class="op">(</span>my_symbol<span class="op">,</span> <span class="st">&quot;[99]1234-abcd&quot;</span><span class="op">,</span> <span class="dv">0</span><span class="op">,</span> <span class="dv">0</span><span class="op">);</span></span></code></pre></div>
<p>EAN-2 and EAN-5 add-on data can be used with EAN and UPC symbols
using the + symbol as described in sections <a
href="#upc-universal-product-code-iso-15420">6.1.3 UPC (Universal
Product Code) (ISO 15420)</a> and <a
href="#ean-european-article-number-iso-15420">6.1.4 EAN (European
Article Number) (ISO 15420)</a>.</p>
<p>The 2D component of a composite symbol can use one of three systems:
CC-A, CC-B and CC-C, as described below. The 2D component type can be
selected automatically by Zint dependent on the length of the input
string. Alternatively the three methods can be accessed using the
<code>--mode</code> prompt (API <code>option_1</code>) followed by 1, 2
or 3 for CC-A, CC-B or CC-C respectively.</p>
<h3 id="cc-a">6.3.1 CC-A</h3>
<figure>
<img src="images/eanx_cc_a.svg" title="fig:" class="upcean"
alt="zint -b EANX_CC --compliantheight -d &quot;[99]1234-abcd&quot; --mode=1 --primary=331234567890" />
<figcaption
aria-hidden="true"><code>zint -b EANX_CC --compliantheight -d "[99]1234-abcd" --mode=1 --primary=331234567890</code></figcaption>
</figure>
<p>This system uses a variation of MicroPDF417 which is optimised to fit
into a small space. The size of the 2D component and the amount of error
correction is determined by the amount of data to be encoded and the
type of linear component which is being used. CC-A can encode up to 56
numeric digits or an alphanumeric string of shorter length. To select
CC-A use <code>--mode=1</code> (API <code>option_1 = 1</code>).</p>
<h3 id="cc-b">6.3.2 CC-B</h3>
<figure>
<img src="images/eanx_cc_b.svg" title="fig:" class="upcean"
alt="zint -b EANX_CC --compliantheight -d &quot;[99]1234-abcd&quot; --mode=2 --primary=331234567890" />
<figcaption
aria-hidden="true"><code>zint -b EANX_CC --compliantheight -d "[99]1234-abcd" --mode=2 --primary=331234567890</code></figcaption>
</figure>
<p>This system uses MicroPDF417 to encode the 2D component. The size of
the 2D component and the amount of error correction is determined by the
amount of data to be encoded and the type of linear component which is
being used. CC-B can encode up to 338 numeric digits or an alphanumeric
string of shorter length. To select CC-B use <code>--mode=2</code> (API
<code>option_1 = 2</code>).</p>
<h3 id="cc-c">6.3.3 CC-C</h3>
<figure>
<img src="images/gs1_128_cc_c.svg" title="fig:" class="upcean"
alt="zint -b GS1_128_CC --compliantheight -d &quot;[99]1234-abcd&quot; --mode=3 --primary=&quot;[01]03312345678903&quot;" />
<figcaption
aria-hidden="true"><code>zint -b GS1_128_CC --compliantheight -d "[99]1234-abcd" --mode=3 --primary="[01]03312345678903"</code></figcaption>
</figure>
<p>This system uses PDF417 and can only be used in conjunction with a
GS1-128 linear component. CC-C can encode up to 2361 numeric digits or
an alphanumeric string of shorter length. To select CC-C use
<code>--mode=3</code> (API <code>option_1 = 3</code>).</p>
<h2 id="two-track-symbols">6.4 Two-Track Symbols</h2>
<h3 id="pharmacode-two-track">6.4.1 Pharmacode Two-Track</h3>
<figure>
<img src="images/pharma_two.svg" title="fig:" class="trk"
alt="zint -b PHARMA_TWO --compliantheight -d &quot;29876543&quot;" />
<figcaption
aria-hidden="true"><code>zint -b PHARMA_TWO --compliantheight -d "29876543"</code></figcaption>
</figure>
<p>Developed by Laetus, Pharmacode Two-Track is an alternative system to
Pharmacode One-Track (see <a href="#pharmacode-one-track">6.1.9
Pharmacode One-Track</a>) used for the identification of
pharmaceuticals. The symbology is able to encode whole numbers between 4
and 64570080.</p>
<h3 id="postnet">6.4.2 POSTNET</h3>
<figure>
<img src="images/postnet.svg" title="fig:" class="trk"
alt="zint -b POSTNET --compliantheight -d &quot;12345678901&quot;" />
<figcaption
aria-hidden="true"><code>zint -b POSTNET --compliantheight -d "12345678901"</code></figcaption>
</figure>
<p>Used by the United States Postal Service until 2009, the POSTNET
barcode was used for encoding zip-codes on mail items. POSTNET uses
numerical input data and includes a modulo-10 check digit. While Zint
will encode POSTNET symbols of up to 38 digits in length, standard
lengths as used by USPS were <code>PostNet6</code> (5-digit ZIP input),
<code>PostNet10</code> (5-digit ZIP + 4-digit user data) and
<code>PostNet12</code> (5-digit ZIP + 6-digit user data), and a warning
will be issued if the input length is not one of these.</p>
<h3 id="planet">6.4.3 PLANET</h3>
<figure>
<img src="images/planet.svg" title="fig:" class="trk"
alt="zint -b PLANET --compliantheight -d &quot;4012345235636&quot;" />
<figcaption
aria-hidden="true"><code>zint -b PLANET --compliantheight -d "4012345235636"</code></figcaption>
</figure>
<p>Used by the United States Postal Service until 2009, the PLANET
(Postal Alpha Numeric Encoding Technique) barcode was used for encoding
routing data on mail items. PLANET uses numerical input data and
includes a modulo-10 check digit. While Zint will encode PLANET symbols
of up to 38 digits in length, standard lengths used by USPS were
<code>Planet12</code> (11-digit input) and <code>Planet14</code>
(13-digit input), and as with POSTNET a warning will be issued if the
length is not one of these.</p>
<h3 id="brazilian-cepnet">6.4.4 Brazilian CEPNet</h3>
<figure>
<img src="images/cepnet.svg" title="fig:" class="trk"
alt="zint -b CEPNET --compliantheight -d &quot;12345678&quot;" />
<figcaption
aria-hidden="true"><code>zint -b CEPNET --compliantheight -d "12345678"</code></figcaption>
</figure>
<p>Based on POSTNET, the CEPNet symbol is used by Correios, the
Brazilian postal service, to encode CEP (Código de Endereçamento Postal)
numbers on mail items. Input should consist of eight digits with the
check digit being automatically added by Zint.</p>
<h3 id="dx-film-edge-barcode">6.4.5 DX Film Edge Barcode</h3>
<figure>
<img src="images/dxfilmedge.svg" title="fig:" class="trk"
alt="zint -b DXFILMEDGE --compliantheight -d &quot;112-1/10A&quot;" />
<figcaption
aria-hidden="true"><code>zint -b DXFILMEDGE --compliantheight -d "112-1/10A"</code></figcaption>
</figure>
<p>Introduced by Kodak in the 1980s, the DX (Digital Index) barcode is
printed on the bottom edge of 35mm film to aid in the reordering and
post-processing of prints.</p>
<p>The data can be in two parts. The first part (required) is the “DX
number”, identifying the manufacturer and film type - the National
Association of Photographic Manufacturers (NAPM) number. The second
part, which is optional and if present is separated from the first by a
slash (<code>/</code>), gives the frame number.</p>
<p>The DX number is in either of two formats. The first format is a
number of 1 to 4 digits (“DX Extract”) or 6 digits (“DX Full”), but for
the 6-digit version the first and last digit are ignored, leaving a
4-digit DX Extract number in any case, which must be in the range 16 to
2047. The second format <code>"NNN-NN"</code> represents the DX Extract
as two numbers separated by a dash (<code>-</code>), the first number
being 1 to 3 digits (range 1 to 127) and the second 1 to 2 digits (range
0 to 15).<a href="#fn16" class="footnote-ref" id="fnref16"
role="doc-noteref"><sup>16</sup></a></p>
<p>The optional frame number is a number in the range 0 to 63, and may
have a half frame indicator <code>"A"</code> appended. Special character
sequences (with or without a half frame indicator appended) may also be
used: <code>"S"</code> or <code>"X"</code> means frame number 62,
<code>"K"</code> or <code>"00"</code> means frame number 63, and
<code>"F"</code> means frame number 0.</p>
<p>A parity bit is automatically added by Zint.</p>
<h2 id="state-postal-codes">6.5 4-State Postal Codes</h2>
<h3 id="australia-post-4-state-symbols">6.5.1 Australia Post 4-State
Symbols</h3>
<h4 id="customer-barcodes">6.5.1.1 Customer Barcodes</h4>
<figure>
<img src="images/auspost.svg" title="fig:" class="trk"
alt="zint -b AUSPOST --compliantheight -d &quot;96184209&quot;" />
<figcaption
aria-hidden="true"><code>zint -b AUSPOST --compliantheight -d "96184209"</code></figcaption>
</figure>
<p>Australia Post Standard Customer Barcode, Customer Barcode 2 and
Customer Barcode 3 are 37-bar, 52-bar and 67-bar specifications
respectively, developed by Australia Post for printing Delivery Point ID
(DPID) and customer information on mail items. Valid data characters are
0-9, A-Z, a-z, space and hash (#). A Format Control Code (FCC) is added
by Zint and should not be included in the input data. Reed-Solomon error
correction data is generated by Zint. Encoding behaviour is determined
by the length of the input data according to the formula shown in the
following table.</p>
<div id="tbl:auspost_input_formats" class="tablenos">
<table id="tbl:auspost_input_formats" style="width:86%;"
data-tag=": Australia Post Input Formats">
<caption><span>Table : Australia Post Input Formats</span> </caption>
<colgroup>
<col style="width: 13%" />
<col style="width: 38%" />
<col style="width: 12%" />
<col style="width: 8%" />
<col style="width: 12%" />
</colgroup>
<thead>
<tr>
<th style="text-align: left;">Input Length</th>
<th style="text-align: left;">Required Input Format</th>
<th>Symbol Length</th>
<th>FCC</th>
<th style="text-align: left;">Encoding Table</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">8</td>
<td style="text-align: left;"><code>99999999</code></td>
<td>37-bar</td>
<td>11</td>
<td style="text-align: left;">None</td>
</tr>
<tr>
<td style="text-align: left;">13</td>
<td style="text-align: left;"><code>99999999AAAAA</code></td>
<td>52-bar</td>
<td>59</td>
<td style="text-align: left;">C</td>
</tr>
<tr>
<td style="text-align: left;">16</td>
<td style="text-align: left;"><code>9999999999999999</code></td>
<td>52-bar</td>
<td>59</td>
<td style="text-align: left;">N</td>
</tr>
<tr>
<td style="text-align: left;">18</td>
<td style="text-align: left;"><code>99999999AAAAAAAAAA</code></td>
<td>67-bar</td>
<td>62</td>
<td style="text-align: left;">C</td>
</tr>
<tr>
<td style="text-align: left;">23</td>
<td style="text-align: left;"><code>99999999999999999999999</code></td>
<td>67-bar</td>
<td>62</td>
<td style="text-align: left;">N</td>
</tr>
</tbody>
</table>
</div>
<h4 id="reply-paid-barcode">6.5.1.2 Reply Paid Barcode</h4>
<figure>
<img src="images/ausreply.svg" title="fig:" class="trk"
alt="zint -b AUSREPLY --compliantheight -d &quot;12345678&quot;" />
<figcaption
aria-hidden="true"><code>zint -b AUSREPLY --compliantheight -d "12345678"</code></figcaption>
</figure>
<p>A Reply Paid version of the Australia Post 4-State Barcode (FCC 45)
which requires an 8-digit DPID input.</p>
<h4 id="routing-barcode">6.5.1.3 Routing Barcode</h4>
<figure>
<img src="images/ausroute.svg" title="fig:" class="trk"
alt="zint -b AUSROUTE --compliantheight -d &quot;34567890&quot;" />
<figcaption
aria-hidden="true"><code>zint -b AUSROUTE --compliantheight -d "34567890"</code></figcaption>
</figure>
<p>A Routing version of the Australia Post 4-State Barcode (FCC 87)
which requires an 8-digit DPID input.</p>
<h4 id="redirect-barcode">6.5.1.4 Redirect Barcode</h4>
<figure>
<img src="images/ausredirect.svg" title="fig:" class="trk"
alt="zint -b AUSREDIRECT --compliantheight -d &quot;98765432&quot;" />
<figcaption
aria-hidden="true"><code>zint -b AUSREDIRECT --compliantheight -d "98765432"</code></figcaption>
</figure>
<p>A Redirection version of the Australia Post 4-State Barcode (FCC 92)
which requires an 8-digit DPID input.</p>
<h3 id="dutch-post-kix-code">6.5.2 Dutch Post KIX Code</h3>
<figure>
<img src="images/kix.svg" title="fig:" class="trk"
alt="zint -b KIX --compliantheight -d &quot;2500GG30250&quot;" />
<figcaption
aria-hidden="true"><code>zint -b KIX --compliantheight -d "2500GG30250"</code></figcaption>
</figure>
<p>This symbology is used by Royal Dutch TPG Post (Netherlands) for
Postal code and automatic mail sorting. Data input can consist of
numbers 0-9 and letters A-Z and needs to be 11 characters in length. No
check digit is included.</p>
<h3 id="royal-mail-4-state-customer-code-rm4scc">6.5.3 Royal Mail
4-State Customer Code (RM4SCC)</h3>
<figure>
<img src="images/rm4scc.svg" title="fig:" class="trk"
alt="zint -b RM4SCC --compliantheight -d &quot;W1J0TR01&quot;" />
<figcaption
aria-hidden="true"><code>zint -b RM4SCC --compliantheight -d "W1J0TR01"</code></figcaption>
</figure>
<p>The RM4SCC standard is used by the Royal Mail in the UK to encode
postcode and customer data on mail items. Data input can consist of
numbers 0-9 and letters A-Z and usually includes delivery postcode
followed by house number. For example <code>"W1J0TR01"</code> for 1
Piccadilly Circus in London. Check digit data is generated by Zint.</p>
<h3 id="royal-mail-4-state-mailmark">6.5.4 Royal Mail 4-State
Mailmark</h3>
<figure>
<img src="images/mailmark_4s.svg" title="fig:" class="trk"
alt="zint -b MAILMARK_4S --compliantheight -d &quot;1100000000000XY11&quot;" />
<figcaption
aria-hidden="true"><code>zint -b MAILMARK_4S --compliantheight -d "1100000000000XY11"</code></figcaption>
</figure>
<p>Developed in 2014 as a replacement for RM4SCC this 4-state symbol
includes Reed- Solomon error correction. Input is a pre-formatted
alphanumeric string of 22 (for Barcode C) or 26 (for Barcode L)
characters, producing a symbol with 66 or 78 bars respectively. The
rules for the input data are complex, as summarized in the following
table.</p>
<div id="tbl:mailmark_4s_input_fields" class="tablenos">
<table id="tbl:mailmark_4s_input_fields"
data-tag=": Royal Mail 4-State Mailmark Input Fields">
<caption><span>Table : Royal Mail 4-State Mailmark Input Fields</span>
</caption>
<colgroup>
<col style="width: 11%" />
<col style="width: 11%" />
<col style="width: 16%" />
<col style="width: 23%" />
<col style="width: 14%" />
<col style="width: 23%" />
</colgroup>
<thead>
<tr>
<th style="text-align: left;">Format</th>
<th style="text-align: left;">Version ID</th>
<th style="text-align: left;">Class</th>
<th>Supply Chain ID</th>
<th style="text-align: left;">Item ID</th>
<th style="text-align: left;">Destination+DPS</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">1 digit (0-4)</td>
<td style="text-align: left;">1 digit (0-3)</td>
<td style="text-align: left;">1 alphanum. (0-9A-E)</td>
<td>2 digits (C) or 6 digits (L)</td>
<td style="text-align: left;">8 digits</td>
<td style="text-align: left;">9 alphanumerics (1 of 6 patterns)</td>
</tr>
</tbody>
</table>
</div>
<p>The 6 Destination+DPS (Destination Post Code plus Delivery Point
Suffix) patterns are:</p>
<div id="tbl:mailmark_destination_dps" class="tablenos">
<table id="tbl:mailmark_destination_dps"
data-tag=": Royal Mail Mailmark Destination+DPS Patterns">
<caption><span>Table : Royal Mail Mailmark Destination+DPS
Patterns:</span> </caption>
<tbody>
<tr>
<td><code>FNFNLLNLS</code></td>
<td><code>FFNNLLNLS</code></td>
<td><code>FFNNNLLNL</code></td>
</tr>
<tr>
<td><code>FFNFNLLNL</code></td>
<td><code>FNNLLNLSS</code></td>
<td><code>FNNNLLNLS</code></td>
</tr>
</tbody>
</table>
</div>
<p>where <code>'F'</code> stands for full alphabetic (A-Z),
<code>'L'</code> for limited alphabetic (A-Z less
<code>'CIKMOV'</code>), <code>'N'</code> for numeric (0-9), and
<code>'S'</code> for space.</p>
<p>Four of the permitted patterns include a number of trailing space
characters - these will be appended by Zint if not included in the input
data.</p>
<p>For the two-dimensional Data Matrix-based version, see <a
href="#royal-mail-2d-mailmark-cmdm-data-matrix">6.6.2 Royal Mail 2D
Mailmark (CMDM) (Data Matrix)</a>.</p>
<h3 id="usps-intelligent-mail">6.5.5 USPS Intelligent Mail</h3>
<figure>
<img src="images/usps_imail.svg" title="fig:" class="trk"
alt="zint -b USPS_IMAIL --compliantheight -d &quot;01234567094987654321-01234&quot;" />
<figcaption
aria-hidden="true"><code>zint -b USPS_IMAIL --compliantheight -d "01234567094987654321-01234"</code></figcaption>
</figure>
<p>Also known as the OneCode barcode and used in the U.S. by the United
States Postal Service (USPS), the Intelligent Mail system replaced the
POSTNET and PLANET symbologies in 2009. Intelligent Mail is a fixed
length (65-bar) symbol which combines routing and customer information
in a single symbol. Input data consists of a 20-digit tracking code,
followed by a dash (<code>-</code>), followed by a delivery point
zip-code which can be 0, 5, 9 or 11 digits in length. For example all of
the following inputs are valid data entries:</p>
<ul>
<li><code>"01234567094987654321"</code></li>
<li><code>"01234567094987654321-01234"</code></li>
<li><code>"01234567094987654321-012345678"</code></li>
<li><code>"01234567094987654321-01234567891"</code></li>
</ul>
<h3 id="japanese-postal-code">6.5.6 Japanese Postal Code</h3>
<figure>
<img src="images/japanpost.svg" title="fig:" class="trk"
alt="zint -b JAPANPOST --compliantheight -d &quot;15400233-16-4-205&quot;" />
<figcaption
aria-hidden="true"><code>zint -b JAPANPOST --compliantheight -d "15400233-16-4-205"</code></figcaption>
</figure>
<p>Used for address data on mail items for Japan Post. Accepted values
are 0-9, A-Z and dash (<code>-</code>). A modulo 19 check digit is added
by Zint.</p>
<h3 id="daft-code">6.5.7 DAFT Code</h3>
<figure>
<img src="images/daft_rm4scc.svg" title="fig:" class="trk"
alt="zint -b DAFT -d &quot;AAFDTTDAFADTFTTFFFDATFTADTTFFTDAFAFDTF&quot; --height=8.494 --vers=256" />
<figcaption
aria-hidden="true"><code>zint -b DAFT -d "AAFDTTDAFADTFTTFFFDATFTADTTFFTDAFAFDTF" --height=8.494 --vers=256</code></figcaption>
</figure>
<p>This is a method for creating 4-state codes where the data encoding
is provided by an external program. Input data should consist of the
letters <code>'D'</code>, <code>'A'</code>, <code>'F'</code> and
<code>'T'</code> where these refer to descender, ascender, full
(ascender and descender) and tracker (neither ascender nor descender)
respectively. All other characters are invalid. The ratio of the tracker
size to full height can be given in thousandths (permille) using the
<code>--vers</code> option (API <code>option_2</code>). The default
value is 250 (25%).</p>
<p>For example the following</p>
<div class="sourceCode" id="cb110"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb110-1"><a href="#cb110-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> DAFT <span class="at">-d</span> AAFDTTDAFADTFTTFFFDATFTADTTFFTDAFAFDTF <span class="at">--height</span><span class="op">=</span>8.494 <span class="at">--vers</span><span class="op">=</span>256</span></code></pre></div>
<p>produces the same barcode (see <a
href="#royal-mail-4-state-customer-code-rm4scc">6.5.3 Royal Mail 4-State
Customer Code (RM4SCC)</a>) as</p>
<div class="sourceCode" id="cb111"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb111-1"><a href="#cb111-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> RM4SCC <span class="at">--compliantheight</span> <span class="at">-d</span> <span class="st">&quot;W1J0TR01&quot;</span></span></code></pre></div>
<h2 id="matrix-symbols">6.6 Matrix Symbols</h2>
<h3 id="data-matrix-iso-16022">6.6.1 Data Matrix (ISO 16022)</h3>
<figure>
<img src="images/hibc_dm.svg" title="fig:" class="i2dbig"
alt="zint -b HIBC_DM -d &quot;/ACMRN123456/V200912190833&quot; --fast --square" />
<figcaption
aria-hidden="true"><code>zint -b HIBC_DM -d "/ACMRN123456/V200912190833" --fast --square</code></figcaption>
</figure>
<p>Also known as Semacode this symbology was developed in 1989 by Acuity
CiMatrix in partnership with the U.S. DoD and NASA. The symbol can
encode a large amount of data in a small area. Data Matrix encodes
characters in the Latin-1 set by default but also supports encoding in
other character sets using the ECI mechanism. It can also encode GS1
data. The size of the generated symbol can be adjusted using the
<code>--vers</code> option (API <code>option_2</code>) as shown in the
table below. A separate symbology ID (<code>BARCODE_HIBC_DM</code>) can
be used to encode Health Industry Barcode (HIBC) data. Note that only
ECC 200 symbols are supported, the older standards (ECC 000 to 140) have
now been removed from Zint.</p>
<div id="tbl:datamatrix_sizes" class="tablenos">
<table id="tbl:datamatrix_sizes" data-tag=": Data Matrix Sizes">
<caption><span>Table : Data Matrix Sizes</span> </caption>
<thead>
<tr>
<th>Input</th>
<th>Symbol Size</th>
<th></th>
<th>Input</th>
<th>Symbol Size</th>
<th></th>
<th>Input</th>
<th>Symbol Size</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>10 x 10</td>
<td></td>
<td>11</td>
<td>36 x 36</td>
<td></td>
<td>21</td>
<td>104 x 104</td>
</tr>
<tr>
<td>2</td>
<td>12 x 12</td>
<td></td>
<td>12</td>
<td>40 x 40</td>
<td></td>
<td>22</td>
<td>120 x 120</td>
</tr>
<tr>
<td>3</td>
<td>14 x 14</td>
<td></td>
<td>13</td>
<td>44 x 44</td>
<td></td>
<td>23</td>
<td>132 x 132</td>
</tr>
<tr>
<td>4</td>
<td>16 x 16</td>
<td></td>
<td>14</td>
<td>48 x 48</td>
<td></td>
<td>24</td>
<td>144 x 144</td>
</tr>
<tr>
<td>5</td>
<td>18 x 18</td>
<td></td>
<td>15</td>
<td>52 x 52</td>
<td></td>
<td>25</td>
<td>8 x 18</td>
</tr>
<tr>
<td>6</td>
<td>20 x 20</td>
<td></td>
<td>16</td>
<td>64 x 64</td>
<td></td>
<td>26</td>
<td>8 x 32</td>
</tr>
<tr>
<td>7</td>
<td>22 x 22</td>
<td></td>
<td>17</td>
<td>72 x 72</td>
<td></td>
<td>28</td>
<td>12 x 26</td>
</tr>
<tr>
<td>8</td>
<td>24 x 24</td>
<td></td>
<td>18</td>
<td>80 x 80</td>
<td></td>
<td>28</td>
<td>12 x 36</td>
</tr>
<tr>
<td>9</td>
<td>26 x 26</td>
<td></td>
<td>19</td>
<td>88 x 88</td>
<td></td>
<td>29</td>
<td>16 x 36</td>
</tr>
<tr>
<td>10</td>
<td>32 x 32</td>
<td></td>
<td>20</td>
<td>96 x 96</td>
<td></td>
<td>30</td>
<td>16 x 48</td>
</tr>
</tbody>
</table>
</div>
<p>The largest version 24 (144 x 144) can encode 3116 digits, around
2335 alphanumeric characters, or 1555 bytes of data.</p>
<p>When using automatic symbol sizes you can force Zint to use square
symbols (versions 1-24) at the command line by using the option
<code>--square</code> (API <code>option_3 = DM_SQUARE</code>).</p>
<p>Data Matrix Rectangular Extension (ISO/IEC 21471) codes may be
generated with the following values as before:</p>
<div id="tbl:dmre_sizes" class="tablenos">
<table id="tbl:dmre_sizes" data-tag=": DMRE Sizes">
<caption><span>Table : DMRE Sizes</span> </caption>
<thead>
<tr>
<th>Input</th>
<th>Symbol Size</th>
<th></th>
<th>Input</th>
<th>Symbol Size</th>
</tr>
</thead>
<tbody>
<tr>
<td>31</td>
<td>8 x 48</td>
<td></td>
<td>40</td>
<td>20 x 36</td>
</tr>
<tr>
<td>32</td>
<td>8 x 64</td>
<td></td>
<td>41</td>
<td>20 x 44</td>
</tr>
<tr>
<td>33</td>
<td>8 x 80</td>
<td></td>
<td>42</td>
<td>20 x 64</td>
</tr>
<tr>
<td>34</td>
<td>8 x 96</td>
<td></td>
<td>43</td>
<td>22 x 48</td>
</tr>
<tr>
<td>35</td>
<td>8 x 120</td>
<td></td>
<td>44</td>
<td>24 x 48</td>
</tr>
<tr>
<td>36</td>
<td>8 x 144</td>
<td></td>
<td>45</td>
<td>24 x 64</td>
</tr>
<tr>
<td>37</td>
<td>12 x 64</td>
<td></td>
<td>46</td>
<td>26 x 40</td>
</tr>
<tr>
<td>38</td>
<td>12 x 88</td>
<td></td>
<td>47</td>
<td>26 x 48</td>
</tr>
<tr>
<td>39</td>
<td>16 x 64</td>
<td></td>
<td>48</td>
<td>26 x 64</td>
</tr>
</tbody>
</table>
</div>
<p>DMRE symbol sizes may be activated in automatic size mode using the
option <code>--dmre</code> (API <code>option_3 = DM_DMRE</code>).</p>
<p>GS1 data may be encoded using <code>FNC1</code> (default) or
<code>GS</code> (Group Separator, ASCII 29) as separator. Use the option
<code>--gssep</code> to change to <code>GS</code> (API
<code>output_options |= GS1_GS_SEPARATOR</code>).</p>
<p>By default Zint uses a “de facto” codeword placement for symbols of
size 144 x 144 (version 24). To override this and use the now clarified
ISO/IEC standard placement, use option <code>--dmiso144</code> (API
<code>option_3 |= DM_ISO_144</code>).</p>
<p>For a faster but less optimal encodation, the <code>--fast</code>
option (API <code>input_mode |= FAST_MODE</code>) may be used.</p>
<p>Data Matrix supports Structured Append of up to 16 symbols and a
numeric ID (file identifications), which can be set by using the
<code>--structapp</code> option (see <a href="#structured-append">4.17
Structured Append</a>) (API <code>structapp</code>). The ID consists of
2 numbers <code>ID1</code> and <code>ID2</code>, each of which can range
from 1 to 254, and is specified as the single number
<code>ID1 * 1000 + ID2</code>, so for instance <code>ID1</code>
<code>"123"</code> and <code>ID2</code> <code>"234"</code> would be
given as <code>"123234"</code>. Note that both <code>ID1</code> and
<code>ID2</code> must be non-zero, so e.g. <code>"123000"</code> or
<code>"000123"</code> would be invalid IDs. If an ID is not given it
defaults to <code>"001001"</code>.</p>
<h3 id="royal-mail-2d-mailmark-cmdm-data-matrix">6.6.2 Royal Mail 2D
Mailmark (CMDM) (Data Matrix)</h3>
<figure>
<img src="images/mailmark_2d.svg" title="fig:" class="i2dbig"
alt="zint -b MAILMARK_2D -d &quot;JGB 01Z999999900000001EC1A1AA1A0SN35TQ&quot; --vers=30" />
<figcaption
aria-hidden="true"><code>zint -b MAILMARK_2D -d "JGB 01Z999999900000001EC1A1AA1A0SN35TQ" --vers=30</code></figcaption>
</figure>
<p>This variant of Data Matrix, also known as “Complex Mail Data Mark”
(CMDM), was introduced by Royal Mail along with <a
href="#royal-mail-4-state-mailmark">6.5.4 Royal Mail 4-State
Mailmark</a>, and offers space for customer data following an initial
pre-formatted 45 character section, as summarized below.</p>
<div id="tbl:mailmark_2d_input_fields" class="tablenos">
<table id="tbl:mailmark_2d_input_fields"
data-tag=": Royal Mail 2D Mailmark Input Fields">
<caption><span>Table : Royal Mail 2D Mailmark Input Fields</span>
</caption>
<thead>
<tr>
<th style="text-align: left;">Field Name</th>
<th style="text-align: left;">Length</th>
<th style="text-align: left;">Values</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">UPU Country ID</td>
<td style="text-align: left;">4</td>
<td style="text-align: left;"><code>"JGB "</code></td>
</tr>
<tr>
<td style="text-align: left;">Information Type</td>
<td style="text-align: left;">1</td>
<td style="text-align: left;">Alphanumeric</td>
</tr>
<tr>
<td style="text-align: left;">Version ID</td>
<td style="text-align: left;">1</td>
<td style="text-align: left;"><code>"1"</code></td>
</tr>
<tr>
<td style="text-align: left;">Class</td>
<td style="text-align: left;">1</td>
<td style="text-align: left;">Alphanumeric</td>
</tr>
<tr>
<td style="text-align: left;">Supply Chain ID</td>
<td style="text-align: left;">7</td>
<td style="text-align: left;">Numeric</td>
</tr>
<tr>
<td style="text-align: left;">Item ID</td>
<td style="text-align: left;">8</td>
<td style="text-align: left;">Numeric</td>
</tr>
<tr>
<td style="text-align: left;">Destination+DPS</td>
<td style="text-align: left;">9</td>
<td style="text-align: left;">Alphanumeric (1 of 6 patterns)</td>
</tr>
<tr>
<td style="text-align: left;">Service Type</td>
<td style="text-align: left;">1</td>
<td style="text-align: left;">Numeric</td>
</tr>
<tr>
<td style="text-align: left;">RTS Post Code</td>
<td style="text-align: left;">7</td>
<td style="text-align: left;">Alphanumeric (1 of 6 patterns)</td>
</tr>
<tr>
<td style="text-align: left;">Reserved</td>
<td style="text-align: left;">6</td>
<td style="text-align: left;">Spaces</td>
</tr>
<tr>
<td style="text-align: left;">Customer Data</td>
<td style="text-align: left;">6, 45 or 29</td>
<td style="text-align: left;">Anything (Latin-1)</td>
</tr>
</tbody>
</table>
</div>
<p>The 6 Destination+DPS (Destination Post Code plus Delivery Point
Suffix) patterns are the same as for the 4-state - see Table <a
href="#tbl:mailmark_destination_dps">: Royal Mail Mailmark
Destination+DPS Patterns</a>. The 6 RTS (Return to Sender) Post Code
patterns are the same also except without the additional DPS
<code>'NL'</code>, i.e.</p>
<div id="tbl:mailmark_2d_rts" class="tablenos">
<table id="tbl:mailmark_2d_rts"
data-tag=": Royal Mail 2D Mailmark RTS Patterns">
<caption><span>Table : Royal Mail 2D Mailmark RTS Patterns</span>
</caption>
<tbody>
<tr>
<td><code>FNFNLLS</code></td>
<td><code>FFNNLLS</code></td>
<td><code>FFNNNLL</code></td>
</tr>
<tr>
<td><code>FFNFNLL</code></td>
<td><code>FNNLLSS</code></td>
<td><code>FNNNLLS</code></td>
</tr>
</tbody>
</table>
</div>
<p>where <code>'F'</code> is full alphabetic (A-Z), <code>'L'</code>
limited alphabetic (A-Z less <code>'CIKMOV'</code>), <code>'N'</code>
numeric (0-9), and <code>'S'</code> space.</p>
<p>Three sizes are defined, one rectangular, with varying maximum
amounts of optional customer data:</p>
<div id="tbl:mailmark_2d_sizes" class="tablenos">
<table id="tbl:mailmark_2d_sizes"
data-tag=": Royal Mail 2D Mailmark Sizes">
<caption><span>Table : Royal Mail 2D Mailmark Sizes</span> </caption>
<thead>
<tr>
<th style="text-align: left;">Name</th>
<th style="text-align: left;">Size</th>
<th>Customer Data</th>
<th>Zint Version</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">Type 7</td>
<td style="text-align: left;">24 x 24</td>
<td>6 characters</td>
<td>8</td>
</tr>
<tr>
<td style="text-align: left;">Type 9</td>
<td style="text-align: left;">32 x 32</td>
<td>45 characters</td>
<td>10</td>
</tr>
<tr>
<td style="text-align: left;">Type 29</td>
<td style="text-align: left;">16 x 48</td>
<td>29 characters</td>
<td>30</td>
</tr>
</tbody>
</table>
</div>
<p>Zint will automatically select a size based on the amount of customer
data, or it can be specified using the <code>--vers</code> option (API
<code>option_2</code>), which takes the Zint version number (one more
than the Royal Mail Type number). Zint will prefix the input data with
<code>"JGB "</code> if it’s missing, and also space-pad the input if the
customer data is absent or falls short. As with Data Matrix, the
rectangular symbol Type 29 can be excluded from automatic size selection
by using the option <code>--square</code> (API
<code>option_3 = DM_SQUARE</code>).</p>
<p>GS1 data, the ECI mechanism, and Structured Append are not
supported.</p>
<h3 id="qr-code-iso-18004">6.6.3 QR Code (ISO 18004)</h3>
<figure>
<img src="images/qrcode.svg" title="fig:" class="i2dbig"
alt="zint -b QRCODE -d &quot;QR Code Symbol&quot; --mask=5" />
<figcaption
aria-hidden="true"><code>zint -b QRCODE -d "QR Code Symbol" --mask=5</code></figcaption>
</figure>
<p>Also known as Quick Response Code this symbology was developed by
Denso. Four levels of error correction are available using the
<code>--secure</code> option (API <code>option_1</code>) as shown in the
following table.</p>
<div id="tbl:qrcode_eccs" class="tablenos">
<table id="tbl:qrcode_eccs" data-tag=": QR Code ECC Levels">
<caption><span>Table : QR Code ECC Levels</span> </caption>
<thead>
<tr>
<th>Input</th>
<th>ECC Level</th>
<th>Error Correction Capacity</th>
<th>Recovery Capacity</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>L</td>
<td>Approx 20% of symbol</td>
<td>Approx 7%</td>
</tr>
<tr>
<td>2</td>
<td>M</td>
<td>Approx 37% of symbol</td>
<td>Approx 15%</td>
</tr>
<tr>
<td>3</td>
<td>Q</td>
<td>Approx 55% of symbol</td>
<td>Approx 25%</td>
</tr>
<tr>
<td>4</td>
<td>H</td>
<td>Approx 65% of symbol</td>
<td>Approx 30%</td>
</tr>
</tbody>
</table>
</div>
<p>The size of the symbol can be specified by setting the
<code>--vers</code> option (API <code>option_2</code>) to the QR Code
version required (1-40). The size of symbol generated is shown in the
table below.</p>
<div id="tbl:qrcode_sizes" class="tablenos">
<table id="tbl:qrcode_sizes" data-tag=": QR Code Sizes">
<caption><span>Table : QR Code Sizes</span> </caption>
<thead>
<tr>
<th>Input</th>
<th>Symbol Size</th>
<th></th>
<th>Input</th>
<th>Symbol Size</th>
<th></th>
<th>Input</th>
<th>Symbol Size</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>21 x 21</td>
<td></td>
<td>15</td>
<td>77 x 77</td>
<td></td>
<td>29</td>
<td>133 x 133</td>
</tr>
<tr>
<td>2</td>
<td>25 x 25</td>
<td></td>
<td>16</td>
<td>81 x 81</td>
<td></td>
<td>30</td>
<td>137 x 137</td>
</tr>
<tr>
<td>3</td>
<td>29 x 29</td>
<td></td>
<td>17</td>
<td>85 x 85</td>
<td></td>
<td>31</td>
<td>141 x 141</td>
</tr>
<tr>
<td>4</td>
<td>33 x 33</td>
<td></td>
<td>18</td>
<td>89 x 89</td>
<td></td>
<td>32</td>
<td>145 x 145</td>
</tr>
<tr>
<td>5</td>
<td>37 x 37</td>
<td></td>
<td>19</td>
<td>93 x 93</td>
<td></td>
<td>33</td>
<td>149 x 149</td>
</tr>
<tr>
<td>6</td>
<td>41 x 41</td>
<td></td>
<td>20</td>
<td>97 x 97</td>
<td></td>
<td>34</td>
<td>153 x 153</td>
</tr>
<tr>
<td>7</td>
<td>45 x 45</td>
<td></td>
<td>21</td>
<td>101 x 101</td>
<td></td>
<td>35</td>
<td>157 x 157</td>
</tr>
<tr>
<td>8</td>
<td>49 x 49</td>
<td></td>
<td>22</td>
<td>105 x 105</td>
<td></td>
<td>36</td>
<td>161 x 161</td>
</tr>
<tr>
<td>9</td>
<td>53 x 53</td>
<td></td>
<td>23</td>
<td>109 x 109</td>
<td></td>
<td>37</td>
<td>165 x 165</td>
</tr>
<tr>
<td>10</td>
<td>57 x 57</td>
<td></td>
<td>24</td>
<td>113 x 113</td>
<td></td>
<td>38</td>
<td>169 x 169</td>
</tr>
<tr>
<td>11</td>
<td>61 x 61</td>
<td></td>
<td>25</td>
<td>117 x 117</td>
<td></td>
<td>39</td>
<td>173 x 173</td>
</tr>
<tr>
<td>12</td>
<td>65 x 65</td>
<td></td>
<td>26</td>
<td>121 x 121</td>
<td></td>
<td>40</td>
<td>177 x 177</td>
</tr>
<tr>
<td>13</td>
<td>69 x 69</td>
<td></td>
<td>27</td>
<td>125 x 125</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>14</td>
<td>73 x 73</td>
<td></td>
<td>28</td>
<td>129 x 129</td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
</div>
<p>The maximum capacity of a QR Code symbol (version 40) is 7089 numeric
digits, 4296 alphanumeric characters or 2953 bytes of data. QR Code
symbols can also be used to encode GS1 data. QR Code symbols can by
default encode either characters in the Latin-1 set or Kanji, Katakana
and ASCII characters which are members of the Shift JIS encoding scheme.
In addition QR Code supports other character sets using the ECI
mechanism. Input should usually be entered as UTF-8 with conversion to
Latin-1 or Shift JIS being carried out by Zint. A separate symbology ID
(<code>BARCODE_HIBC_QR</code>) can be used to encode Health Industry
Barcode (HIBC) data.</p>
<p>Non-ASCII data density may be maximized by using the
<code>--fullmultibyte</code> switch (API
<code>option_3 = ZINT_FULL_MULTIBYTE</code>), but check that your
barcode reader supports this before using.</p>
<p>QR Code has eight different masks designed to minimize unwanted
patterns. The best mask to use is selected automatically by Zint but may
be manually specified by using the <code>--mask</code> switch with
values 0-7, or in the API by setting
<code>option_3 = (N + 1) &lt;&lt; 8</code> where N is 0-7. To use with
<code>ZINT_FULL_MULTIBYTE</code> set</p>
<div class="sourceCode" id="cb112"><pre
class="sourceCode c"><code class="sourceCode c"><span id="cb112-1"><a href="#cb112-1" aria-hidden="true" tabindex="-1"></a>option_3 <span class="op">=</span> ZINT_FULL_MULTIBYTE <span class="op">|</span> <span class="op">(</span>N <span class="op">+</span> <span class="dv">1</span><span class="op">)</span> <span class="op">&lt;&lt;</span> <span class="dv">8</span></span></code></pre></div>
<p>The <code>--fast</code> option (API
<code>input_mode |= FAST_MODE</code>) may be used when leaving Zint to
automatically select a mask to reduce the number of masks to try to four
(0, 2, 4, 7).</p>
<p>QR Code supports Structured Append of up to 16 symbols and a numeric
ID (parity), which can be set by using the <code>--structapp</code>
option (see <a href="#structured-append">4.17 Structured Append</a>)
(API <code>structapp</code>). The parity ID ranges from 0 (default) to
255, and for full compliance should be set to the value obtained by
<code>XOR</code>-ing together each byte of the complete data forming the
sequence. Currently this calculation must be done outside of Zint.</p>
<h3 id="micro-qr-code-iso-18004">6.6.4 Micro QR Code (ISO 18004)</h3>
<figure>
<img src="images/microqr.svg" title="fig:" class="i2dbig"
alt="zint -b MICROQR -d &quot;01234567&quot;" />
<figcaption
aria-hidden="true"><code>zint -b MICROQR -d "01234567"</code></figcaption>
</figure>
<p>A miniature version of the QR Code symbol for short messages, Micro
QR Code symbols can encode either Latin-1 characters or Shift JIS
characters. Input should be entered as a UTF-8 stream with conversion to
Latin-1 or Shift JIS being carried out automatically by Zint. A
preferred symbol size can be selected by using the <code>--vers</code>
option (API <code>option_2</code>), as shown in the table below. Note
that versions M1 and M2 have restrictions on what characters can be
encoded.</p>
<div id="tbl:micrqr_sizes" class="tablenos">
<table id="tbl:micrqr_sizes" style="width:93%;"
data-tag=": Micro QR Code Sizes">
<caption><span>Table : Micro QR Code Sizes</span> </caption>
<colgroup>
<col style="width: 11%" />
<col style="width: 13%" />
<col style="width: 19%" />
<col style="width: 48%" />
</colgroup>
<thead>
<tr>
<th>Input</th>
<th>Version</th>
<th>Symbol Size</th>
<th style="text-align: left;">Allowed Characters</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>M1</td>
<td>11 x 11</td>
<td style="text-align: left;">Numeric only</td>
</tr>
<tr>
<td>2</td>
<td>M2</td>
<td>13 x 13</td>
<td style="text-align: left;">Numeric, uppercase letters, space, and the
characters <code>"$%*+-./:"</code></td>
</tr>
<tr>
<td>3</td>
<td>M3</td>
<td>15 x 15</td>
<td style="text-align: left;">Latin-1 and Shift JIS</td>
</tr>
<tr>
<td>4</td>
<td>M4</td>
<td>17 x 17</td>
<td style="text-align: left;">Latin-1 and Shift JIS</td>
</tr>
</tbody>
</table>
</div>
<p>Version M4 can encode up to 35 digits, 21 alphanumerics, 15 bytes or
9 Kanji characters.</p>
<p>Except for version M1, which is always ECC level L, the amount of ECC
codewords can be adjusted using the <code>--secure</code> option (API
<code>option_1</code>); however ECC level H is not available for any
version, and ECC level Q is only available for version M4:</p>
<div id="tbl:micrqr_eccs" class="tablenos">
<table id="tbl:micrqr_eccs" style="width:99%;"
data-tag=": Micro QR ECC Levels">
<caption><span>Table : Micro QR ECC Levels</span> </caption>
<colgroup>
<col style="width: 12%" />
<col style="width: 12%" />
<col style="width: 33%" />
<col style="width: 19%" />
<col style="width: 20%" />
</colgroup>
<thead>
<tr>
<th>Input</th>
<th style="text-align: left;">ECC Level</th>
<th style="text-align: left;">Error Correction Capacity</th>
<th style="text-align: left;">Recovery Capacity</th>
<th style="text-align: left;">Available for Versions</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td style="text-align: left;">L</td>
<td style="text-align: left;">Approx 20% of symbol</td>
<td style="text-align: left;">Approx 7%</td>
<td style="text-align: left;">M1, M2, M3, M4</td>
</tr>
<tr>
<td>2</td>
<td style="text-align: left;">M</td>
<td style="text-align: left;">Approx 37% of symbol</td>
<td style="text-align: left;">Approx 15%</td>
<td style="text-align: left;">M2, M3, M4</td>
</tr>
<tr>
<td>3</td>
<td style="text-align: left;">Q</td>
<td style="text-align: left;">Approx 55% of symbol</td>
<td style="text-align: left;">Approx 25%</td>
<td style="text-align: left;">M4</td>
</tr>
</tbody>
</table>
</div>
<p>The defaults for symbol size and ECC level depend on the input and
whether either of them is specified.</p>
<p>For barcode readers that support it, non-ASCII data density may be
maximized by using the <code>--fullmultibyte</code> switch (API
<code>option_3 = ZINT_FULL_MULTIBYTE</code>).</p>
<p>Micro QR Code has four different masks designed to minimize unwanted
patterns. The best mask to use is selected automatically by Zint but may
be manually specified by using the <code>--mask</code> switch with
values 0-3, or in the API by setting
<code>option_3 = (N + 1) &lt;&lt; 8</code> where N is 0-3. To use with
<code>ZINT_FULL_MULTIBYTE</code> set</p>
<div class="sourceCode" id="cb113"><pre
class="sourceCode c"><code class="sourceCode c"><span id="cb113-1"><a href="#cb113-1" aria-hidden="true" tabindex="-1"></a>option_3 <span class="op">=</span> ZINT_FULL_MULTIBYTE <span class="op">|</span> <span class="op">(</span>N <span class="op">+</span> <span class="dv">1</span><span class="op">)</span> <span class="op">&lt;&lt;</span> <span class="dv">8</span></span></code></pre></div>
<h3 id="rectangular-micro-qr-code-rmqr-iso-23941">6.6.5 Rectangular
Micro QR Code (rMQR) (ISO 23941)</h3>
<figure>
<img src="images/rmqr.svg" title="fig:" class="i2dbig"
alt="zint -b RMQR -d &quot;0123456&quot;" />
<figcaption
aria-hidden="true"><code>zint -b RMQR -d "0123456"</code></figcaption>
</figure>
<p>A rectangular version of QR Code, rMQR supports encoding of GS1 data,
and either Latin-1 characters or Shift JIS characters, and other
encodings using the ECI mechanism. As with other symbologies data should
be entered as UTF-8 with conversion being handled by Zint. The amount of
ECC codewords can be adjusted using the <code>--secure</code> option
(API <code>option_1</code>), however only ECC levels M and H are valid
for this type of symbol.</p>
<div id="tbl:rmqr_eccs" class="tablenos">
<table id="tbl:rmqr_eccs" data-tag=": rMQR ECC Levels">
<caption><span>Table : rMQR ECC Levels</span> </caption>
<thead>
<tr>
<th>Input</th>
<th>ECC Level</th>
<th>Error Correction Capacity</th>
<th>Recovery Capacity</th>
</tr>
</thead>
<tbody>
<tr>
<td>2</td>
<td>M</td>
<td>Approx 37% of symbol</td>
<td>Approx 15%</td>
</tr>
<tr>
<td>4</td>
<td>H</td>
<td>Approx 65% of symbol</td>
<td>Approx 30%</td>
</tr>
</tbody>
</table>
</div>
<p>The preferred symbol sizes can be selected using the
<code>--vers</code> option (API <code>option_2</code>) as shown in the
table below. Input values between 33 and 38 fix the height of the symbol
while allowing Zint to determine the minimum symbol width.</p>
<div id="tbl:rmqr_sizes" class="tablenos">
<table id="tbl:rmqr_sizes" data-tag=": rMQR Sizes">
<caption><span>Table : rMQR Sizes</span> </caption>
<colgroup>
<col style="width: 9%" />
<col style="width: 12%" />
<col style="width: 25%" />
<col style="width: 4%" />
<col style="width: 9%" />
<col style="width: 12%" />
<col style="width: 28%" />
</colgroup>
<thead>
<tr>
<th>Input</th>
<th>Version</th>
<th>Symbol Size (HxW)</th>
<th></th>
<th>Input</th>
<th>Version</th>
<th style="text-align: left;">Symbol Size (HxW)</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>R7x43</td>
<td>7 x 43</td>
<td></td>
<td>20</td>
<td>R13x77</td>
<td style="text-align: left;">13 x 77</td>
</tr>
<tr>
<td>2</td>
<td>R7x59</td>
<td>7 x 59</td>
<td></td>
<td>21</td>
<td>R13x99</td>
<td style="text-align: left;">13 x 99</td>
</tr>
<tr>
<td>3</td>
<td>R7x77</td>
<td>7 x 77</td>
<td></td>
<td>22</td>
<td>R13x139</td>
<td style="text-align: left;">13 x 139</td>
</tr>
<tr>
<td>4</td>
<td>R7x99</td>
<td>7 x 99</td>
<td></td>
<td>23</td>
<td>R15x43</td>
<td style="text-align: left;">15 x 43</td>
</tr>
<tr>
<td>5</td>
<td>R7x139</td>
<td>7 x 139</td>
<td></td>
<td>24</td>
<td>R15x59</td>
<td style="text-align: left;">15 x 59</td>
</tr>
<tr>
<td>6</td>
<td>R9x43</td>
<td>9 x 43</td>
<td></td>
<td>25</td>
<td>R15x77</td>
<td style="text-align: left;">15 x 77</td>
</tr>
<tr>
<td>7</td>
<td>R9x59</td>
<td>9 x 59</td>
<td></td>
<td>26</td>
<td>R15x99</td>
<td style="text-align: left;">15 x 99</td>
</tr>
<tr>
<td>8</td>
<td>R9x77</td>
<td>9 x 77</td>
<td></td>
<td>27</td>
<td>R15x139</td>
<td style="text-align: left;">15 x 139</td>
</tr>
<tr>
<td>9</td>
<td>R9x99</td>
<td>9 x 99</td>
<td></td>
<td>28</td>
<td>R17x43</td>
<td style="text-align: left;">17 x 43</td>
</tr>
<tr>
<td>10</td>
<td>R9x139</td>
<td>9 x 139</td>
<td></td>
<td>29</td>
<td>R17x59</td>
<td style="text-align: left;">17 x 59</td>
</tr>
<tr>
<td>11</td>
<td>R11x27</td>
<td>11 x 27</td>
<td></td>
<td>30</td>
<td>R17x77</td>
<td style="text-align: left;">17 x 77</td>
</tr>
<tr>
<td>12</td>
<td>R11x43</td>
<td>11 x 43</td>
<td></td>
<td>31</td>
<td>R17x99</td>
<td style="text-align: left;">17 x 99</td>
</tr>
<tr>
<td>13</td>
<td>R11x59</td>
<td>11 x 59</td>
<td></td>
<td>32</td>
<td>R17x139</td>
<td style="text-align: left;">17 x 139</td>
</tr>
<tr>
<td>14</td>
<td>R11x77</td>
<td>11 x 77</td>
<td></td>
<td>33</td>
<td>R7xW</td>
<td style="text-align: left;">7 x automatic width</td>
</tr>
<tr>
<td>15</td>
<td>R11x99</td>
<td>11 x 99</td>
<td></td>
<td>34</td>
<td>R9xW</td>
<td style="text-align: left;">9 x automatic width</td>
</tr>
<tr>
<td>16</td>
<td>R11x139</td>
<td>11 x 139</td>
<td></td>
<td>35</td>
<td>R11xW</td>
<td style="text-align: left;">11 x automatic width</td>
</tr>
<tr>
<td>17</td>
<td>R13x27</td>
<td>13 x 27</td>
<td></td>
<td>36</td>
<td>R13xW</td>
<td style="text-align: left;">13 x automatic width</td>
</tr>
<tr>
<td>18</td>
<td>R13x43</td>
<td>13 x 43</td>
<td></td>
<td>37</td>
<td>R15xW</td>
<td style="text-align: left;">15 x automatic width</td>
</tr>
<tr>
<td>19</td>
<td>R13x59</td>
<td>13 x 59</td>
<td></td>
<td>38</td>
<td>R17xW</td>
<td style="text-align: left;">17 x automatic width</td>
</tr>
</tbody>
</table>
</div>
<p>The largest version R17x139 (32) can encode up to 361 digits, 219
alphanumerics, 150 bytes, or 92 Kanji characters.</p>
<p>For barcode readers that support it, non-ASCII data density may be
maximized by using the <code>--fullmultibyte</code> switch or in the API
by setting <code>option_3 = ZINT_FULL_MULTIBYTE</code>.</p>
<h3 id="upnqr-univerzalnega-plačilnega-naloga-qr">6.6.6 UPNQR
(Univerzalnega Plačilnega Naloga QR)</h3>
<figure>
<img src="images/upnqr.svg" title="fig:" class="i2d"
alt="zint -b UPNQR -i upn_utf8.txt --quietzones" />
<figcaption
aria-hidden="true"><code>zint -b UPNQR -i upn_utf8.txt --quietzones</code></figcaption>
</figure>
<p>A variation of QR Code used by Združenje Bank Slovenije (Bank
Association of Slovenia). The size, error correction level and ECI are
set by Zint and do not need to be specified. UPNQR is unusual in that it
uses Latin-2 (ISO/IEC 8859-2 plus ASCII) formatted data. Zint will
accept UTF-8 data and convert it to Latin-2, or if your data is already
Latin-2 formatted use the <code>--binary</code> switch (API
<code>input_mode = DATA_MODE</code>).</p>
<p>The following example creates a symbol from data saved as a Latin-2
file:</p>
<div class="sourceCode" id="cb114"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb114-1"><a href="#cb114-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-o</span> upnqr.png <span class="at">-b</span> 143 <span class="at">--scale</span><span class="op">=</span>3 <span class="at">--binary</span> <span class="at">-i</span> upn.txt</span></code></pre></div>
<p>A mask may be manually specified or the <code>--fast</code> option
used as with QRCODE.</p>
<h3 id="maxicode-iso-16023">6.6.7 MaxiCode (ISO 16023)</h3>
<figure>
<img src="images/maxicode.svg" title="fig:" class="i2d"
alt="zint -b MAXICODE -d &quot;1Z00004951\GUPSN\G06X610\G159\G1234567\G1/1\G\GY\G1 MAIN ST\GNY\GNY\R\E&quot; --esc --primary=&quot;152382802000000&quot; --scmvv=96" />
<figcaption
aria-hidden="true"><code>zint -b MAXICODE -d "1Z00004951\GUPSN\G06X610\G159\G1234567\G1/1\G\GY\G1 MAIN ST\GNY\GNY\R\E" --esc --primary="152382802000000" --scmvv=96</code></figcaption>
</figure>
<p>Developed by UPS the MaxiCode symbology employs a grid of hexagons
surrounding a bullseye finder pattern. This symbology is designed for
the identification of parcels. MaxiCode symbols can be encoded in one of
five modes. In modes 2 and 3 MaxiCode symbols are composed of two parts
named the primary and secondary messages. The primary message consists
of a Structured Carrier Message which includes various data about the
package being sent and the secondary message usually consists of address
data in a data structure. The format of the primary message required by
Zint is given in the following table.</p>
<div id="tbl:maxicode_scm" class="tablenos">
<table id="tbl:maxicode_scm"
data-tag=": MaxiCode Structured Carrier Message Format">
<caption><span>Table : MaxiCode Structured Carrier Message
Format:</span> </caption>
<colgroup>
<col style="width: 16%" />
<col style="width: 83%" />
</colgroup>
<thead>
<tr>
<th>Characters</th>
<th style="text-align: left;">Meaning</th>
</tr>
</thead>
<tbody>
<tr>
<td>1 - 9</td>
<td style="text-align: left;">Postcode data which can consist of up to 9
digits (for mode 2) or up to 6 alphanumeric characters (for mode 3).
Remaining unused characters for mode 3 can be filled with the SPACE
character (ASCII 32) or omitted. (adjust the following character
positions according to postcode length)</td>
</tr>
<tr>
<td>10 - 12</td>
<td style="text-align: left;">Three-digit country code according to ISO
3166-1.</td>
</tr>
<tr>
<td>13 - 15</td>
<td style="text-align: left;">Three-digit service code. This depends on
your parcel courier.</td>
</tr>
</tbody>
</table>
</div>
<p>The primary message can be set at the command prompt using the
<code>--primary</code> switch (API <code>primary</code>). The secondary
message uses the normal data entry method. For example:</p>
<div class="sourceCode" id="cb115"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb115-1"><a href="#cb115-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-o</span> test.eps <span class="at">-b</span> 57 <span class="at">--primary</span><span class="op">=</span><span class="st">&quot;999999999840012&quot;</span> <span class="dt">\</span></span>
<span id="cb115-2"><a href="#cb115-2" aria-hidden="true" tabindex="-1"></a>    <span class="at">-d</span> <span class="st">&quot;Secondary Message Here&quot;</span></span></code></pre></div>
<p>When using the API the primary message must be placed in the
<code>primary</code> string. The secondary is entered in the same way as
described in <a href="#encoding-and-saving-to-file">5.2 Encoding and
Saving to File</a>. When either of these modes is selected Zint will
analyse the primary message and select either mode 2 or mode 3 as
appropriate.</p>
<p>As a convenience the secondary message for modes 2 and 3 can be set
to be prefixed by the ISO/IEC 15434 Format <code>"01"</code>
(transportation) sequence <code>"[)&gt;\R01\Gvv"</code>, where
<code>vv</code> is a 2-digit version, by using the <code>--scmvv</code>
switch (API <code>option_2 = vv + 1</code>). For example to use the
common version <code>"96"</code> (ASC MH10/SC 8):</p>
<div class="sourceCode" id="cb116"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb116-1"><a href="#cb116-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> 57 <span class="at">--primary</span><span class="op">=</span><span class="st">&quot;152382802840001&quot;</span> <span class="at">--scmvv</span><span class="op">=</span>96 <span class="at">--esc</span> <span class="at">-d</span> <span class="dt">\</span></span>
<span id="cb116-2"><a href="#cb116-2" aria-hidden="true" tabindex="-1"></a>  <span class="st">&quot;1Z00004951\GUPSN\G06X610\G159\G1234567\G1/1\G\GY\G1 MAIN ST\GNY\GNY\R\E&quot;</span></span></code></pre></div>
<p>will prefix <code>"[)&gt;\R01\G96"</code> to the secondary message.
(<code>\R</code>, <code>\G</code> and <code>\E</code> are the escape
sequences for Record Separator, Group Separator and End of Transmission
respectively - see Table <a href="#tbl:escape_sequences">: Escape
Sequences</a>.)</p>
<p>Modes 4 to 6 can be accessed using the <code>--mode</code> switch
(API <code>option_1</code>). Modes 4 to 6 do not have a primary message.
For example:</p>
<div class="sourceCode" id="cb117"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb117-1"><a href="#cb117-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-o</span> test.eps <span class="at">-b</span> 57 <span class="at">--mode</span><span class="op">=</span>4 <span class="at">-d</span> <span class="st">&quot;A MaxiCode Message in Mode 4&quot;</span></span></code></pre></div>
<p>Mode 6 is reserved for the maintenance of scanner hardware and should
not be used to encode user data.</p>
<p>This symbology uses Latin-1 character encoding by default but also
supports the ECI encoding mechanism. The maximum length of text which
can be placed in a MaxiCode symbol depends on the type of characters
used in the text.</p>
<p>Example maximum data lengths are given in the table below:</p>
<div id="tbl:maxicode_data_length_maxima" class="tablenos">
<table id="tbl:maxicode_data_length_maxima" style="width:100%;"
data-tag=": MaxiCode Data Length Maxima">
<caption><span>Table : MaxiCode Data Length Maxima</span> </caption>
<colgroup>
<col style="width: 9%" />
<col style="width: 30%" />
<col style="width: 30%" />
<col style="width: 30%" />
</colgroup>
<thead>
<tr>
<th>Mode</th>
<th>Maximum Data Length for Capital Letters</th>
<th style="text-align: left;">Maximum Data Length for Numeric
Digits</th>
<th style="text-align: left;">Number of Error Correction Codewords</th>
</tr>
</thead>
<tbody>
<tr>
<td>2<code>*</code></td>
<td>84</td>
<td style="text-align: left;">126</td>
<td style="text-align: left;">50</td>
</tr>
<tr>
<td>3<code>*</code></td>
<td>84</td>
<td style="text-align: left;">126</td>
<td style="text-align: left;">50</td>
</tr>
<tr>
<td>4</td>
<td>93</td>
<td style="text-align: left;">138</td>
<td style="text-align: left;">50</td>
</tr>
<tr>
<td>5</td>
<td>77</td>
<td style="text-align: left;">113</td>
<td style="text-align: left;">66</td>
</tr>
<tr>
<td>6</td>
<td>93</td>
<td style="text-align: left;">138</td>
<td style="text-align: left;">50</td>
</tr>
</tbody>
</table>
</div>
<p><code>*</code> - secondary only</p>
<p>MaxiCode supports Structured Append of up to 8 symbols, which can be
set by using the <code>--structapp</code> option (see <a
href="#structured-append">4.17 Structured Append</a>) (API
<code>structapp</code>). It does not support specifying an ID.</p>
<p>MaxiCode uses a different scaling than other symbols for raster
output, see <a href="#maxicode-raster-scaling">4.9.3 MaxiCode Raster
Scaling</a>, and also for EMF vector output, when the scale is
multiplied by 20 instead of 2.</p>
<h3 id="aztec-code-iso-24778">6.6.8 Aztec Code (ISO 24778)</h3>
<figure>
<img src="images/aztec.svg" title="fig:" class="i2d"
alt="zint -b AZTEC -d &quot;123456789012&quot;" />
<figcaption
aria-hidden="true"><code>zint -b AZTEC -d "123456789012"</code></figcaption>
</figure>
<p>Invented by Andrew Longacre at Welch Allyn Inc in 1995 the Aztec Code
symbol is a matrix symbol with a distinctive bullseye finder pattern.
Zint can generate Compact Aztec Code (sometimes called Small Aztec Code)
as well as ‘full-range’ Aztec Code symbols and by default will
automatically select symbol type and size dependent on the length of the
data to be encoded. Error correction codewords will normally be
generated to fill at least 23% of the symbol. Two options are available
to change this behaviour:</p>
<p>The size of the symbol can be specified using the <code>--vers</code>
option (API <code>option_2</code>) to a value between 1 and 36 according
to the following table. The symbols marked with an asterisk
(<code>*</code>) in the table below are ‘compact’ symbols, meaning they
have a smaller bullseye pattern at the centre of the symbol.</p>
<div id="tbl:aztec_sizes" class="tablenos">
<table id="tbl:aztec_sizes" data-tag=": Aztec Code Sizes">
<caption><span>Table : Aztec Code Sizes</span> </caption>
<thead>
<tr>
<th>Input</th>
<th>Symbol Size</th>
<th></th>
<th>Input</th>
<th>Symbol Size</th>
<th></th>
<th>Input</th>
<th>Symbol Size</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>15 x 15<code>*</code></td>
<td></td>
<td>13</td>
<td>53 x 53</td>
<td></td>
<td>25</td>
<td>105 x 105</td>
</tr>
<tr>
<td>2</td>
<td>19 x 19<code>*</code></td>
<td></td>
<td>14</td>
<td>57 x 57</td>
<td></td>
<td>26</td>
<td>109 x 109</td>
</tr>
<tr>
<td>3</td>
<td>23 x 23<code>*</code></td>
<td></td>
<td>15</td>
<td>61 x 61</td>
<td></td>
<td>27</td>
<td>113 x 113</td>
</tr>
<tr>
<td>4</td>
<td>27 x 27<code>*</code></td>
<td></td>
<td>16</td>
<td>67 x 67</td>
<td></td>
<td>28</td>
<td>117 x 117</td>
</tr>
<tr>
<td>5</td>
<td>19 x 19</td>
<td></td>
<td>17</td>
<td>71 x 71</td>
<td></td>
<td>29</td>
<td>121 x 121</td>
</tr>
<tr>
<td>6</td>
<td>23 x 23</td>
<td></td>
<td>18</td>
<td>75 x 75</td>
<td></td>
<td>30</td>
<td>125 x 125</td>
</tr>
<tr>
<td>7</td>
<td>27 x 27</td>
<td></td>
<td>19</td>
<td>79 x 79</td>
<td></td>
<td>31</td>
<td>131 x 131</td>
</tr>
<tr>
<td>8</td>
<td>31 x 31</td>
<td></td>
<td>20</td>
<td>83 x 83</td>
<td></td>
<td>32</td>
<td>135 x 135</td>
</tr>
<tr>
<td>9</td>
<td>37 x 37</td>
<td></td>
<td>21</td>
<td>87 x 87</td>
<td></td>
<td>33</td>
<td>139 x 139</td>
</tr>
<tr>
<td>10</td>
<td>41 x 41</td>
<td></td>
<td>22</td>
<td>91 x 91</td>
<td></td>
<td>34</td>
<td>143 x 143</td>
</tr>
<tr>
<td>11</td>
<td>45 x 45</td>
<td></td>
<td>23</td>
<td>95 x 95</td>
<td></td>
<td>35</td>
<td>147 x 147</td>
</tr>
<tr>
<td>12</td>
<td>49 x 49</td>
<td></td>
<td>24</td>
<td>101 x 101</td>
<td></td>
<td>36</td>
<td>151 x 151</td>
</tr>
</tbody>
</table>
</div>
<p>Note that in symbols which have a specified size the amount of error
correction is dependent on the length of the data input and Zint will
allow error correction capacities as low as 3 codewords.</p>
<p>Alternatively the amount of error correction data can be specified by
setting the <code>--secure</code> option (API <code>option_1</code>) to
a value from the following table.</p>
<div id="tbl:aztec_eccs" class="tablenos">
<table id="tbl:aztec_eccs"
data-tag=": Aztec Code Error Correction Modes">
<caption><span>Table : Aztec Code Error Correction Modes</span>
</caption>
<thead>
<tr>
<th>Mode</th>
<th>Error Correction Capacity</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>&gt;10% + 3 codewords</td>
</tr>
<tr>
<td>2</td>
<td>&gt;23% + 3 codewords</td>
</tr>
<tr>
<td>3</td>
<td>&gt;36% + 3 codewords</td>
</tr>
<tr>
<td>4</td>
<td>&gt;50% + 3 codewords</td>
</tr>
</tbody>
</table>
</div>
<p>It is not possible to select both symbol size and error correction
capacity for the same symbol. If both options are selected then the
error correction capacity selection will be ignored.</p>
<p>Aztec Code supports ECI encoding and can encode up to a maximum
length of approximately 3823 numeric or 3067 alphabetic characters or
1914 bytes of data. A separate symbology ID
(<code>BARCODE_HIBC_AZTEC</code>) can be used to encode Health Industry
Barcode (HIBC) data.</p>
<p>Aztec Code supports Structured Append of up to 26 symbols and an
optional alphanumeric ID of up to 32 characters, which can be set by
using the <code>--structapp</code> option (see <a
href="#structured-append">4.17 Structured Append</a>) (API
<code>structapp</code>). The ID cannot contain spaces. If an ID is not
given, no ID is encoded.</p>
<h3 id="aztec-runes-iso-24778">6.6.9 Aztec Runes (ISO 24778)</h3>
<figure>
<img src="images/azrune.svg" title="fig:" class="i2d"
alt="zint -b AZRUNE -d &quot;125&quot;" />
<figcaption
aria-hidden="true"><code>zint -b AZRUNE -d "125"</code></figcaption>
</figure>
<p>A truncated version of compact Aztec Code for encoding whole integers
between 0 and 255, as defined in ISO/IEC 24778 Annex A. Includes
Reed-Solomon error correction. It does not support Structured
Append.</p>
<h3 id="code-one">6.6.10 Code One</h3>
<figure>
<img src="images/codeone.svg" title="fig:" class="i2d"
alt="zint -b CODEONE -d &quot;1234567890123456789012&quot;" />
<figcaption
aria-hidden="true"><code>zint -b CODEONE -d "1234567890123456789012"</code></figcaption>
</figure>
<p>A matrix symbology developed by Ted Williams in 1992 which encodes
data in a way similar to Data Matrix, Code One is able to encode the
Latin-1 character set or GS1 data, and also supports the ECI mechanism.
There are two types of Code One symbol - fixed-ratio symbols which are
roughly square (versions A through to H) and variable-width versions
(versions S and T). These can be selected by using <code>--vers</code>
(API <code>option_2</code>) as shown in the table below:</p>
<div id="tbl:codeone_sizes" class="tablenos">
<table id="tbl:codeone_sizes" data-tag=": Code One Sizes">
<caption><span>Table : Code One Sizes</span> </caption>
<colgroup>
<col style="width: 10%" />
<col style="width: 13%" />
<col style="width: 31%" />
<col style="width: 21%" />
<col style="width: 21%" />
</colgroup>
<thead>
<tr>
<th>Input</th>
<th>Version</th>
<th style="text-align: left;">Size (H x W)</th>
<th style="text-align: left;">Numeric Data Capacity</th>
<th style="text-align: left;">Alphanumeric Data Capacity</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>A</td>
<td style="text-align: left;">16 x 18</td>
<td style="text-align: left;">22</td>
<td style="text-align: left;">13</td>
</tr>
<tr>
<td>2</td>
<td>B</td>
<td style="text-align: left;">22 x 22</td>
<td style="text-align: left;">44</td>
<td style="text-align: left;">27</td>
</tr>
<tr>
<td>3</td>
<td>C</td>
<td style="text-align: left;">28 x 32</td>
<td style="text-align: left;">104</td>
<td style="text-align: left;">64</td>
</tr>
<tr>
<td>4</td>
<td>D</td>
<td style="text-align: left;">40 x 42</td>
<td style="text-align: left;">217</td>
<td style="text-align: left;">135</td>
</tr>
<tr>
<td>5</td>
<td>E</td>
<td style="text-align: left;">52 x 54</td>
<td style="text-align: left;">435</td>
<td style="text-align: left;">271</td>
</tr>
<tr>
<td>6</td>
<td>F</td>
<td style="text-align: left;">70 x 76</td>
<td style="text-align: left;">886</td>
<td style="text-align: left;">553</td>
</tr>
<tr>
<td>7</td>
<td>G</td>
<td style="text-align: left;">104 x 98</td>
<td style="text-align: left;">1755</td>
<td style="text-align: left;">1096</td>
</tr>
<tr>
<td>8</td>
<td>H</td>
<td style="text-align: left;">148 x 134</td>
<td style="text-align: left;">3550</td>
<td style="text-align: left;">2218</td>
</tr>
<tr>
<td>9</td>
<td>S</td>
<td style="text-align: left;">8 x automatic width</td>
<td style="text-align: left;">18</td>
<td style="text-align: left;">N/A</td>
</tr>
<tr>
<td>10</td>
<td>T</td>
<td style="text-align: left;">16 x automatic width</td>
<td style="text-align: left;">90</td>
<td style="text-align: left;">55</td>
</tr>
</tbody>
</table>
</div>
<p>Version S symbols can only encode numeric data. The width of version
S and version T symbols is determined by the length of the input
data.</p>
<p>Code One supports Structured Append of up to 128 symbols, which can
be set by using the <code>--structapp</code> option (see <a
href="#structured-append">4.17 Structured Append</a>) (API
<code>structapp</code>). It does not support specifying an ID.
Structured Append is not supported with GS1 data nor for Version S
symbols.</p>
<h3 id="grid-matrix">6.6.11 Grid Matrix</h3>
<figure>
<img src="images/gridmatrix.svg" title="fig:" class="i2d"
alt="zint -b GRIDMATRIX --eci=29 -d &quot;AAT2556 电池充电器+降压转换器  200mA至2A tel:86 019 82512738&quot;" />
<figcaption
aria-hidden="true"><code>zint -b GRIDMATRIX --eci=29 -d "AAT2556 电池充电器+降压转换器  200mA至2A tel:86 019 82512738"</code></figcaption>
</figure>
<p>Grid Matrix groups modules in a chequerboard pattern, and by default
supports the GB 2312 standard set, which includes Hanzi, ASCII and a
small number of ISO/IEC 8859-1 characters. Input should be entered as
UTF-8 with conversion to GB 2312 being carried out automatically by
Zint. Up to around 1529 alphanumeric characters or 2751 digits may be
encoded. The symbology also supports the ECI mechanism. Support for GS1
data has not yet been implemented.</p>
<p>The size of the symbol and the error correction capacity can be
specified. If you specify both of these values then Zint will make a
‘best-fit’ attempt to satisfy both conditions. The symbol size can be
specified using the <code>--vers</code> option (API
<code>option_2</code>), and the error correction capacity can be
specified by using the <code>--secure</code> option (API
<code>option_1</code>), according to the following tables.</p>
<div id="tbl:gridmatrix_sizes" class="tablenos">
<table id="tbl:gridmatrix_sizes" data-tag=": Grid Matrix Sizes">
<caption><span>Table : Grid Matrix Sizes</span> </caption>
<thead>
<tr>
<th>Input</th>
<th>Symbol Size</th>
<th></th>
<th>Input</th>
<th>Symbol Size</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>18 x 18</td>
<td></td>
<td>8</td>
<td>102 x 102</td>
</tr>
<tr>
<td>2</td>
<td>30 x 30</td>
<td></td>
<td>9</td>
<td>114 x 114</td>
</tr>
<tr>
<td>3</td>
<td>42 x 42</td>
<td></td>
<td>10</td>
<td>126 x 126</td>
</tr>
<tr>
<td>4</td>
<td>54 x 54</td>
<td></td>
<td>11</td>
<td>138 x 138</td>
</tr>
<tr>
<td>5</td>
<td>66 x 66</td>
<td></td>
<td>12</td>
<td>150 x 150</td>
</tr>
<tr>
<td>6</td>
<td>78 x 78</td>
<td></td>
<td>13</td>
<td>162 x 162</td>
</tr>
<tr>
<td>7</td>
<td>90 x 90</td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
</div>
<div id="tbl:gridmatrix_eccs" class="tablenos">
<table id="tbl:gridmatrix_eccs"
data-tag=": Grid Matrix Error Correction Modes">
<caption><span>Table : Grid Matrix Error Correction Modes</span>
</caption>
<thead>
<tr>
<th>Mode</th>
<th>Error Correction Capacity</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Approximately 10%</td>
</tr>
<tr>
<td>2</td>
<td>Approximately 20%</td>
</tr>
<tr>
<td>3</td>
<td>Approximately 30%</td>
</tr>
<tr>
<td>4</td>
<td>Approximately 40%</td>
</tr>
<tr>
<td>5</td>
<td>Approximately 50%</td>
</tr>
</tbody>
</table>
</div>
<p>Non-ASCII data density may be maximized by using the
<code>--fullmultibyte</code> switch (API
<code>option_3 = ZINT_FULL_MULTIBYTE</code>), but check that your
barcode reader supports this before using.</p>
<p>Grid Matrix supports Structured Append of up to 16 symbols and a
numeric ID (file signature), which can be set by using the
<code>--structapp</code> option (see <a href="#structured-append">4.17
Structured Append</a>) (API <code>structapp</code>). The ID ranges from
0 (default) to 255.</p>
<h3 id="dotcode">6.6.12 DotCode</h3>
<figure>
<img src="images/dotcode.svg" title="fig:" class="i2d"
alt="zint -b DOTCODE -d &quot;[01]00012345678905[17]201231[10]ABC123456&quot; --gs1" />
<figcaption
aria-hidden="true"><code>zint -b DOTCODE -d "[01]00012345678905[17]201231[10]ABC123456" --gs1</code></figcaption>
</figure>
<p>DotCode uses a grid of dots in a rectangular formation to encode
characters up to a maximum of approximately 450 characters (or 900
numeric digits). The symbology supports ECI encoding and GS1 data
encoding. By default Zint will produce a symbol which is approximately
square, however the width of the symbol can be adjusted by using the
<code>--cols</code> option (API <code>option_2</code>) (maximum 200).
Outputting DotCode to raster images (BMP, GIF, PCX, PNG, TIF) will
require setting the scale of the image to a larger value than the
default (e.g. approximately 10) for the dots to be plotted correctly.
Approximately 33% of the resulting symbol is comprised of error
correction codewords.</p>
<p>DotCode has two sets of 4 masks, designated 0-3 and 0’-3’, the second
<code>"prime"</code> set being the same as the first with corners lit.
The best mask to use is selected automatically by Zint but may be
manually specified by using the <code>--mask</code> switch with values
0-7, where 4-7 denote 0’-3’, or in the API by setting
<code>option_3 = (N + 1) &lt;&lt; 8</code> where N is 0-7.</p>
<p>DotCode supports Structured Append of up to 35 symbols, which can be
set by using the <code>--structapp</code> option (see <a
href="#structured-append">4.17 Structured Append</a>) (API
<code>structapp</code>). It does not support specifying an ID.</p>
<h3 id="han-xin-code-iso-20830">6.6.13 Han Xin Code (ISO 20830)</h3>
<figure>
<img src="images/hanxin.svg" title="fig:" class="i2d"
alt="zint -b HANXIN -d &quot;Hanxin Code symbol&quot;" />
<figcaption
aria-hidden="true"><code>zint -b HANXIN -d "Hanxin Code symbol"</code></figcaption>
</figure>
<p>Also known as Chinese Sensible Code, Han Xin is capable of encoding
characters in either the Latin-1 character set or the GB 18030 character
set (which is a UTF, i.e. includes all Unicode characters, optimized for
Chinese characters) and is also able to support the ECI mechanism.
Support for the encoding of GS1 data has not yet been implemented.</p>
<p>The size of the symbol can be specified using the <code>--vers</code>
option (API <code>option_2</code>) to a value between 1 and 84 according
to the following table.</p>
<div id="tbl:hanxin_sizes" class="tablenos">
<table id="tbl:hanxin_sizes" data-tag=": Han Xin Sizes">
<caption><span>Table : Han Xin Sizes</span> </caption>
<thead>
<tr>
<th>Input</th>
<th>Symbol Size</th>
<th></th>
<th>Input</th>
<th>Symbol Size</th>
<th></th>
<th>Input</th>
<th>Symbol Size</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>23 x 23</td>
<td></td>
<td>29</td>
<td>79 x 79</td>
<td></td>
<td>57</td>
<td>135 x 135</td>
</tr>
<tr>
<td>2</td>
<td>25 x 25</td>
<td></td>
<td>30</td>
<td>81 x 81</td>
<td></td>
<td>58</td>
<td>137 x 137</td>
</tr>
<tr>
<td>3</td>
<td>27 x 27</td>
<td></td>
<td>31</td>
<td>83 x 83</td>
<td></td>
<td>59</td>
<td>139 x 139</td>
</tr>
<tr>
<td>4</td>
<td>29 x 29</td>
<td></td>
<td>32</td>
<td>85 x 85</td>
<td></td>
<td>60</td>
<td>141 x 141</td>
</tr>
<tr>
<td>5</td>
<td>31 x 31</td>
<td></td>
<td>33</td>
<td>87 x 87</td>
<td></td>
<td>61</td>
<td>143 x 143</td>
</tr>
<tr>
<td>6</td>
<td>33 x 33</td>
<td></td>
<td>34</td>
<td>89 x 89</td>
<td></td>
<td>62</td>
<td>145 x 145</td>
</tr>
<tr>
<td>7</td>
<td>35 x 35</td>
<td></td>
<td>35</td>
<td>91 x 91</td>
<td></td>
<td>63</td>
<td>147 x 147</td>
</tr>
<tr>
<td>8</td>
<td>37 x 37</td>
<td></td>
<td>36</td>
<td>93 x 93</td>
<td></td>
<td>64</td>
<td>149 x 149</td>
</tr>
<tr>
<td>9</td>
<td>39 x 39</td>
<td></td>
<td>37</td>
<td>95 x 95</td>
<td></td>
<td>65</td>
<td>151 x 151</td>
</tr>
<tr>
<td>10</td>
<td>41 x 41</td>
<td></td>
<td>38</td>
<td>97 x 97</td>
<td></td>
<td>66</td>
<td>153 x 153</td>
</tr>
<tr>
<td>11</td>
<td>43 x 43</td>
<td></td>
<td>39</td>
<td>99 x 99</td>
<td></td>
<td>67</td>
<td>155 x 155</td>
</tr>
<tr>
<td>12</td>
<td>45 x 45</td>
<td></td>
<td>40</td>
<td>101 x 101</td>
<td></td>
<td>68</td>
<td>157 x 157</td>
</tr>
<tr>
<td>13</td>
<td>47 x 47</td>
<td></td>
<td>41</td>
<td>103 x 103</td>
<td></td>
<td>69</td>
<td>159 x 159</td>
</tr>
<tr>
<td>14</td>
<td>49 x 49</td>
<td></td>
<td>42</td>
<td>105 x 105</td>
<td></td>
<td>70</td>
<td>161 x 161</td>
</tr>
<tr>
<td>15</td>
<td>51 x 51</td>
<td></td>
<td>43</td>
<td>107 x 107</td>
<td></td>
<td>71</td>
<td>163 x 163</td>
</tr>
<tr>
<td>16</td>
<td>53 x 53</td>
<td></td>
<td>44</td>
<td>109 x 109</td>
<td></td>
<td>72</td>
<td>165 x 165</td>
</tr>
<tr>
<td>17</td>
<td>55 x 55</td>
<td></td>
<td>45</td>
<td>111 x 111</td>
<td></td>
<td>73</td>
<td>167 x 167</td>
</tr>
<tr>
<td>18</td>
<td>57 x 57</td>
<td></td>
<td>46</td>
<td>113 x 113</td>
<td></td>
<td>74</td>
<td>169 x 169</td>
</tr>
<tr>
<td>19</td>
<td>59 x 59</td>
<td></td>
<td>47</td>
<td>115 x 115</td>
<td></td>
<td>75</td>
<td>171 x 171</td>
</tr>
<tr>
<td>20</td>
<td>61 x 61</td>
<td></td>
<td>48</td>
<td>117 x 117</td>
<td></td>
<td>76</td>
<td>173 x 173</td>
</tr>
<tr>
<td>21</td>
<td>63 x 63</td>
<td></td>
<td>49</td>
<td>119 x 119</td>
<td></td>
<td>77</td>
<td>175 x 175</td>
</tr>
<tr>
<td>22</td>
<td>65 x 65</td>
<td></td>
<td>50</td>
<td>121 x 121</td>
<td></td>
<td>78</td>
<td>177 x 177</td>
</tr>
<tr>
<td>23</td>
<td>67 x 67</td>
<td></td>
<td>51</td>
<td>123 x 123</td>
<td></td>
<td>79</td>
<td>179 x 179</td>
</tr>
<tr>
<td>24</td>
<td>69 x 69</td>
<td></td>
<td>52</td>
<td>125 x 125</td>
<td></td>
<td>80</td>
<td>181 x 181</td>
</tr>
<tr>
<td>25</td>
<td>71 x 71</td>
<td></td>
<td>53</td>
<td>127 x 127</td>
<td></td>
<td>81</td>
<td>183 x 183</td>
</tr>
<tr>
<td>26</td>
<td>73 x 73</td>
<td></td>
<td>54</td>
<td>129 x 129</td>
<td></td>
<td>82</td>
<td>185 x 185</td>
</tr>
<tr>
<td>27</td>
<td>75 x 75</td>
<td></td>
<td>55</td>
<td>131 x 131</td>
<td></td>
<td>83</td>
<td>187 x 187</td>
</tr>
<tr>
<td>28</td>
<td>77 x 77</td>
<td></td>
<td>56</td>
<td>133 x 133</td>
<td></td>
<td>84</td>
<td>189 x 189</td>
</tr>
</tbody>
</table>
</div>
<p>The largest version (84) can encode 7827 digits, 4350 ASCII
characters, up to 2175 Chinese characters, or 3261 bytes, making it the
most capacious of all the barcodes supported by Zint.</p>
<p>There are four levels of error correction capacity available for Han
Xin Code which can be set by using the <code>--secure</code> option (API
<code>option_1</code>) to a value from the following table.</p>
<div id="tbl:hanxin_eccs" class="tablenos">
<table id="tbl:hanxin_eccs" data-tag=": Han Xin Error Correction Modes">
<caption><span>Table : Han Xin Error Correction Modes</span> </caption>
<thead>
<tr>
<th>Mode</th>
<th>Recovery Capacity</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Approx 8%</td>
</tr>
<tr>
<td>2</td>
<td>Approx 15%</td>
</tr>
<tr>
<td>3</td>
<td>Approx 23%</td>
</tr>
<tr>
<td>4</td>
<td>Approx 30%</td>
</tr>
</tbody>
</table>
</div>
<p>Non-ASCII data density may be maximized by using the
<code>--fullmultibyte</code> switch (API
<code>option_3 = ZINT_FULL_MULTIBYTE</code>), but check that your
barcode reader supports this before using.</p>
<p>Han Xin has four different masks designed to minimize unwanted
patterns. The best mask to use is selected automatically by Zint but may
be manually specified by using the <code>--mask</code> switch with
values 0-3, or in the API by setting
<code>option_3 = (N + 1) &lt;&lt; 8</code> where N is 0-3. To use with
<code>ZINT_FULL_MULTIBYTE</code> set</p>
<div class="sourceCode" id="cb118"><pre
class="sourceCode c"><code class="sourceCode c"><span id="cb118-1"><a href="#cb118-1" aria-hidden="true" tabindex="-1"></a>option_3 <span class="op">=</span> ZINT_FULL_MULTIBYTE <span class="op">|</span> <span class="op">(</span>N <span class="op">+</span> <span class="dv">1</span><span class="op">)</span> <span class="op">&lt;&lt;</span> <span class="dv">8</span></span></code></pre></div>
<h3 id="ultracode">6.6.14 Ultracode</h3>
<figure>
<img src="images/ultra.svg" title="fig:" class="ultra"
alt="zint -b ULTRA -d &quot;HEIMASÍÐA KENNARAHÁSKÓLA ÍSLANDS&quot;" />
<figcaption
aria-hidden="true"><code>zint -b ULTRA -d "HEIMASÍÐA KENNARAHÁSKÓLA ÍSLANDS"</code></figcaption>
</figure>
<p>This symbology uses a grid of coloured elements to encode data. ECI
and GS1 modes are supported. The amount of error correction can be set
using the <code>--secure</code> option (API <code>option_1</code>) to a
value as shown in the following table.</p>
<div id="tbl:ultra_eccs" class="tablenos">
<table id="tbl:ultra_eccs"
data-tag=": Ultracode Error Correction Values">
<caption><span>Table : Ultracode Error Correction Values</span>
</caption>
<thead>
<tr>
<th>Value</th>
<th>EC Level</th>
<th>Amount of symbol holding error correction data</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>EC0</td>
<td>0% - Error detection only</td>
</tr>
<tr>
<td>2</td>
<td>EC1</td>
<td>Approx 5%</td>
</tr>
<tr>
<td>3</td>
<td>EC2</td>
<td>Approx 9% - Default value</td>
</tr>
<tr>
<td>4</td>
<td>EC3</td>
<td>Approx 17%</td>
</tr>
<tr>
<td>5</td>
<td>EC4</td>
<td>Approx 25%</td>
</tr>
<tr>
<td>6</td>
<td>EC5</td>
<td>Approx 33%</td>
</tr>
</tbody>
</table>
</div>
<p>Zint does not currently implement data compression by default, but
this can be initiated through the API by setting</p>
<div class="sourceCode" id="cb119"><pre
class="sourceCode c"><code class="sourceCode c"><span id="cb119-1"><a href="#cb119-1" aria-hidden="true" tabindex="-1"></a>symbol<span class="op">-&gt;</span>option_3 <span class="op">=</span> ULTRA_COMPRESSION<span class="op">;</span></span></code></pre></div>
<p>With compression, up to 504 digits, 375 alphanumerics or 252 bytes
can be encoded.</p>
<p>Revision 2 of Ultracode (2023) may be specified using
<code>--vers=2</code> (API <code>option_2 = 2</code>).</p>
<hr />
<p>WARNING: Revision 2 of Ultracode was finalized December 2023 and Zint
has not yet been updated to support it. Do not use.</p>
<hr />
<p>Ultracode supports Structured Append of up to 8 symbols and an
optional numeric ID (File Number), which can be set by using the
<code>--structapp</code> option (see <a href="#structured-append">4.17
Structured Append</a>) (API <code>structapp</code>). The ID ranges from
1 to 80088. If an ID is not given, no ID is encoded.</p>
<h2 id="other-barcode-like-markings">6.7 Other Barcode-Like
Markings</h2>
<h3 id="facing-identification-mark-fim">6.7.1 Facing Identification Mark
(FIM)</h3>
<figure>
<img src="images/fim.svg" title="fig:" class="trk"
alt="zint -b FIM --compliantheight -d &quot;C&quot;" />
<figcaption
aria-hidden="true"><code>zint -b FIM --compliantheight -d "C"</code></figcaption>
</figure>
<p>Used by the United States Postal Service (USPS), the FIM symbology is
used to assist automated mail processing. There are only 5 valid symbols
which can be generated using the characters A-E as shown in the table
below.</p>
<div id="tbl:fim_characters" class="tablenos">
<table id="tbl:fim_characters" data-tag=": Valid FIM Characters">
<caption><span>Table : Valid FIM Characters</span> </caption>
<thead>
<tr>
<th>Code Letter</th>
<th style="text-align: left;">Usage</th>
</tr>
</thead>
<tbody>
<tr>
<td>A</td>
<td style="text-align: left;">Used for courtesy reply mail and metered
reply mail with a</td>
</tr>
<tr>
<td></td>
<td style="text-align: left;">pre-printed POSTNET symbol.</td>
</tr>
<tr>
<td>B</td>
<td style="text-align: left;">Used for business reply mail without a
pre-printed zip code.</td>
</tr>
<tr>
<td>C</td>
<td style="text-align: left;">Used for business reply mail with a
pre-printed zip code.</td>
</tr>
<tr>
<td>D</td>
<td style="text-align: left;">Used for Information Based Indicia (IBI)
postage.</td>
</tr>
<tr>
<td>E</td>
<td style="text-align: left;">Used for customized mail with a USPS
Intelligent Mail barcode.</td>
</tr>
</tbody>
</table>
</div>
<h3 id="flattermarken">6.7.2 Flattermarken</h3>
<figure>
<img src="images/flat.svg" title="fig:" class="lin"
alt="zint -b FLAT -d &quot;1304056&quot;" />
<figcaption
aria-hidden="true"><code>zint -b FLAT -d "1304056"</code></figcaption>
</figure>
<p>Used for the recognition of page sequences in print-shops, the
Flattermarken is not a true barcode symbol and requires precise
knowledge of the position of the mark on the page. The Flattermarken
system can encode numeric data up to a maximum of 128 digits and does
not include a check digit.</p>
<h1 id="legal-and-version-information">7. Legal and Version
Information</h1>
<h2 id="license">7.1 License</h2>
<p>Zint, libzint and Zint Barcode Studio are Copyright © 2025 Robin
Stuart. All historical versions are distributed under the GNU General
Public License version 3 or later. Versions 2.5 and later are released
under a dual license: the encoding library is released under the BSD (3
clause) license whereas the GUI, Zint Barcode Studio, and the CLI are
released under the GNU General Public License version 3 or later.</p>
<p>Telepen is a trademark of SB Electronic Systems Ltd.</p>
<p>QR Code is a registered trademark of Denso Wave Incorporated.</p>
<p>Mailmark is a registered trademark of Royal Mail Group Ltd.</p>
<p>Microsoft, Windows and the Windows logo are either registered
trademarks or trademarks of Microsoft Corporation in the United States
and/or other countries.</p>
<p>Linux is the registered trademark of Linus Torvalds in the U.S. and
other countries.</p>
<p>Mac and macOS are trademarks of Apple Inc., registered in the U.S.
and other countries.</p>
<p>The Zint logo is derived from “SF Planetary Orbiter” font by
ShyFoundary.</p>
<p>Zint.org.uk website design and hosting provided by Robert
Elliott.</p>
<h2 id="patent-issues">7.2 Patent Issues</h2>
<p>All of the code in Zint is developed using information in the public
domain, usually freely available on the Internet. Some of the techniques
used may be subject to patents and other intellectual property
legislation. It is my belief that any patents involved in the technology
underlying symbologies utilised by Zint are ‘unadopted’, that is the
holder does not object to their methods being used.</p>
<p>Any methods patented or owned by third parties or trademarks or
registered trademarks used within Zint or in this document are and
remain the property of their respective owners and do not indicate
endorsement or affiliation with those owners, companies or
organisations.</p>
<h2 id="version-information">7.3 Version Information</h2>
<p>The current stable version of Zint is 2.15.0, released on 25th
February 2025.</p>
<p>See <code>"ChangeLog"</code> in the project root directory for
information on all releases.</p>
<h2 id="sources-of-information">7.4 Sources of Information</h2>
<p>Below is a list of some of the sources used in rough chronological
order:</p>
<ul>
<li>Nick Johnson’s Barcode Specifications</li>
<li>Bar Code 1 Specification Source Page</li>
<li>SB Electronic Systems Telepen website</li>
<li>Pharmacode specifications from Laetus</li>
<li>Morovia RM4SCC specification</li>
<li>Australia Post’s ‘A Guide to Printing the 4-State Barcode’ and
bcsample source code</li>
<li>Plessey algorithm from GNU-Barcode v0.98 by Leonid A. Broukhis</li>
<li>GS1 General Specifications v 8.0 Issue 2</li>
<li>PNG: The Definitive Guide and wpng source code by Greg Reolofs</li>
<li>PDF417 specification and pdf417 source code by Grand Zebu</li>
<li>Barcode Reference, TBarCode/X User Documentation and TBarCode/X
demonstration program from Tec-It</li>
<li>IEC16022 source code by Stefan Schmidt et al</li>
<li>United States Postal Service Specification USPS-B-3200</li>
<li>Adobe Systems Incorporated Encapsulated PostScript File Format
Specification</li>
<li>BSI Online Library</li>
<li>Libdmtx Data Matrix ECC200 decoding library</li>
</ul>
<h2 id="standards-compliance">7.5 Standards Compliance</h2>
<p>Zint was developed to provide compliance with the following British
and international standards:</p>
<h3 id="symbology-standards">7.5.1 Symbology Standards</h3>
<ul>
<li>ISO/IEC 24778:2024 Information technology - Automatic identification
and data capture techniques - Aztec Code bar code symbology
specification</li>
<li>SEMI T1-95 Specification for Back Surface Bar Code Marking of
Silicon Wafers (BC412) (1996)</li>
<li>ANSI/AIM BC12-1998 - Uniform Symbology Specification Channel
Code</li>
<li>BS EN 798:1996 Bar coding - Symbology specifications -
‘Codabar’</li>
<li>AIM Europe ISS-X-24 - Uniform Symbology Specification Codablock-F
(1995)</li>
<li>ISO/IEC 15417:2007 Information technology - Automatic identification
and data capture techniques - Code 128 bar code symbology
specification</li>
<li>BS EN 12323:2005 AIDC technologies - Symbology specifications - Code
16K</li>
<li>ISO/IEC 16388:2023 Information technology - Automatic identification
and data capture techniques - Code 39 bar code symbology
specification</li>
<li>ANSI/AIM BC6-2000 - Uniform Symbology Specification Code 49</li>
<li>ANSI/AIM BC5-1995 - Uniform Symbology Specification Code 93</li>
<li>AIM Uniform Symbology Specification Code One (1994)</li>
<li>ISO/IEC 16022:2024 Information technology - Automatic identification
and data capture techniques - Data Matrix bar code symbology
specification</li>
<li>ISO/IEC 21471:2020 Information technology - Automatic identification
and data capture techniques - Extended rectangular data matrix (DMRE)
bar code symbology specification</li>
<li>AIM TSC1705001 (v 4.0 Draft 0.15) - Information technology -
Automatic identification and data capture techniques - Bar code
symbology specification - DotCode (Revised 28th May 2019)</li>
<li>ISO/IEC 15420:2009 Information technology - Automatic identification
and data capture techniques - EAN/UPC bar code symbology
specification</li>
<li>AIMD014 (v 1.63) - Information technology, Automatic identification
and data capture techniques - Bar code symbology specification - Grid
Matrix (Released 9th Dec 2008)</li>
<li>ISO/IEC 24723:2010 Information technology - Automatic identification
and data capture techniques - GS1 Composite bar code symbology
specification</li>
<li>ISO/IEC 24724:2011 Information technology - Automatic identification
and data capture techniques - GS1 DataBar bar code symbology
specification</li>
<li>ISO/IEC 20830:2021 Information technology - Automatic identification
and data capture techniques - Han Xin Code bar code symbology
specification</li>
<li>ISO/IEC 16390:2007 Information technology - Automatic identification
and data capture techniques - Interleaved 2 of 5 bar code symbology
specification</li>
<li>ISO/IEC 16023:2000 Information technology - International symbology
specification - MaxiCode</li>
<li>ISO/IEC 24728:2006 Information technology - Automatic identification
and data capture techniques - MicroPDF417 bar code symbology
specification</li>
<li>ISO/IEC 15438:2015 Information technology - Automatic identification
and data capture techniques - PDF417 bar code symbology
specification</li>
<li>ISO/IEC 18004:2024 Information technology - Automatic identification
and data capture techniques - QR Code bar code symbology
specification</li>
<li>ISO/IEC 23941:2022 Information technology - Automatic identification
and data capture techniques - Rectangular Micro QR Code (rMQR) bar code
symbology specification</li>
<li>AIMD/TSC15032-43 (v 0.99c) - International Technical Specification -
Ultracode Symbology (Draft) (Released 4th Nov 2015)</li>
</ul>
<p>A number of other specification documents have also been referenced,
such as MIL-STD-1189 Rev. B (1989) (LOGMARS), USPS DMM 300 2006 (2011)
(POSTNET, PLANET, FIM) and USPS-B-3200 (2015) (IMAIL). Those not named
include postal and delivery company references in particular.</p>
<h3 id="general-standards">7.5.2 General Standards</h3>
<ul>
<li>AIM ITS/04-001 International Technical Standard - Extended Channel
Interpretations Part 1: Identification Schemes and Protocol (Released
24th May 2004)</li>
<li>AIM ITS/04-023 International Technical Standard - Extended Channel
Interpretations Part 3: Register (Version 2, February 2022)</li>
<li>GS1 General Specifications Release 25.0 (Jan 2025)</li>
<li>ANSI/HIBC 2.6-2016 - The Health Industry Bar Code (HIBC) Supplier
Labeling Standard</li>
</ul>
<h1 id="annex-a.-character-encoding">Annex A. Character Encoding</h1>
<p>This section is intended as a quick reference to the character sets
used by Zint. All symbologies use standard ASCII input as shown in
section A.1, but some support extended characters as shown in the
subsequent section <a href="#a.2-latin-alphabet-no.-1-isoiec-8859-1">A.2
Latin Alphabet No. 1 (ISO/IEC 8859-1)</a>.</p>
<h2 id="a.1-ascii-standard">A.1 ASCII Standard</h2>
<p>The ubiquitous ASCII standard is well known to most computer users.
It’s reproduced here for reference.</p>
<div id="tbl:ascii" class="tablenos">
<table id="tbl:ascii" data-tag=": ASCII">
<caption><span>Table : ASCII</span> </caption>
<thead>
<tr>
<th>Hex</th>
<th style="text-align: left;">0</th>
<th style="text-align: left;">1</th>
<th style="text-align: left;">2</th>
<th style="text-align: left;">3</th>
<th style="text-align: left;">4</th>
<th style="text-align: left;">5</th>
<th style="text-align: left;">6</th>
<th style="text-align: left;">7</th>
</tr>
</thead>
<tbody>
<tr>
<td>0</td>
<td style="text-align: left;"><code>NUL</code></td>
<td style="text-align: left;"><code>DLE</code></td>
<td style="text-align: left;"><code>SPACE</code></td>
<td style="text-align: left;"><code>0</code></td>
<td style="text-align: left;"><code>@</code></td>
<td style="text-align: left;"><code>P</code></td>
<td style="text-align: left;"><code>`</code></td>
<td style="text-align: left;"><code>p</code></td>
</tr>
<tr>
<td>1</td>
<td style="text-align: left;"><code>SOH</code></td>
<td style="text-align: left;"><code>DC1</code></td>
<td style="text-align: left;"><code>!</code></td>
<td style="text-align: left;"><code>1</code></td>
<td style="text-align: left;"><code>A</code></td>
<td style="text-align: left;"><code>Q</code></td>
<td style="text-align: left;"><code>a</code></td>
<td style="text-align: left;"><code>q</code></td>
</tr>
<tr>
<td>2</td>
<td style="text-align: left;"><code>STX</code></td>
<td style="text-align: left;"><code>DC2</code></td>
<td style="text-align: left;"><code>"</code></td>
<td style="text-align: left;"><code>2</code></td>
<td style="text-align: left;"><code>B</code></td>
<td style="text-align: left;"><code>R</code></td>
<td style="text-align: left;"><code>b</code></td>
<td style="text-align: left;"><code>r</code></td>
</tr>
<tr>
<td>3</td>
<td style="text-align: left;"><code>ETX</code></td>
<td style="text-align: left;"><code>DC3</code></td>
<td style="text-align: left;"><code>#</code></td>
<td style="text-align: left;"><code>3</code></td>
<td style="text-align: left;"><code>C</code></td>
<td style="text-align: left;"><code>S</code></td>
<td style="text-align: left;"><code>c</code></td>
<td style="text-align: left;"><code>s</code></td>
</tr>
<tr>
<td>4</td>
<td style="text-align: left;"><code>EOT</code></td>
<td style="text-align: left;"><code>DC4</code></td>
<td style="text-align: left;"><code>$</code></td>
<td style="text-align: left;"><code>4</code></td>
<td style="text-align: left;"><code>D</code></td>
<td style="text-align: left;"><code>T</code></td>
<td style="text-align: left;"><code>d</code></td>
<td style="text-align: left;"><code>t</code></td>
</tr>
<tr>
<td>5</td>
<td style="text-align: left;"><code>ENQ</code></td>
<td style="text-align: left;"><code>NAK</code></td>
<td style="text-align: left;"><code>%</code></td>
<td style="text-align: left;"><code>5</code></td>
<td style="text-align: left;"><code>E</code></td>
<td style="text-align: left;"><code>U</code></td>
<td style="text-align: left;"><code>e</code></td>
<td style="text-align: left;"><code>u</code></td>
</tr>
<tr>
<td>6</td>
<td style="text-align: left;"><code>ACK</code></td>
<td style="text-align: left;"><code>SYN</code></td>
<td style="text-align: left;"><code>&amp;</code></td>
<td style="text-align: left;"><code>6</code></td>
<td style="text-align: left;"><code>F</code></td>
<td style="text-align: left;"><code>V</code></td>
<td style="text-align: left;"><code>f</code></td>
<td style="text-align: left;"><code>v</code></td>
</tr>
<tr>
<td>7</td>
<td style="text-align: left;"><code>BEL</code></td>
<td style="text-align: left;"><code>ETB</code></td>
<td style="text-align: left;"><code>'</code></td>
<td style="text-align: left;"><code>7</code></td>
<td style="text-align: left;"><code>G</code></td>
<td style="text-align: left;"><code>W</code></td>
<td style="text-align: left;"><code>g</code></td>
<td style="text-align: left;"><code>w</code></td>
</tr>
<tr>
<td>8</td>
<td style="text-align: left;"><code>BS</code></td>
<td style="text-align: left;"><code>CAN</code></td>
<td style="text-align: left;"><code>(</code></td>
<td style="text-align: left;"><code>8</code></td>
<td style="text-align: left;"><code>H</code></td>
<td style="text-align: left;"><code>X</code></td>
<td style="text-align: left;"><code>h</code></td>
<td style="text-align: left;"><code>x</code></td>
</tr>
<tr>
<td>9</td>
<td style="text-align: left;"><code>TAB</code></td>
<td style="text-align: left;"><code>EM</code></td>
<td style="text-align: left;"><code>)</code></td>
<td style="text-align: left;"><code>9</code></td>
<td style="text-align: left;"><code>I</code></td>
<td style="text-align: left;"><code>Y</code></td>
<td style="text-align: left;"><code>i</code></td>
<td style="text-align: left;"><code>y</code></td>
</tr>
<tr>
<td>A</td>
<td style="text-align: left;"><code>LF</code></td>
<td style="text-align: left;"><code>SUB</code></td>
<td style="text-align: left;"><code>*</code></td>
<td style="text-align: left;"><code>:</code></td>
<td style="text-align: left;"><code>J</code></td>
<td style="text-align: left;"><code>Z</code></td>
<td style="text-align: left;"><code>j</code></td>
<td style="text-align: left;"><code>z</code></td>
</tr>
<tr>
<td>B</td>
<td style="text-align: left;"><code>VT</code></td>
<td style="text-align: left;"><code>ESC</code></td>
<td style="text-align: left;"><code>+</code></td>
<td style="text-align: left;"><code>;</code></td>
<td style="text-align: left;"><code>K</code></td>
<td style="text-align: left;"><code>[</code></td>
<td style="text-align: left;"><code>k</code></td>
<td style="text-align: left;"><code>{</code></td>
</tr>
<tr>
<td>C</td>
<td style="text-align: left;"><code>FF</code></td>
<td style="text-align: left;"><code>FS</code></td>
<td style="text-align: left;"><code>,</code></td>
<td style="text-align: left;"><code>&lt;</code></td>
<td style="text-align: left;"><code>L</code></td>
<td style="text-align: left;"><code>\</code></td>
<td style="text-align: left;"><code>l</code></td>
<td style="text-align: left;"><code>|</code></td>
</tr>
<tr>
<td>D</td>
<td style="text-align: left;"><code>CR</code></td>
<td style="text-align: left;"><code>GS</code></td>
<td style="text-align: left;"><code>-</code></td>
<td style="text-align: left;"><code>=</code></td>
<td style="text-align: left;"><code>M</code></td>
<td style="text-align: left;"><code>]</code></td>
<td style="text-align: left;"><code>m</code></td>
<td style="text-align: left;"><code>}</code></td>
</tr>
<tr>
<td>E</td>
<td style="text-align: left;"><code>SO</code></td>
<td style="text-align: left;"><code>RS</code></td>
<td style="text-align: left;"><code>.</code></td>
<td style="text-align: left;"><code>&gt;</code></td>
<td style="text-align: left;"><code>N</code></td>
<td style="text-align: left;"><code>^</code></td>
<td style="text-align: left;"><code>n</code></td>
<td style="text-align: left;"><code>~</code></td>
</tr>
<tr>
<td>F</td>
<td style="text-align: left;"><code>SI</code></td>
<td style="text-align: left;"><code>US</code></td>
<td style="text-align: left;"><code>/</code></td>
<td style="text-align: left;"><code>?</code></td>
<td style="text-align: left;"><code>O</code></td>
<td style="text-align: left;"><code>_</code></td>
<td style="text-align: left;"><code>o</code></td>
<td style="text-align: left;"><code>DEL</code></td>
</tr>
</tbody>
</table>
</div>
<h2 id="a.2-latin-alphabet-no.-1-isoiec-8859-1">A.2 Latin Alphabet No. 1
(ISO/IEC 8859-1)</h2>
<p>ISO/IEC 8859-1 defines additional characters common in western
European languages like French, German, Italian and Spanish. This
extension is the default encoding of many barcodes (see Table <a
href="#tbl:default_character_sets">: Default Character Sets</a>) when a
codepoint above hex 9F is encoded. Note that codepoints hex 80 to 9F are
not defined.</p>
<div id="tbl:iso_iec_8869_1" class="tablenos">
<table id="tbl:iso_iec_8869_1" data-tag=": ISO/IEC 8859-1">
<caption><span>Table : ISO/IEC 8859-1</span> </caption>
<thead>
<tr>
<th>Hex</th>
<th style="text-align: left;">8</th>
<th style="text-align: left;">9</th>
<th style="text-align: left;">A</th>
<th style="text-align: left;">B</th>
<th style="text-align: left;">C</th>
<th style="text-align: left;">D</th>
<th style="text-align: left;">E</th>
<th style="text-align: left;">F</th>
</tr>
</thead>
<tbody>
<tr>
<td>0</td>
<td style="text-align: left;"></td>
<td style="text-align: left;"></td>
<td style="text-align: left;"><code>NBSP</code></td>
<td style="text-align: left;"><code>°</code></td>
<td style="text-align: left;"><code>À</code></td>
<td style="text-align: left;"><code>Ð</code></td>
<td style="text-align: left;"><code>à</code></td>
<td style="text-align: left;"><code>ð</code></td>
</tr>
<tr>
<td>1</td>
<td style="text-align: left;"></td>
<td style="text-align: left;"></td>
<td style="text-align: left;"><code>¡</code></td>
<td style="text-align: left;"><code>±</code></td>
<td style="text-align: left;"><code>Á</code></td>
<td style="text-align: left;"><code>Ñ</code></td>
<td style="text-align: left;"><code>á</code></td>
<td style="text-align: left;"><code>ñ</code></td>
</tr>
<tr>
<td>2</td>
<td style="text-align: left;"></td>
<td style="text-align: left;"></td>
<td style="text-align: left;"><code>¢</code></td>
<td style="text-align: left;"><code>²</code></td>
<td style="text-align: left;"><code>Â</code></td>
<td style="text-align: left;"><code>Ò</code></td>
<td style="text-align: left;"><code>â</code></td>
<td style="text-align: left;"><code>ò</code></td>
</tr>
<tr>
<td>3</td>
<td style="text-align: left;"></td>
<td style="text-align: left;"></td>
<td style="text-align: left;"><code>£</code></td>
<td style="text-align: left;"><code>³</code></td>
<td style="text-align: left;"><code>Ã</code></td>
<td style="text-align: left;"><code>Ó</code></td>
<td style="text-align: left;"><code>ã</code></td>
<td style="text-align: left;"><code>ó</code></td>
</tr>
<tr>
<td>4</td>
<td style="text-align: left;"></td>
<td style="text-align: left;"></td>
<td style="text-align: left;"><code>¤</code></td>
<td style="text-align: left;"><code>´</code></td>
<td style="text-align: left;"><code>Ä</code></td>
<td style="text-align: left;"><code>Ô</code></td>
<td style="text-align: left;"><code>ä</code></td>
<td style="text-align: left;"><code>ô</code></td>
</tr>
<tr>
<td>5</td>
<td style="text-align: left;"></td>
<td style="text-align: left;"></td>
<td style="text-align: left;"><code>¥</code></td>
<td style="text-align: left;"><code>μ</code></td>
<td style="text-align: left;"><code>Å</code></td>
<td style="text-align: left;"><code>Õ</code></td>
<td style="text-align: left;"><code>å</code></td>
<td style="text-align: left;"><code>õ</code></td>
</tr>
<tr>
<td>6</td>
<td style="text-align: left;"></td>
<td style="text-align: left;"></td>
<td style="text-align: left;"><code>¦</code></td>
<td style="text-align: left;"><code>¶</code></td>
<td style="text-align: left;"><code>Æ</code></td>
<td style="text-align: left;"><code>Ö</code></td>
<td style="text-align: left;"><code>æ</code></td>
<td style="text-align: left;"><code>ö</code></td>
</tr>
<tr>
<td>7</td>
<td style="text-align: left;"></td>
<td style="text-align: left;"></td>
<td style="text-align: left;"><code>§</code></td>
<td style="text-align: left;"><code>·</code></td>
<td style="text-align: left;"><code>Ç</code></td>
<td style="text-align: left;"><code>×</code></td>
<td style="text-align: left;"><code>ç</code></td>
<td style="text-align: left;"><code>÷</code></td>
</tr>
<tr>
<td>8</td>
<td style="text-align: left;"></td>
<td style="text-align: left;"></td>
<td style="text-align: left;"><code>¨</code></td>
<td style="text-align: left;"><code>¸</code></td>
<td style="text-align: left;"><code>È</code></td>
<td style="text-align: left;"><code>Ø</code></td>
<td style="text-align: left;"><code>è</code></td>
<td style="text-align: left;"><code>ø</code></td>
</tr>
<tr>
<td>9</td>
<td style="text-align: left;"></td>
<td style="text-align: left;"></td>
<td style="text-align: left;"><code>©</code></td>
<td style="text-align: left;"><code>¹</code></td>
<td style="text-align: left;"><code>É</code></td>
<td style="text-align: left;"><code>Ù</code></td>
<td style="text-align: left;"><code>é</code></td>
<td style="text-align: left;"><code>ù</code></td>
</tr>
<tr>
<td>A</td>
<td style="text-align: left;"></td>
<td style="text-align: left;"></td>
<td style="text-align: left;"><code>ª</code></td>
<td style="text-align: left;"><code>º</code></td>
<td style="text-align: left;"><code>Ê</code></td>
<td style="text-align: left;"><code>Ú</code></td>
<td style="text-align: left;"><code>ê</code></td>
<td style="text-align: left;"><code>ú</code></td>
</tr>
<tr>
<td>B</td>
<td style="text-align: left;"></td>
<td style="text-align: left;"></td>
<td style="text-align: left;"><code>«</code></td>
<td style="text-align: left;"><code>»</code></td>
<td style="text-align: left;"><code>Ë</code></td>
<td style="text-align: left;"><code>Û</code></td>
<td style="text-align: left;"><code>ë</code></td>
<td style="text-align: left;"><code>û</code></td>
</tr>
<tr>
<td>C</td>
<td style="text-align: left;"></td>
<td style="text-align: left;"></td>
<td style="text-align: left;"><code>¬</code></td>
<td style="text-align: left;"><code>¼</code></td>
<td style="text-align: left;"><code>Ì</code></td>
<td style="text-align: left;"><code>Ü</code></td>
<td style="text-align: left;"><code>ì</code></td>
<td style="text-align: left;"><code>ü</code></td>
</tr>
<tr>
<td>D</td>
<td style="text-align: left;"></td>
<td style="text-align: left;"></td>
<td style="text-align: left;"><code>SHY</code></td>
<td style="text-align: left;"><code>½</code></td>
<td style="text-align: left;"><code>Í</code></td>
<td style="text-align: left;"><code>Ý</code></td>
<td style="text-align: left;"><code>í</code></td>
<td style="text-align: left;"><code>ý</code></td>
</tr>
<tr>
<td>E</td>
<td style="text-align: left;"></td>
<td style="text-align: left;"></td>
<td style="text-align: left;"><code>®</code></td>
<td style="text-align: left;"><code>¾</code></td>
<td style="text-align: left;"><code>Î</code></td>
<td style="text-align: left;"><code>Þ</code></td>
<td style="text-align: left;"><code>î</code></td>
<td style="text-align: left;"><code>þ</code></td>
</tr>
<tr>
<td>F</td>
<td style="text-align: left;"></td>
<td style="text-align: left;"></td>
<td style="text-align: left;"><code>¯</code></td>
<td style="text-align: left;"><code>¿</code></td>
<td style="text-align: left;"><code>Ï</code></td>
<td style="text-align: left;"><code>ß</code></td>
<td style="text-align: left;"><code>ï</code></td>
<td style="text-align: left;"><code>ÿ</code></td>
</tr>
</tbody>
</table>
</div>
<h1 id="annex-b.-qt-backend-qzint">Annex B. Qt Backend QZint</h1>
<p>Used internally by Zint Barcode Studio to display the preview, the Qt
Backend <code>QZint</code> renders a barcode by drawing the vector
representation (see <a href="#buffering-symbols-in-memory-vector">5.5
Buffering Symbols in Memory (vector)</a>) provided by the Zint library
<code>libzint</code>.</p>
<p>The main class is <code>Zint::QZint</code>, which has getter/setter
properties that correspond to the <code>zint_symbol</code> structure
(see <a href="#setting-options">5.7 Setting Options</a>), and a main
method <code>render()</code> which takes a Qt <code>QPainter</code> to
paint with, and a <code>QRectF</code> rectangular area specifying where
to paint into:</p>
<div class="sourceCode" id="cb120"><pre
class="sourceCode cpp"><code class="sourceCode cpp"><span id="cb120-1"><a href="#cb120-1" aria-hidden="true" tabindex="-1"></a><span class="co">/* Encode and display barcode in `paintRect` using `painter`.</span></span>
<span id="cb120-2"><a href="#cb120-2" aria-hidden="true" tabindex="-1"></a><span class="co">   Note: legacy argument `mode` is not used */</span></span>
<span id="cb120-3"><a href="#cb120-3" aria-hidden="true" tabindex="-1"></a><span class="dt">void</span> render<span class="op">(</span><span class="ex">QPainter</span><span class="op">&amp;</span> painter<span class="op">,</span> <span class="at">const</span> <span class="ex">QRectF</span><span class="op">&amp;</span> paintRect<span class="op">,</span></span>
<span id="cb120-4"><a href="#cb120-4" aria-hidden="true" tabindex="-1"></a>            AspectRatioMode mode <span class="op">=</span> IgnoreAspectRatio<span class="op">);</span></span></code></pre></div>
<p><code>render()</code> will emit one of two Qt signals -
<code>encoded</code> on successful encoding and drawing, or
<code>errored</code> on failure. The client can connect and act
appropriately, for instance:</p>
<div class="sourceCode" id="cb121"><pre
class="sourceCode cpp"><code class="sourceCode cpp"><span id="cb121-1"><a href="#cb121-1" aria-hidden="true" tabindex="-1"></a><span class="fu">connect</span><span class="op">(</span>qzint<span class="op">,</span> <span class="ex">SIGNAL</span><span class="op">(</span>encoded<span class="op">()),</span> <span class="ex">SLOT</span><span class="op">(</span>on_encoded<span class="op">()));</span></span>
<span id="cb121-2"><a href="#cb121-2" aria-hidden="true" tabindex="-1"></a><span class="fu">connect</span><span class="op">(</span>qzint<span class="op">,</span> <span class="ex">SIGNAL</span><span class="op">(</span>errored<span class="op">()),</span> <span class="ex">SLOT</span><span class="op">(</span>on_errored<span class="op">()));</span></span></code></pre></div>
<p>where <code>qzint</code> is an instance of <code>Zint::QZint</code>
and <code>on_encoded()</code> and <code>on_error()</code> are Qt slot
methods provided by the caller. On error, the error value and message
can be retrieved by the methods <code>getError()</code> and
<code>lastError()</code> respectively.</p>
<p>The other main method is <code>save_to_file()</code>:</p>
<div class="sourceCode" id="cb122"><pre
class="sourceCode cpp"><code class="sourceCode cpp"><span id="cb122-1"><a href="#cb122-1" aria-hidden="true" tabindex="-1"></a><span class="co">/* Encode and print barcode to file `filename`.</span></span>
<span id="cb122-2"><a href="#cb122-2" aria-hidden="true" tabindex="-1"></a><span class="co">   Only sets `getError()` on error, not on warning */</span></span>
<span id="cb122-3"><a href="#cb122-3" aria-hidden="true" tabindex="-1"></a><span class="dt">bool</span> save_to_file<span class="op">(</span><span class="at">const</span> <span class="ex">QString</span><span class="op">&amp;</span> filename<span class="op">);</span> <span class="co">// `ZBarcode_Print()`</span></span></code></pre></div>
<p>which takes a <code>filename</code> to output to. It too will emit an
<code>errored</code> signal on failure, returning <code>false</code>
(but nothing on success, which just returns <code>true</code>). Note
that rotation is achieved through the setter method
<code>setRotateAngleValue()</code> (as opposed to the
<code>rotate_angle</code> argument used by
<code>ZBarcode_Print()</code>).</p>
<p>Various other methods are available, for instance methods for testing
symbology capabilities, and utility methods such as
<code>defaultXdim()</code> and <code>getAsCLI()</code>.</p>
<p>For full details, see <code>"backend_qt/qzint.h"</code>.</p>
<h1 id="annex-c.-tcl-backend-binding">Annex C. Tcl Backend Binding</h1>
<p>A Tcl binding is available in the <code>"backend_tcl</code>”
sub-directory. To make on Unix:</p>
<div class="sourceCode" id="cb123"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb123-1"><a href="#cb123-1" aria-hidden="true" tabindex="-1"></a><span class="bu">cd</span> backend_tcl</span>
<span id="cb123-2"><a href="#cb123-2" aria-hidden="true" tabindex="-1"></a><span class="fu">autoconf</span></span>
<span id="cb123-3"><a href="#cb123-3" aria-hidden="true" tabindex="-1"></a><span class="ex">./configure</span></span>
<span id="cb123-4"><a href="#cb123-4" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></span>
<span id="cb123-5"><a href="#cb123-5" aria-hidden="true" tabindex="-1"></a><span class="fu">sudo</span> make install</span></code></pre></div>
<p>For Windows, a Microsoft Visual C++ project file is available at
<code>"backend_tcl\zint_tcl.vcxproj"</code>. Note that this assumes that
Tcl/Tk is available in <code>"C:\Tcl"</code> and that the libraries are
named <code>"tclstub.lib"</code> and <code>"tkstub.lib"</code> - change
to match your setup. There is also a Visual Studio makefile available at
<code>"backend_tcl\win\makefile.vc"</code>, which can be run with
<code>nmake</code> - for details see
<code>"backend_tcl\win\README.txt"</code>.</p>
<p>Once built and installed, invoke the Tcl/Tk CLI
<code>"wish"</code>:</p>
<div class="sourceCode" id="cb124"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb124-1"><a href="#cb124-1" aria-hidden="true" tabindex="-1"></a><span class="ex">wish</span></span></code></pre></div>
<p>and ignoring the Tk window click back to the command prompt
<code>"%"</code> and type:</p>
<div class="sourceCode" id="cb125"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb125-1"><a href="#cb125-1" aria-hidden="true" tabindex="-1"></a><span class="ex">package</span> require zint</span>
<span id="cb125-2"><a href="#cb125-2" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> help</span></code></pre></div>
<p>which will show the usage message, with options very similiar to the
Zint CLI. (One notable difference is that boolean options such as
<code>-bold</code> take a <code>1</code> or <code>0</code> as an
argument.)</p>
<p>A demonstration Tcl/Tk program which is also useful in itself is
available at <code>"backend_tcl/demo/demo.tcl"</code>. To run type:</p>
<div class="sourceCode" id="cb126"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb126-1"><a href="#cb126-1" aria-hidden="true" tabindex="-1"></a><span class="ex">wish</span> demo/demo.tcl</span></code></pre></div>
<p>which will display the following window.</p>
<figure>
<img src="images/tcl_demo.png" title="fig:" class="pop"
alt="Tcl/Tk demonstration program window" />
<figcaption aria-hidden="true">Tcl/Tk demonstration program
window</figcaption>
</figure>
<p>You can select the symbology, enter the data to encode, and set
options (which are the same as those given in the usage message). A
raster preview of the configured barcode is displayed once the
<code>"Generate"</code> button is pressed.</p>
<h1 id="annex-d.-man-page-zint1">Annex D. Man Page ZINT(1)</h1>

<h2 id="name">NAME</h2>
<p><code>zint</code> - encode data as a barcode image</p>
<h2 id="synopsis">SYNOPSIS</h2>
<div class="line-block"><code>zint</code> [<code>-h</code> |
<code>--help</code>]<br />
<code>zint</code> [<em>options</em>]</div>
<h2 id="description">DESCRIPTION</h2>
<p>zint takes input data from the command line or a file to encode in a
barcode which is then output to an image file.</p>
<p>Input data is UTF-8, unless <code>--binary</code> is specified.</p>
<p>Human Readable Text (HRT) is displayed by default for those barcodes
that support HRT, unless <code>--notext</code> is specified.</p>
<p>The output image file (specified with <code>-o</code> |
<code>--output</code>) may be in one of these formats: Windows Bitmap
(<code>BMP</code>), Enhanced Metafile Format (<code>EMF</code>),
Encapsulated PostScript (<code>EPS</code>), Graphics Interchange Format
(<code>GIF</code>), ZSoft Paintbrush (<code>PCX</code>), Portable
Network Format (<code>PNG</code>), Scalable Vector Graphic
(<code>SVG</code>), or Tagged Image File Format (<code>TIF</code>).</p>
<h2 id="options">OPTIONS</h2>
<dl>
<dt><code>-h</code>, <code>--help</code></dt>
<dd>
<p>Print usage information summarizing command line options.</p>
</dd>
<dt><code>-b TYPE</code>, <code>--barcode=TYPE</code></dt>
<dd>
<p>Set the barcode symbology that will be used to encode the data.
<em>TYPE</em> is the number or name of the barcode symbology. If not
given, the symbology defaults to 20 (Code 128). To see what types are
available, use the <code>-t</code> | <code>--types</code> option. Type
names are case-insensitive, and non-alphanumerics are ignored.</p>
</dd>
<dt><code>--addongap=INTEGER</code></dt>
<dd>
<p>For EAN/UPC symbologies, set the gap between the main data and the
add-on. <em>INTEGER</em> is in integral multiples of the X-dimension.
The maximum gap that can be set is 12. The minimum is 7, except for
UPC-A, when the minimum is 9.</p>
</dd>
<dt><code>--batch</code></dt>
<dd>
<p>Treat each line of an input file specified with <code>-i</code> |
<code>--input</code> as a separate data set and produce a barcode image
for each one. The barcode images are outputted by default to numbered
filenames starting with “00001.png”, “00002.png” etc., which can be
changed by using the <code>-o</code> | <code>--output</code> option.</p>
</dd>
<dt><code>--bg=COLOUR</code></dt>
<dd>
<p>Specify a background (paper) colour where <em>COLOUR</em> is in
hexadecimal <code>RRGGBB</code> or <code>RRGGBBAA</code> format or in
decimal <code>C,M,Y,K</code> percentages format.</p>
</dd>
<dt><code>--binary</code></dt>
<dd>
<p>Treat input data as raw 8-bit binary data instead of the default
UTF-8. Automatic code page translation to an ECI page is disabled, and
no validation of the data’s character encoding takes place.</p>
</dd>
<dt><code>--bind</code></dt>
<dd>
<p>Add horizontal boundary bars (also known as bearer bars) to the
symbol. The width of the boundary bars is specified by the
<code>--border</code> option. <code>--bind</code> can also be used to
add row separator bars to symbols stacked with multiple <code>-d</code>
| <code>--data</code> inputs, in which case the width of the separator
bars is specified with the <code>--separator</code> option.</p>
</dd>
<dt><code>--bindtop</code></dt>
<dd>
<p>Add a horizontal boundary bar to the top of the symbol. The width of
the boundary bar is specified by the <code>--border</code> option.</p>
</dd>
<dt><code>--bold</code></dt>
<dd>
<p>Use a bold font for the Human Readable Text (HRT).</p>
</dd>
<dt><code>--border=INTEGER</code></dt>
<dd>
<p>Set the width of boundary bars (<code>--bind</code> or
<code>--bindtop</code>) or box borders (<code>--box</code>), where
<em>INTEGER</em> is in integral multiples of the X-dimension. The
default is zero.</p>
</dd>
<dt><code>--box</code></dt>
<dd>
<p>Add a box around the symbol. The width of the borders is specified by
the <code>--border</code> option.</p>
</dd>
<dt><code>--cmyk</code></dt>
<dd>
<p>Use the CMYK colour space when outputting to Encapsulated PostScript
(EPS) or TIF files.</p>
</dd>
<dt><code>--cols=INTEGER</code></dt>
<dd>
<p>Set the number of data columns in the symbol to <em>INTEGER</em>.
Affects Codablock-F, DotCode, GS1 DataBar Expanded Stacked
(DBAR_EXPSTK), MicroPDF417 and PDF417 symbols.</p>
</dd>
<dt><code>--compliantheight</code></dt>
<dd>
<p>Warn if the height specified by the <code>--height</code> option is
not compliant with the barcode’s specification, or if
<code>--height</code> is not given, default to the height specified by
the specification (if any).</p>
</dd>
<dt><code>-d</code>, <code>--data=DATA</code></dt>
<dd>
<p>Specify the input <em>DATA</em> to encode. The <code>--esc</code>
option may be used to enter non-printing characters using escape
sequences. The <em>DATA</em> should be UTF-8, unless the
<code>--binary</code> option is given, in which case it can be
anything.</p>
</dd>
<dt><code>--direct</code></dt>
<dd>
<p>Send output to stdout, which in most cases should be re-directed to a
pipe or a file. Use <code>--filetype</code> to specify output
format.</p>
</dd>
<dt><code>--dmiso144</code></dt>
<dd>
<p>For Data Matrix symbols, use the standard ISO/IEC codeword placement
for 144 x 144 (<code>--vers=24</code>) sized symbols, instead of the
default “de facto” placement (which rotates the placement of ECC
codewords).</p>
</dd>
<dt><code>--dmre</code></dt>
<dd>
<p>For Data Matrix symbols, allow Data Matrix Rectangular Extended
(DMRE) sizes when considering automatic sizes. See also
<code>--square</code>.</p>
</dd>
<dt><code>--dotsize=NUMBER</code></dt>
<dd>
<p>Set the radius of the dots in dotty mode (<code>--dotty</code>).
<em>NUMBER</em> is in X-dimensions, and may be floating-point. The
default is 0.8.</p>
</dd>
<dt><code>--dotty</code></dt>
<dd>
<p>Use dots instead of squares for matrix symbols. DotCode is always in
dotty mode.</p>
</dd>
<dt><code>--dump</code></dt>
<dd>
<p>Dump a hexadecimal representation of the symbol’s encodation to
stdout. The same representation may be outputted to a file by using a
<code>.txt</code> extension with <code>-o</code> | <code>--output</code>
or by specifying <code>--filetype=txt</code>.</p>
</dd>
<dt><code>-e</code>, <code>--ecinos</code></dt>
<dd>
<p>Display the table of ECIs (Extended Channel Interpretations).</p>
</dd>
<dt><code>--eci=INTEGER</code></dt>
<dd>
<p>Set the ECI code for the input data to <em>INTEGER</em>. See
<code>-e</code> | <code>--ecinos</code> for a list of the ECIs
available. ECIs are supported by Aztec Code, Code One, Data Matrix,
DotCode, Grid Matrix, Han Xin Code, MaxiCode, MicroPDF417, PDF417, QR
Code, rMQR and Ultracode.</p>
</dd>
<dt><code>--embedfont</code></dt>
<dd>
<p>For vector output, embed the font in the file for portability.
Currently only available for SVG output.</p>
</dd>
<dt><code>--esc</code></dt>
<dd>
<p>Process escape characters in the input data. The escape sequences
are:</p>
<pre><code>\0       (0x00)    NUL  Null character
\E       (0x04)    EOT  End of Transmission
\a       (0x07)    BEL  Bell
\b       (0x08)    BS   Backspace
\t       (0x09)    HT   Horizontal Tab
\n       (0x0A)    LF   Line Feed
\v       (0x0B)    VT   Vertical Tab
\f       (0x0C)    FF   Form Feed
\r       (0x0D)    CR   Carriage Return
\e       (0x1B)    ESC  Escape
\G       (0x1D)    GS   Group Separator
\R       (0x1E)    RS   Record Separator
\\       (0x5C)    \    Backslash
\dNNN    (NNN)          Any 8-bit character where NNN is
                        decimal (000-255)
\oNNN    (0oNNN)        Any 8-bit character where NNN is
                        octal (000-377)
\xNN     (0xNN)         Any 8-bit character where NN is
                        hexadecimal (00-FF)
\uNNNN   (U+NNNN)       Any 16-bit Unicode BMP character
                        where NNNN is hexadecimal
\UNNNNNN (U+NNNNNN)     Any 21-bit Unicode character
                        where NNNNNN is hexadecimal</code></pre>
</dd>
<dt><code>--extraesc</code></dt>
<dd>
<p>For Code 128 only, as well as processing the normal escape sequences
above, process the special escape sequences <code>\^A</code>,
<code>\^B</code>, <code>\^C</code> and <code>\^@</code> that allow
manual switching of Code Sets, and the special escape sequence
<code>\^1</code> that inserts an <code>FNC1</code> character. The
sequence <code>\@</code> turns off manual switching. The sequence
<code>\^^</code> can be used to encode data that contains special escape
sequences.</p>
</dd>
<dt><code>--fast</code></dt>
<dd>
<p>Use faster if less optimal encodation or other shortcuts (affects
Data Matrix, MicroPDF417, PDF417, QRCODE &amp; UPNQR only).</p>
</dd>
<dt><code>--fg=COLOUR</code></dt>
<dd>
<p>Specify a foreground (ink) colour where <em>COLOUR</em> is in
hexadecimal <code>RRGGBB</code> or <code>RRGGBBAA</code> format or in
decimal <code>C,M,Y,K</code> percentages format.</p>
</dd>
<dt><code>--filetype=TYPE</code></dt>
<dd>
<p>Set the output file type to <em>TYPE</em>, which is one of
<code>BMP</code>, <code>EMF</code>, <code>EPS</code>, <code>GIF</code>,
<code>PCX</code>, <code>PNG</code>, <code>SVG</code>, <code>TIF</code>,
<code>TXT</code>.</p>
</dd>
<dt><code>--fullmultibyte</code></dt>
<dd>
<p>Use the multibyte modes of Grid Matrix, Han Xin and QR Code for
non-ASCII data.</p>
</dd>
<dt><code>--gs1</code></dt>
<dd>
<p>Treat input as GS1 compatible data. Application Identifiers (AIs)
should be placed in square brackets <code>"[]"</code> (but see
<code>--gs1parens</code>).</p>
</dd>
<dt><code>--gs1nocheck</code></dt>
<dd>
<p>Do not check the validity of GS1 data.</p>
</dd>
<dt><code>--gs1parens</code></dt>
<dd>
<p>Process parentheses <code>"()"</code> as GS1 AI delimiters, rather
than square brackets <code>"[]"</code>. The input data must not
otherwise contain parentheses.</p>
</dd>
<dt><code>--gssep</code></dt>
<dd>
<p>For Data Matrix in GS1 mode, use <code>GS</code> (0x1D) as the GS1
data separator instead of <code>FNC1</code>.</p>
</dd>
<dt><code>--guarddescent=NUMBER</code></dt>
<dd>
<p>For EAN/UPC symbols, set the height the guard bars descend below the
main bars, where <em>NUMBER</em> is in X-dimensions. <em>NUMBER</em> may
be floating-point.</p>
</dd>
<dt><code>--guardwhitespace</code></dt>
<dd>
<p>For EAN/UPC symbols, add quiet zone indicators <code>"&lt;"</code>
and/or <code>"&gt;"</code> to HRT where applicable.</p>
</dd>
<dt><code>--height=NUMBER</code></dt>
<dd>
<p>Set the height of the symbol in X-dimensions. <em>NUMBER</em> may be
floating-point.</p>
</dd>
<dt><code>--heightperrow</code></dt>
<dd>
<p>Treat height as per-row. Affects Codablock-F, Code 16K, Code 49, GS1
DataBar Expanded Stacked (DBAR_EXPSTK), MicroPDF417 and PDF417.</p>
</dd>
<dt><code>-i</code>, <code>--input=FILE</code></dt>
<dd>
<p>Read the input data from <em>FILE</em>. Specify a single hyphen
(<code>-</code>) for <em>FILE</em> to read from stdin.</p>
</dd>
<dt><code>--init</code></dt>
<dd>
<p>Create a Reader Initialisation (Programming) symbol.</p>
</dd>
<dt><code>--mask=INTEGER</code></dt>
<dd>
<p>Set the masking pattern to use for DotCode, Han Xin or QR Code to
<em>INTEGER</em>, overriding the automatic selection.</p>
</dd>
<dt><code>--mirror</code></dt>
<dd>
<p>Use the batch data to determine the filename in batch mode
(<code>--batch</code>). The <code>-o</code> | <code>--output</code>
option can be used to specify an output directory (any filename will be
ignored).</p>
</dd>
<dt><code>--mode=INTEGER</code></dt>
<dd>
<p>For MaxiCode and GS1 Composite symbols, set the encoding mode to
<em>INTEGER</em>.</p>
<p>For MaxiCode (SCM is Structured Carrier Message, with 3 fields:
postcode, 3-digit ISO 3166-1 country code, 3-digit service code):</p>
<pre><code>2   SCM with 9-digit numeric postcode
3   SCM with 6-character alphanumeric postcode
4   Enhanced ECC for the primary part of the message
5   Enhanced ECC for all of the message
6   Reader Initialisation (Programming)</code></pre>
<p>For GS1 Composite symbols (names end in <code>_CC</code>,
i.e. EANX_CC, GS1_128_CC, DBAR_OMN_CC etc.):</p>
<pre><code>1   CC-A
2   CC-B
3   CC-C (GS1_128_CC only)</code></pre>
</dd>
<dt><code>--nobackground</code></dt>
<dd>
<p>Remove the background colour (EMF, EPS, GIF, PNG, SVG and TIF
only).</p>
</dd>
<dt><code>--noquietzones</code></dt>
<dd>
<p>Disable any quiet zones for symbols that define them by default.</p>
</dd>
<dt><code>--notext</code></dt>
<dd>
<p>Remove the Human Readable Text (HRT).</p>
</dd>
<dt><code>-o</code>, <code>--output=FILE</code></dt>
<dd>
<p>Send the output to <em>FILE</em>. When not in batch mode, the default
is “out.png” (or “out.gif” if zint built without PNG support). When in
batch mode (<code>--batch</code>), special characters can be used to
format the output filenames:</p>
<pre><code>~           Insert a number or 0
#           Insert a number or space
@           Insert a number or * (+ on Windows)
Any other   Insert literally</code></pre>
</dd>
<dt><code>--primary=STRING</code></dt>
<dd>
<p>For MaxiCode, set the content of the primary message. For GS1
Composite symbols, set the content of the linear symbol.</p>
</dd>
<dt><code>--quietzones</code></dt>
<dd>
<p>Add compliant quiet zones for symbols that specify them. This is in
addition to any whitespace specified by <code>-w</code> |
<code>--whitesp</code> or <code>--vwhitesp</code>.</p>
</dd>
<dt><code>-r</code>, <code>--reverse</code></dt>
<dd>
<p>Reverse the foreground and background colours (white on black). Known
as “reflectance reversal” or “reversed reflectance”.</p>
</dd>
<dt><code>--rotate=INTEGER</code></dt>
<dd>
<p>Rotate the symbol by <em>INTEGER</em> degrees, where <em>INTEGER</em>
can be 0, 90, 270 or 360.</p>
</dd>
<dt><code>--rows=INTEGER</code></dt>
<dd>
<p>Set the number of rows for Codablock-F or PDF417 to <em>INTEGER</em>.
It will also set the minimum number of rows for Code 16K or Code 49, and
the maximum number of rows for GS1 DataBar Expanded Stacked
(DBAR_EXPSTK).</p>
</dd>
<dt><code>--scale=NUMBER</code></dt>
<dd>
<p>Adjust the size of the X-dimension. <em>NUMBER</em> may be
floating-point, and is multiplied by 2 (except for MaxiCode) before
being applied. The default scale is 1.</p>
<p>For MaxiCode, the scale is multiplied by 10 for raster output, by 40
for EMF output, and by 2 otherwise.</p>
<p>Increments of 0.5 (half-integers) are recommended for non-MaxiCode
raster output (BMP, GIF, PCX, PNG and TIF). Human Readable Text (HRT)
for raster output will not be shown for scales less than 1.</p>
<p>See also <code>--scalexdimdp</code> below.</p>
</dd>
<dt><code>--scalexdimdp=X[,R]</code></dt>
<dd>
<p>Scale the image according to X-dimension <em>X</em> and resolution
<em>R</em>, where <em>X</em> is in mm and <em>R</em> is in dpmm (dots
per mm). <em>X</em> and <em>R</em> may be floating-point. <em>R</em> is
optional and defaults to 12 dpmm (approximately 300 dpi). <em>X</em> may
be zero in which case a symbology-specific default is used.</p>
<p>The scaling takes into account the output filetype, and deals with
all the details mentioned above. Units may be specified for <em>X</em>
by appending “in” (inch) or “mm”, and for <em>R</em> by appending “dpi”
(dots per inch) or “dpmm” -
e.g. <code>--scalexdimdp=0.013in,300dpi</code>.</p>
</dd>
<dt><code>--scmvv=INTEGER</code></dt>
<dd>
<p>For MaxiCode, prefix the Structured Carrier Message (SCM) with
<code>"[)&gt;\R01\Gvv"</code>, where <code>vv</code> is a 2-digit
<em>INTEGER</em>.</p>
</dd>
<dt><code>--secure=INTEGER</code></dt>
<dd>
<p>Set the error correction level (ECC) to <em>INTEGER</em>. The meaning
is specific to the following matrix symbols (all except PDF417 are
approximate):</p>
<pre><code>Aztec Code  1 to 4 (10%, 23%, 36%, 50%)
Grid Matrix 1 to 5 (10% to 50%)
Han Xin     1 to 4 (8%, 15%, 23%, 30%)
Micro QR    1 to 3 (7%, 15%, 25%) (L, M, Q)
PDF417      0 to 8 (2^(INTEGER + 1) codewords)
QR Code     1 to 4 (7%, 15%, 25%, 30%) (L, M, Q, H)
rMQR        2 or 4 (15% or 30%) (M or H)
Ultracode   1 to 6 (0%, 5%, 9%, 17%, 25%, 33%)</code></pre>
</dd>
<dt><code>--segN=ECI,DATA</code></dt>
<dd>
<p>Set the <em>ECI</em> &amp; <em>DATA</em> content for segment N, where
N is 1 to 9. <code>-d</code> | <code>--data</code> must still be given,
and counts as segment 0, its ECI given by <code>--eci</code>. Segments
must be consecutive.</p>
</dd>
<dt><code>--separator=INTEGER</code></dt>
<dd>
<p>Set the height of row separator bars for stacked symbologies, where
<em>INTEGER</em> is in integral multiples of the X-dimension. The
default is zero.</p>
</dd>
<dt><code>--small</code></dt>
<dd>
<p>Use a smaller font for Human Readable Text (HRT).</p>
</dd>
<dt><code>--square</code></dt>
<dd>
<p>For Data Matrix symbols, exclude rectangular sizes when considering
automatic sizes. See also <code>--dmre</code>.</p>
</dd>
<dt><code>--structapp=I,C[,ID]</code></dt>
<dd>
<p>Set Structured Append info, where <em>I</em> is the 1-based index,
<em>C</em> is the total number of symbols in the sequence, and
<em>ID</em>, which is optional, is the identifier that all symbols in
the sequence share. Structured Append is supported by Aztec Code, Code
One, Data Matrix, DotCode, Grid Matrix, MaxiCode, MicroPDF417, PDF417,
QR Code and Ultracode.</p>
</dd>
<dt><code>-t</code>, <code>--types</code></dt>
<dd>
<p>Display the table of barcode types (symbologies). The numbers or
names can be used with <code>-b</code> | <code>--barcode</code>.</p>
</dd>
<dt><code>--textgap=NUMBER</code></dt>
<dd>
<p>Adjust the gap between the barcode and the Human Readable Text (HRT).
<em>NUMBER</em> is in X-dimensions, and may be floating-point. Maximum
is 10 and minimum is -5. The default is 1.</p>
</dd>
<dt><code>--vers=INTEGER</code></dt>
<dd>
<p>Set the symbol version (size, check digits, other options) to
<em>INTEGER</em>. The meaning is symbol-specific.</p>
<p>For most matrix symbols, it specifies size:</p>
<pre><code>Aztec Code      1 to 36 (1 to 4 compact)
        1   15x15     13  53x53     25  105x105
        2   19x19     14  57x57     26  109x109
        3   23x23     15  61x61     27  113x113
        4   27x27     16  67x67     28  117x117
        5   19x19     17  71x71     29  121x121
        6   23x23     18  75x75     30  125x125
        7   27x27     19  79x79     31  131x131
        8   31x31     20  83x83     32  135x135
        9   37x37     21  87x87     33  139x139
        10  41x41     22  91x91     34  143x143
        11  45x45     23  95x95     35  147x147
        12  49x49     24  101x101   36  151x151

Code One        1 to 10 (9 and 10 variable width) (HxW)
        1   16x18     6   70x76
        2   22x22     7   104x98
        3   28x32     8   148x134
        4   40x42     9   8xW
        5   52x54     10  16xW

Data Matrix     1 to 48 (31 to 48 DMRE) (HxW)
        1   10x10     17  72x72     33  8x80
        2   12x12     18  80x80     34  8x96
        3   14x14     19  88x88     35  8x120
        4   16x16     20  96x96     36  8x144
        5   18x18     21  104x104   37  12x64
        6   20x20     22  120x120   38  12x88
        7   22x22     23  132x132   39  16x64
        8   24x24     24  144x144   40  20x36
        9   26x26     25  8x18      41  20x44
        10  32x32     26  8x32      42  20x64
        11  36x36     28  12x26     43  22x48
        12  40x40     28  12x36     44  24x48
        13  44x44     29  16x36     45  24x64
        14  48x48     30  16x48     46  26x40
        15  52x52     31  8x48      47  26x48
        16  64x64     32  8x64      48  26x64

Grid Matrix     1 to 13
        1   18x18     6   78x78     11  138x138
        2   30x30     7   90x90     12  150x150
        3   42x42     8   102x102   13  162x162
        4   54x54     9   114x114
        5   66x66     10  126x126

Han Xin         1 to 84
        1   23x23     29  79x79     57  135x135
        2   25x25     30  81x81     58  137x137
        3   27x27     31  83x83     59  139x139
        4   29x29     32  85x85     60  141x141
        5   31x31     33  87x87     61  143x143
        6   33x33     34  89x89     62  145x145
        7   35x35     35  91x91     63  147x147
        8   37x37     36  93x93     64  149x149
        9   39x39     37  95x95     65  151x151
        10  41x41     38  97x97     66  153x153
        11  43x43     39  99x99     67  155x155
        12  45x45     40  101x101   68  157x157
        13  47x47     41  103x103   69  159x159
        14  49x49     42  105x105   70  161x161
        15  51x51     43  107x107   71  163x163
        16  53x53     44  109x109   72  165x165
        17  55x55     45  111x111   73  167x167
        18  57x57     46  113x113   74  169x169
        19  59x59     47  115x115   75  171x171
        20  61x61     48  117x117   76  173x173
        21  63x63     49  119x119   77  175x175
        22  65x65     50  121x121   78  177x177
        23  67x67     51  123x123   79  179x179
        24  69x69     52  125x125   80  181x181
        25  71x71     53  127x127   81  183x183
        26  73x73     54  129x129   82  185x185
        27  75x75     55  131x131   83  187x187
        28  77x77     56  133x133   84  189x189

Micro QR        1 to 4  (M1, M2, M3, M4)
        1   11x11     3   15x15
        2   13x13     4   17x17

QR Code         1 to 40
        1   21x21     15  77x77     29  133x133
        2   25x25     16  81x81     30  137x137
        3   29x29     17  85x85     31  141x141
        4   33x33     18  89x89     32  145x145
        5   37x37     19  93x93     33  149x149
        6   41x41     20  97x97     34  153x153
        7   45x45     21  101x101   35  157x157
        8   49x49     22  105x105   36  161x161
        9   53x53     23  109x109   37  165x165
        10  57x57     24  113x113   38  169x169
        11  61x61     25  117x117   39  173x173
        12  65x65     26  121x121   40  177x177
        13  69x69     27  125x125
        14  73x73     28  129x129

rMQR            1 to 38 (33 to 38 automatic width) (HxW)
        1   7x43      14  11x77     27  15x139
        2   7x59      15  11x99     28  17x43
        3   7x77      16  11x139    29  17x59
        4   7x99      17  13x27     30  17x77
        5   7x139     18  13x43     31  17x99
        6   9x43      19  13x59     32  17x139
        7   9x59      20  13x77     33  7xW
        8   9x77      21  13x99     34  9xW
        9   9x99      22  13x139    35  11xW
        10  9x139     23  15x43     36  13xW
        11  11x27     24  15x59     37  15xW
        12  11x43     25  15x77     38  17xW
        13  11x59     26  15x99</code></pre>
<p>For a number of linear symbols, it specifies check character options
(“hide” or “hidden” means don’t show in HRT, “visible” means do display
in HRT):</p>
<pre><code>C25IATA         1 or 2 (add visible or hidden check digit)
C25IND          ditto
C25INTER        ditto
C25LOGIC        ditto
C25STANDARD     ditto
Codabar         1 or 2 (add hidden or visible check digit)
Code 11         0 to 2 (2 visible check digits to none)
                0      (default 2 visible check digits)
                1      (1 visible check digit)
                2      (no check digits)
Code 39         1 or 2 (add visible or hidden check digit)
Code 93         1      (show the default check characters)
EXCODE39        1 or 2 (add visible or hidden check digit)
LOGMARS         1 or 2 (add visible or hidden check digit)
UK Plessey      1      (show the default check characters)
MSI Plessey     0 to 6 (none to various visible options)
                1, 2   (mod-10, mod-10 + mod-10)
                3, 4   (mod-11 IBM, mod-11 IBM + mod-10)
                5, 6   (mod-11 NCR, mod-11 NCR + mod-10)
                +10    (hide)</code></pre>
<p>For a few other symbologies, it specifies other characteristics:</p>
<pre><code>Channel Code    3 to 8    (no. of channels)
DAFT            50 to 900 (permille tracker ratio)
DPD             1         (relabel)
PZN             1         (PZN7 instead of default PZN8)
Ultracode       2         (revision 2)
VIN             1         (add international prefix)</code></pre>
</dd>
<dt><code>-v</code>, <code>--version</code></dt>
<dd>
<p>Display zint version.</p>
</dd>
<dt><code>--vwhitesp=INTEGER</code></dt>
<dd>
<p>Set the height of vertical whitespace above and below the barcode,
where <em>INTEGER</em> is in integral multiples of the X-dimension.</p>
</dd>
<dt><code>-w</code>, <code>--whitesp=INTEGER</code></dt>
<dd>
<p>Set the width of horizontal whitespace either side of the barcode,
where <em>INTEGER</em> is in integral multiples of the X-dimension.</p>
</dd>
<dt><code>--werror</code></dt>
<dd>
<p>Convert all warnings into errors.</p>
</dd>
</dl>
<h2 id="exit-status">EXIT STATUS</h2>
<dl>
<dt><code>0</code></dt>
<dd>
Success (including when given informational options <code>-h</code> |
<code>--help</code>, <code>-e</code> | <code>--ecinos</code>,
<code>-t</code> | <code>--types</code>, <code>-v</code> |
<code>--version</code>).
</dd>
<dt><code>-1</code></dt>
<dd>
Human Readable Text was outputted as raw text
(<code>ZINT_WARN_HRT_RAW_TEXT</code>)
</dd>
<dt><code>1</code></dt>
<dd>
Human Readable Text was truncated (maximum 199 bytes)
(<code>ZINT_WARN_HRT_TRUNCATED</code>)
</dd>
<dt><code>2</code></dt>
<dd>
Invalid option given but overridden by Zint
(<code>ZINT_WARN_INVALID_OPTION</code>)
</dd>
<dt><code>3</code></dt>
<dd>
Automatic ECI inserted by Zint (<code>ZINT_WARN_USES_ECI</code>)
</dd>
<dt><code>4</code></dt>
<dd>
Symbol created not compliant with standards
(<code>ZINT_WARN_NONCOMPLIANT</code>)
</dd>
<dt><code>5</code></dt>
<dd>
Input data wrong length (<code>ZINT_ERROR_TOO_LONG</code>)
</dd>
<dt><code>6</code></dt>
<dd>
Input data incorrect (<code>ZINT_ERROR_INVALID_DATA</code>)
</dd>
<dt><code>7</code></dt>
<dd>
Input check digit incorrect (<code>ZINT_ERROR_INVALID_CHECK</code>)
</dd>
<dt><code>8</code></dt>
<dd>
Incorrect option given (<code>ZINT_ERROR_INVALID_OPTION</code>)
</dd>
<dt><code>9</code></dt>
<dd>
Internal error (should not happen)
(<code>ZINT_ERROR_ENCODING_PROBLEM</code>)
</dd>
<dt><code>10</code></dt>
<dd>
Error opening output file (<code>ZINT_ERROR_FILE_ACCESS</code>)
</dd>
<dt><code>11</code></dt>
<dd>
Memory allocation (malloc) failure (<code>ZINT_ERROR_MEMORY</code>)
</dd>
<dt><code>12</code></dt>
<dd>
Error writing to output file (<code>ZINT_ERROR_FILE_WRITE</code>)
</dd>
<dt><code>13</code></dt>
<dd>
Error counterpart of warning if <code>--werror</code> given
(<code>ZINT_ERROR_USES_ECI</code>)
</dd>
<dt><code>14</code></dt>
<dd>
Error counterpart of warning if <code>--werror</code> given
(<code>ZINT_ERROR_NONCOMPLIANT</code>)
</dd>
<dt><code>15</code></dt>
<dd>
Error counterpart of warning if <code>--werror</code> given
(<code>ZINT_ERROR_HRT_TRUNCATED</code>)
</dd>
<dt><code>16</code></dt>
<dd>
Error counterpart of warning if <code>--werror</code> given
(<code>ZINT_ERROR_HRT_RAW_TEXT</code>)
</dd>
</dl>
<h2 id="examples">EXAMPLES</h2>
<p>Create “out.png” (or “out.gif” if zint built without PNG support) in
the current directory, as a Code 128 symbol.</p>
<div class="sourceCode" id="cb135"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb135-1"><a href="#cb135-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-d</span> <span class="st">&#39;This Text&#39;</span></span></code></pre></div>
<p>Create “qr.svg” in the current directory, as a QR Code symbol.</p>
<div class="sourceCode" id="cb136"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb136-1"><a href="#cb136-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> QRCode <span class="at">-d</span> <span class="st">&#39;This Text&#39;</span> <span class="at">-o</span> <span class="st">&#39;qr.svg&#39;</span></span></code></pre></div>
<p>Use batch mode to read from an input file “ean13nos.txt” containing a
list of 13-digit GTINs, each on a separate line, to create a series of
EAN-13 barcodes, formatting the output filenames to “ean001.gif”,
“ean002.gif” etc. using the special character “~”.</p>
<div class="sourceCode" id="cb137"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb137-1"><a href="#cb137-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> EANX <span class="at">--batch</span> <span class="at">-i</span> <span class="st">&#39;ean13nos.txt&#39;</span> <span class="at">-o</span> <span class="st">&#39;ean~~~.gif&#39;</span></span></code></pre></div>
<h2 id="bugs">BUGS</h2>
<p>Please send bug reports to
https://sourceforge.net/p/zint/tickets/.</p>
<h2 id="see-also">SEE ALSO</h2>
<p>Full documention for <code>zint</code> (and the API
<code>libzint</code> and the GUI <code>zint-qt</code>) is available
from</p>
<pre><code>    https://zint.org.uk/manual/</code></pre>
<p>and at</p>
<pre><code>    https://sourceforge.net/p/zint/docs/manual.txt</code></pre>
<h2 id="conforming-to">CONFORMING TO</h2>
<p>Zint is designed to be compliant with a number of international
standards, including:</p>
<p>ISO/IEC 24778:2024, ANSI/AIM BC12-1998, EN 798:1996, AIM ISS-X-24
(1995), ISO/IEC 15417:2007, EN 12323:2005, ISO/IEC 16388:2023, ANSI/AIM
BC6-2000, ANSI/AIM BC5-1995, AIM USS Code One (1994), ISO/IEC
16022:2024, ISO/IEC 21471:2019, ISO/IEC 15420:2009, AIMD014 (v 1.63)
(2008), ISO/IEC 24723:2010, ISO/IEC 24724:2011, ISO/IEC 20830:2021,
ISO/IEC 16390:2007, ISO/IEC 16023:2000, ISO/IEC 24728:2006, ISO/IEC
15438:2015, ISO/IEC 18004:2024, ISO/IEC 23941:2022, AIM ITS/04-023
(2022)</p>
<h2 id="copyright">COPYRIGHT</h2>
<p>Copyright © 2025 Robin Stuart. Released under GNU GPL 3.0 or
later.</p>
<h2 id="author">AUTHOR</h2>
<p>Robin Stuart <a href="mailto:robin@zint.org.uk"
class="email">robin@zint.org.uk</a></p>
<section id="footnotes" class="footnotes footnotes-end-of-document"
role="doc-endnotes">
<hr />
<ol>
<li id="fn1"><p>See the Homebrew website <a
href="https://brew.sh">https://brew.sh</a>.<a href="#fnref1"
class="footnote-back" role="doc-backlink">↩︎</a></p></li>
<li id="fn2"><p>In Unicode contexts, BMP stands for Basic Multilingual
Plane, the plane 0 codeset from U+0000 to U+D7FF and U+E000 to U+FFFF
(i.e. excluding surrogates). Not to be confused with the Windows Bitmap
file format BMP!<a href="#fnref2" class="footnote-back"
role="doc-backlink">↩︎</a></p></li>
<li id="fn3"><p>The symbologies marked with an asterisk (<code>*</code>)
in Table <a href="#tbl:barcode_types">: Barcode Types (Symbologies)</a>
above used different names in Zint before version 2.9.0. For example,
symbology 29 used the name <code>BARCODE_RSS14</code>. These names are
now deprecated but are still recognised by Zint and will continue to be
supported in future versions.<a href="#fnref3" class="footnote-back"
role="doc-backlink">↩︎</a></p></li>
<li id="fn4"><p>The background is omitted for vector outputs EMF, EPS
and SVG when <code>--nobackground</code> is given. For raster outputs
GIF, PCX, PNG and TIF, the background’s alpha channel is set to zero
(fully transparent).<a href="#fnref4" class="footnote-back"
role="doc-backlink">↩︎</a></p></li>
<li id="fn5"><p>For linear barcodes, Human Readable Text (HRT) is not
shown for the postal codes Australia Post (all variants), USPS
Intelligent Mail, POSTNET and PLANET, Brazilian CEPNet, Royal Mail
4-State Customer Code and 4-State Mailmark, Dutch Post KIX Code,
Japanese Postal Code, DAFT Code and FIM, the pharma codes Pharmacode
One-Track and Pharmacode Two-Track, and the specialist codes DX Film
Edge Barcode and Flattermarken. Note that HRT is never shown for stacked
and matrix barcodes.<a href="#fnref5" class="footnote-back"
role="doc-backlink">↩︎</a></p></li>
<li id="fn6"><p>Shift JIS (JIS X 0201 Roman) re-maps two ASCII
characters: backslash (<code>\</code>) to the yen sign (¥), and tilde
(<code>~</code>) to overline (U+203E).<a href="#fnref6"
class="footnote-back" role="doc-backlink">↩︎</a></p></li>
<li id="fn7"><p>ISO/IEC 646 Invariant is a subset of ASCII with 12
characters undefined: <code>#</code>, <code>$</code>, <code>@</code>,
<code>[</code>, <code>\</code>, <code>]</code>, <code>^</code>,
<code>`</code>, <code>{</code>, <code>|</code>, <code>}</code>,
<code>~</code>.<a href="#fnref7" class="footnote-back"
role="doc-backlink">↩︎</a></p></li>
<li id="fn8"><p>BARCODE_MEMORY_FILE textual formats EPS and SVG will
have Unix newlines (LF) on both Windows and Unix, i.e. not CR+LF on
Windows.<a href="#fnref8" class="footnote-back"
role="doc-backlink">↩︎</a></p></li>
<li id="fn9"><p>The <code>height</code> value is ignored for Aztec
(including HIBC and Aztec Rune), Code One, Data Matrix (including HIBC),
DotCode, Grid Matrix, Han Xin, MaxiCode, QR Code (including HIBC, Micro
QR, rMQR and UPNQR), and Ultracode - all of which have a fixed
width-to-height ratio (or, in the case of Code One, a fixed height).<a
href="#fnref9" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
<li id="fn10"><p>For Windows, <code>outfile</code> is assumed to be
UTF-8 encoded.<a href="#fnref10" class="footnote-back"
role="doc-backlink">↩︎</a></p></li>
<li id="fn11"><p>The <code>BARCODE_BIND_TOP</code> flag is set by
default for DPD - see <a href="#dpd-code">6.1.10.7 DPD Code</a>.<a
href="#fnref11" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
<li id="fn12"><p>The <code>BARCODE_BIND</code> flag is always set for
Codablock-F, Code 16K and Code 49. Special considerations apply to
ITF-14 - see <a href="#itf-14">6.1.2.6 ITF-14</a>.<a href="#fnref12"
class="footnote-back" role="doc-backlink">↩︎</a></p></li>
<li id="fn13"><p>Codablock-F, Code 16K, Code 49, EAN-2 to EAN-13, ISBN,
ITF-14, UPC-A and UPC-E have compliant quiet zones added by default.<a
href="#fnref13" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
<li id="fn14"><p><code>ZINT_CAP_EANUPC</code> was previously named
<code>ZINT_CAP_EXTENDABLE</code>, which is still recognised.<a
href="#fnref14" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
<li id="fn15"><p><code>BARCODE_CODE128AB</code> previously used the name
<code>BARCODE_CODE128B</code>, which is still recognised.<a
href="#fnref15" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
<li id="fn16"><p>The DX number may be looked up in The (Modified) Big
Film Database at <a
href="https://thebigfilmdatabase.merinorus.com">https://thebigfilmdatabase.merinorus.com</a>.<a
href="#fnref16" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
</ol>
</section>
</body>
</html>