diff --git a/.gitignore b/.gitignore
index b15557ba..901dd17f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,7 +7,6 @@ build/
*.pro.user
.directory
CMakeLists.txt.user*
-Makefile
backend/Makefile
frontend/Makefile
build-*
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c598c6b8..6443559b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -24,7 +24,7 @@ option(ZINT_TEST "Set test compile flag" OFF)
option(ZINT_COVERAGE "Set code coverage flags" OFF)
option(ZINT_STATIC "Build static library" OFF)
option(ZINT_USE_PNG "Build with PNG support" ON)
-option(ZINT_USE_QT "Build with QT support" ON)
+option(ZINT_USE_QT "Build with Qt support" ON)
include(SetPaths.cmake)
diff --git a/ChangeLog b/ChangeLog
index e7f3f484..59071a7d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -18,8 +18,9 @@ Version 2.10.0.9 (dev) not released yet
NOTE: previously appeared inside vertical whitespace
- ECI 29 now GB 2312 only; GB 18030 is new ECI 32
NOTE: previously ECI 29 was GB 18030 for HANXIN, GB 2312 otherwise
-- GRIDMATRIX, HANXIN, QRCODE/RMQR now warn when convert to GB 2312, GB 18030,
- Shift JIS resp. and no ECI given
+- HANXIN, QRCODE/RMQR now warn when convert to GB 18030, Shift JIS resp.
+ and no ECI given
+- GRIDMATRIX no longer attempts Latin-1 conversion when no ECI given
Changes
-------
@@ -69,6 +70,10 @@ Changes
- GUI: use non-native QColorDialog on Unix also; no noEXE for CLI equivalent;
add shortcuts for copy-to-clipboard and CLI equivalent
- CLI: new --version option to print Zint version
+- manual: one true source now manual.pmd from which manual.txt is generated
+- CLI: man page moved from frontend/zint.1.gz to docs/zint.1.gz, now
+ generated from docs/zint.1.pmd
+- add README.linux to root dir
Bugs
----
@@ -97,6 +102,8 @@ Bugs
- RMQR: fix ECI encoding (wrong bit length for indicator)
- CLI/tcl: fix version check (need <= 999 for DAFT permille)
- UPNQR: fix required binary mode using mode_preset
+- GRIDMATRIX: default char set is GB 2312 only, not Latin-1 with GB 2312 alt
+- HANXIN/QRCODE: use Hanzi/Kanji modes when compatible ECIs given
Version 2.10.0 2021-08-14
diff --git a/README.linux b/README.linux
new file mode 100644
index 00000000..3b55982a
--- /dev/null
+++ b/README.linux
@@ -0,0 +1,76 @@
+Prerequisites for building zint
+-------------------------------
+
+Prerequisites are git, cmake, make, gcc and gcc-c++, e.g. Ubuntu/Debian
+
+ sudo apt install git cmake build-essential
+
+or Fedora (git, make and gcc should already be installed)
+
+ sudo dnf install cmake gcc-c++
+
+libpng is optional but necessary for PNG support, e.g. Ubuntu/Debian
+
+ sudo apt install libpng-dev
+
+or Fedora
+
+ sudo dnf install libpng-devel
+
+Prerequisites for building zint-qt
+----------------------------------
+
+Sign up and download the Qt Maintenance Tool from
+ https://www.qt.io/download-qt-installer
+
+On Ubuntu/Debian you may need to install xinerama to run the tool:
+
+ sudo apt install libxcb-xinerama0
+
+Launch the tool and install the "Desktop gcc 64-bit" component for either Qt
+5.15.2 or Qt 6 (>= 6.1).
+
+Once Qt is installed you may need to tell CMake where it is:
+
+ export CMAKE_PREFIX_PATH=/gcc_64
+
+e.g. export CMAKE_PREFIX_PATH=/opt/Qt/5.15.2/gcc_64
+
+To build zint-qt you also need to install mesa (for OpenGL), e.g. Ubuntu/Debian
+
+ sudo apt install mesa-common-dev libglu1-mesa-dev
+
+or Fedora
+
+ sudo dnf install mesa-libGL mesa-libGL-devel
+
+Build
+-----
+
+The rest is standard CMake
+
+ git clone https://git.code.sf.net/p/zint/code zint
+
+ cd zint
+ mkdir build
+ cd build
+ cmake ..
+ make
+ sudo make install
+
+CMake options
+-------------
+
+A number of options are available:
+
+ZINT_COVERAGE:BOOL=OFF # Set code coverage flags
+ZINT_DEBUG:BOOL=OFF # Set debug compile flags
+ZINT_NOOPT:BOOL=OFF # Set no optimize compile flags
+ZINT_SANITIZE:BOOL=OFF # Set sanitize compile/link flags
+ZINT_STATIC:BOOL=OFF # Build static library
+ZINT_TEST:BOOL=ON # Set test compile flag
+ZINT_USE_PNG:BOOL=ON # Build with PNG support
+ZINT_USE_QT:BOOL=ON # Build with Qt support
+
+For details on ZINT_TEST and building the zint test suite, see
+"backend/tests/README".
diff --git a/backend/common.c b/backend/common.c
index 0ae41434..ba3f1efe 100644
--- a/backend/common.c
+++ b/backend/common.c
@@ -528,15 +528,17 @@ INTERNAL int segs_length(const struct zint_seg segs[], const int seg_count) {
}
/* Shallow copy segments, adjusting default ECIs */
-INTERNAL void segs_cpy(const struct zint_seg segs[], const int seg_count, struct zint_seg local_segs[]) {
+INTERNAL void segs_cpy(const struct zint_symbol *symbol, const struct zint_seg segs[], const int seg_count,
+ struct zint_seg local_segs[]) {
+ const int default_eci = symbol->symbology == BARCODE_GRIDMATRIX ? 29 : symbol->symbology == BARCODE_UPNQR ? 4 : 3;
int i;
local_segs[0] = segs[0];
for (i = 1; i < seg_count; i++) {
local_segs[i] = segs[i];
/* Ensure default ECI set if follows non-default ECI */
- if (local_segs[i].eci == 0 && local_segs[i - 1].eci > 3) {
- local_segs[i].eci = 3;
+ if (local_segs[i].eci == 0 && local_segs[i - 1].eci != 0 && local_segs[i - 1].eci != default_eci) {
+ local_segs[i].eci = default_eci;
}
}
}
diff --git a/backend/common.h b/backend/common.h
index 59646d44..76418447 100644
--- a/backend/common.h
+++ b/backend/common.h
@@ -185,7 +185,8 @@ extern "C" {
INTERNAL float stripf(const float arg);
INTERNAL int segs_length(const struct zint_seg segs[], const int seg_count);
- INTERNAL void segs_cpy(const struct zint_seg segs[], const int seg_count, struct zint_seg local_segs[]);
+ INTERNAL void segs_cpy(const struct zint_symbol *symbol, const struct zint_seg segs[], const int seg_count,
+ struct zint_seg local_segs[]);
INTERNAL int colour_to_red(const int colour);
INTERNAL int colour_to_green(const int colour);
diff --git a/backend/eci.c b/backend/eci.c
index 2502c40a..e8e79b73 100644
--- a/backend/eci.c
+++ b/backend/eci.c
@@ -351,6 +351,7 @@ INTERNAL int get_best_eci(const unsigned char source[], int length) {
/* Return 0 on failure, first ECI set on success */
INTERNAL int get_best_eci_segs(struct zint_symbol *symbol, struct zint_seg segs[], const int seg_count) {
+ const int default_eci = symbol->symbology == BARCODE_GRIDMATRIX ? 29 : symbol->symbology == BARCODE_UPNQR ? 4 : 3;
int first_eci_set = 0;
int i;
@@ -360,8 +361,8 @@ INTERNAL int get_best_eci_segs(struct zint_symbol *symbol, struct zint_seg segs[
if (eci == 0) {
return 0;
}
- if (eci == 3) {
- if (i != 0 && segs[i - 1].eci > 3) {
+ if (eci == default_eci) {
+ if (i != 0 && segs[i - 1].eci != 0 && segs[i - 1].eci != default_eci) {
segs[i].eci = eci;
if (first_eci_set == 0) {
first_eci_set = eci;
diff --git a/backend/gb18030.c b/backend/gb18030.c
index 3d5aa7f4..31e0a289 100644
--- a/backend/gb18030.c
+++ b/backend/gb18030.c
@@ -2921,7 +2921,8 @@ INTERNAL int gb18030_utf8_to_eci(const int eci, const unsigned char source[], in
return error_number;
}
- gb18030_cpy(converted, p_length, ddata, full_multibyte);
+ /* GB 18030 (ECI 32) superset of GB 2312 (ECI 29) and GBK (ECI 31) */
+ gb18030_cpy(converted, p_length, ddata, full_multibyte || eci == 32 || eci == 29 || eci == 31);
} else {
gb18030_cpy(source, p_length, ddata, full_multibyte);
}
diff --git a/backend/gb2312.c b/backend/gb2312.c
index a81befb8..c15b9cb8 100644
--- a/backend/gb2312.c
+++ b/backend/gb2312.c
@@ -1589,7 +1589,7 @@ INTERNAL int gb2312_utf8_to_eci(const int eci, const unsigned char source[], int
return error_number;
}
- gb2312_cpy(converted, p_length, ddata, full_multibyte);
+ gb2312_cpy(converted, p_length, ddata, full_multibyte || eci == 29);
} else {
gb2312_cpy(source, p_length, ddata, full_multibyte);
}
diff --git a/backend/gridmtx.c b/backend/gridmtx.c
index b907a22e..b0876536 100644
--- a/backend/gridmtx.c
+++ b/backend/gridmtx.c
@@ -510,6 +510,7 @@ static int gm_encode(unsigned int ddata[], const int length, char binary[], cons
glyph = (0x60 * (c1 - 0xb0 + 9)) + (c2 - 0xa0);
}
done = 1; /* GB 2312 always within above ranges */
+ /* Note not using the unallocated glyphs 7776 to 8191 mentioned in AIMD014 section 6.3.1.2 */
}
if (!(done)) {
if (sp != (length - 1)) {
@@ -1055,7 +1056,7 @@ INTERNAL int gridmatrix(struct zint_symbol *symbol, struct zint_seg segs[], cons
char *grid;
#endif
- segs_cpy(segs, seg_count, local_segs); /* Shallow copy (needed to set default ECIs & protect lengths) */
+ segs_cpy(symbol, segs, seg_count, local_segs); /* Shallow copy (needed to set default ECIs & protect lengths) */
/* If ZINT_FULL_MULTIBYTE set use Hanzi mode in DATA_MODE or for non-GB 2312 in UNICODE_MODE */
full_multibyte = (symbol->option_3 & 0xFF) == ZINT_FULL_MULTIBYTE;
@@ -1066,13 +1067,13 @@ INTERNAL int gridmatrix(struct zint_symbol *symbol, struct zint_seg segs[], cons
unsigned int *dd = ddata;
for (i = 0; i < seg_count; i++) {
int done = 0;
- if (local_segs[i].eci != 29 || seg_count > 1) { /* Unless ECI 29 (GB 2312) or have multiple segments */
- /* Try other conversions (ECI 0 defaults to ISO/IEC 8859-1) */
+ if (local_segs[i].eci != 0 && local_segs[i].eci != 29) { /* Unless default or ECI 29 (GB 2312) */
+ /* Try other conversions */
error_number = gb2312_utf8_to_eci(local_segs[i].eci, local_segs[i].source, &local_segs[i].length,
dd, full_multibyte);
if (error_number == 0) {
done = 1;
- } else if (local_segs[i].eci || seg_count > 1) {
+ } else {
sprintf(symbol->errtxt, "535: Invalid character in input data for ECI %d", local_segs[i].eci);
return error_number;
}
@@ -1083,10 +1084,6 @@ INTERNAL int gridmatrix(struct zint_symbol *symbol, struct zint_seg segs[], cons
if (error_number != 0) {
return error_number;
}
- if (local_segs[i].eci != 29) {
- strcpy(symbol->errtxt, "540: Converted to GB 2312 but no ECI specified");
- warn_number = ZINT_WARN_NONCOMPLIANT;
- }
}
dd += local_segs[i].length;
}
diff --git a/backend/hanxin.c b/backend/hanxin.c
index 5fcccfe8..c9f48ccd 100644
--- a/backend/hanxin.c
+++ b/backend/hanxin.c
@@ -1518,7 +1518,7 @@ INTERNAL int hanxin(struct zint_symbol *symbol, struct zint_seg segs[], const in
unsigned char *grid;
#endif
- segs_cpy(segs, seg_count, local_segs); /* Shallow copy (needed to set default ECI & protect lengths) */
+ segs_cpy(symbol, segs, seg_count, local_segs); /* Shallow copy (needed to set default ECI & protect lengths) */
/* If ZINT_FULL_MULTIBYTE set use Hanzi mode in DATA_MODE or for non-GB 18030 in UNICODE_MODE */
full_multibyte = (symbol->option_3 & 0xFF) == ZINT_FULL_MULTIBYTE;
diff --git a/backend/library.c b/backend/library.c
index e08871f9..e2a93c09 100644
--- a/backend/library.c
+++ b/backend/library.c
@@ -579,7 +579,7 @@ static int reduced_charset(struct zint_symbol *symbol, struct zint_seg segs[], c
#endif
/* Prior check ensures ECI only set for those that support it */
- segs_cpy(segs, seg_count, local_segs); /* Shallow copy (needed to set default ECIs) */
+ segs_cpy(symbol, segs, seg_count, local_segs); /* Shallow copy (needed to set default ECIs) */
preprocessed = preprocessed_buf;
for (i = 0; i < seg_count; i++) {
if (convertible[i]) {
@@ -605,7 +605,7 @@ static int reduced_charset(struct zint_symbol *symbol, struct zint_seg segs[], c
}
} else {
if (supports_eci(symbol->symbology) || is_hibc(symbol->symbology)) {
- segs_cpy(segs, seg_count, local_segs); /* Shallow copy (needed to set default ECIs) */
+ segs_cpy(symbol, segs, seg_count, local_segs); /* Shallow copy (needed to set default ECIs) */
error_number = (*(barcode_segs_func_t)barcode_funcs[symbol->symbology])(symbol, local_segs, seg_count);
} else {
error_number = (*(barcode_func_t)barcode_funcs[symbol->symbology])(symbol, segs[0].source,
diff --git a/backend/qr.c b/backend/qr.c
index a7697046..7530e6b5 100644
--- a/backend/qr.c
+++ b/backend/qr.c
@@ -1634,7 +1634,7 @@ INTERNAL int qrcode(struct zint_symbol *symbol, struct zint_seg segs[], const in
user_mask = 0; /* Ignore */
}
- segs_cpy(segs, seg_count, local_segs); /* Shallow copy (needed to set default ECIs & protect lengths) */
+ segs_cpy(symbol, segs, seg_count, local_segs); /* Shallow copy (needed to set default ECIs & protect lengths) */
warn_number = qr_prep_data(symbol, local_segs, seg_count, ddata);
if (warn_number >= ZINT_ERROR) {
@@ -3065,7 +3065,7 @@ INTERNAL int rmqr(struct zint_symbol *symbol, struct zint_seg segs[], const int
gs1 = ((symbol->input_mode & 0x07) == GS1_MODE);
- segs_cpy(segs, seg_count, local_segs);
+ segs_cpy(symbol, segs, seg_count, local_segs);
warn_number = qr_prep_data(symbol, local_segs, seg_count, ddata);
if (warn_number >= ZINT_ERROR) {
diff --git a/backend/sjis.c b/backend/sjis.c
index 753363c3..05d30be8 100644
--- a/backend/sjis.c
+++ b/backend/sjis.c
@@ -1554,11 +1554,11 @@ INTERNAL int sjis_utf8_to_eci(const int eci, const unsigned char source[], int *
error_number = utf8_to_eci(eci, source, converted, p_length);
if (error_number != 0) {
- // Note not setting `symbol->errtxt`, up to caller
+ /* Note not setting `symbol->errtxt`, up to caller */
return error_number;
}
- sjis_cpy(converted, p_length, ddata, full_multibyte);
+ sjis_cpy(converted, p_length, ddata, full_multibyte || eci == 20);
} else {
sjis_cpy(source, p_length, ddata, full_multibyte);
}
diff --git a/backend/tests/test_gb18030.c b/backend/tests/test_gb18030.c
index 15c93fe5..c4e35fb9 100644
--- a/backend/tests/test_gb18030.c
+++ b/backend/tests/test_gb18030.c
@@ -296,17 +296,30 @@ static void test_gb18030_utf8_to_eci(int index) {
/* 38*/ { 28, 1, "¢¢", -1, 0, 2, { 0xA246, 0xA246 }, "Big5 in GB 18030 Hanzi mode range (but outside GB 2312 range)" },
/* 39*/ { 28, 0, "陛", -1, 0, 2, { 0xB0, 0xA1 }, "Big5 U+965B" },
/* 40*/ { 28, 1, "陛", -1, 0, 1, { 0xB0A1 }, "Big5 in GB 18030 Hanzi mode range" },
- /* 41*/ { 29, 0, "¨¨", -1, 0, 4, { 0xA1, 0xA7, 0xA1, 0xA7 }, "GB 2312 U+00A8" },
+ /* 41*/ { 29, 0, "¨¨", -1, 0, 2, { 0xA1A7, 0xA1A7 }, "GB 2312 U+00A8" },
/* 42*/ { 29, 1, "¨¨", -1, 0, 2, { 0xA1A7, 0xA1A7 }, "GB 2312" },
- /* 43*/ { 29, 0, "崂", -1, 0, 2, { 0xE1, 0xC0 }, "GB 2312 U+5D02" },
+ /* 43*/ { 29, 0, "崂", -1, 0, 1, { 0xE1C0 }, "GB 2312 U+5D02" },
/* 44*/ { 29, 1, "崂", -1, 0, 1, { 0xE1C0 }, "GB 2312" },
- /* 45*/ { 29, 0, "・", -1, 0, 2, { 0xA1, 0xA4 }, "GB 2312 U+30FB" },
+ /* 45*/ { 29, 0, "・", -1, 0, 1, { 0xA1A4 }, "GB 2312 U+30FB" },
/* 46*/ { 29, 1, "・", -1, 0, 1, { 0xA1A4 }, "GB 2312" },
/* 47*/ { 29, 0, "釦", -1, ZINT_ERROR_INVALID_DATA, -1, {0}, "GB 18030 U+91E6 not in GB 2312" },
/* 48*/ { 30, 0, "¡¡", -1, 0, 4, { 0x22 + 0x80, 0x2E + 0x80, 0x22 + 0x80, 0x2E + 0x80 }, "EUC-KR U+00A1 (0xA2AE)" },
/* 49*/ { 30, 1, "¡¡", -1, 0, 2, { 0x222E + 0x8080, 0x222E + 0x8080 }, "All EUC-KR in GB 18030 Hanzi mode range" },
/* 50*/ { 30, 0, "詰", -1, 0, 2, { 0x7D + 0x80, 0x7E + 0x80 }, "EUC-KR U+8A70 (0xFDFE)" },
/* 51*/ { 30, 1, "詰", -1, 0, 1, { 0x7D7E + 0x8080 }, "All EUC-KR in GB 18030 Hanzi mode range" },
+ /* 52*/ { 31, 0, "條", -1, 0, 1, { 0x976C }, "GBK U+689D" },
+ /* 53*/ { 31, 1, "條", -1, 0, 1, { 0x976C }, "GBK U+689D" },
+ /* 54*/ { 31, 0, "條碼", -1, 0, 2, { 0x976C, 0xB461 }, "GBK U+689D" },
+ /* 55*/ { 31, 1, "條碼", -1, 0, 2, { 0x976C, 0xB461 }, "GBK U+689D" },
+ /* 56*/ { 31, 0, "釦", -1, 0, 1, { 0xE240 }, "GB 18030 U+91E6 in GBK" },
+ /* 57*/ { 31, 0, "€", -1, ZINT_ERROR_INVALID_DATA, -1, {0}, "GB 18030 U+20AC not in GBK" },
+ /* 58*/ { 32, 0, "¨¨", -1, 0, 2, { 0xA1A7, 0xA1A7 }, "GB 18030 U+00A8" },
+ /* 59*/ { 32, 1, "¨¨", -1, 0, 2, { 0xA1A7, 0xA1A7 }, "GB 18030" },
+ /* 60*/ { 32, 0, "崂", -1, 0, 1, { 0xE1C0 }, "GB 18030 U+5D02" },
+ /* 61*/ { 32, 1, "崂", -1, 0, 1, { 0xE1C0 }, "GB 18030" },
+ /* 62*/ { 32, 0, "・", -1, 0, 2, { 0x8139, 0xA739 }, "GB 18030 U+30FB" },
+ /* 63*/ { 32, 1, "・", -1, 0, 2, { 0x8139, 0xA739 }, "GB 18030" },
+ /* 64*/ { 32, 0, "€", -1, 0, 1, { 0xA2E3 }, "GB 18030 U+20AC " },
};
int data_size = ARRAY_SIZE(data);
int i, length, ret;
diff --git a/backend/tests/test_gb2312.c b/backend/tests/test_gb2312.c
index c71a4892..28811f9b 100644
--- a/backend/tests/test_gb2312.c
+++ b/backend/tests/test_gb2312.c
@@ -212,11 +212,11 @@ static void test_gb2312_utf8_to_eci(int index) {
/* 30*/ { 28, 1, "¢¢", -1, 0, 4, { 0xA2, 0x46, 0xA2, 0x46 }, "Big5 outside GB 2312 Hanzi mode range (but in GB 18030 range)" },
/* 31*/ { 28, 0, "陛", -1, 0, 2, { 0xB0, 0xA1 }, "Big5 U+965B" },
/* 32*/ { 28, 1, "陛", -1, 0, 1, { 0xB0A1 }, "Big5 in GB 2312 Hanzi mode range" },
- /* 33*/ { 29, 0, "¨¨", -1, 0, 4, { 0xA1, 0xA7, 0xA1, 0xA7 }, "GB 2312 U+00A8" },
+ /* 33*/ { 29, 0, "¨¨", -1, 0, 2, { 0xA1A7, 0xA1A7 }, "GB 2312 U+00A8" },
/* 34*/ { 29, 1, "¨¨", -1, 0, 2, { 0xA1A7, 0xA1A7 }, "GB 2312" },
- /* 35*/ { 29, 0, "崂", -1, 0, 2, { 0xE1, 0xC0 }, "GB 2312 U+5D02" },
+ /* 35*/ { 29, 0, "崂", -1, 0, 1, { 0xE1C0 }, "GB 2312 U+5D02" },
/* 36*/ { 29, 1, "崂", -1, 0, 1, { 0xE1C0 }, "GB 2312" },
- /* 37*/ { 29, 0, "・", -1, 0, 2, { 0xA1, 0xA4 }, "GB 2312 U+30FB" },
+ /* 37*/ { 29, 0, "・", -1, 0, 1, { 0xA1A4 }, "GB 2312 U+30FB" },
/* 38*/ { 29, 1, "・", -1, 0, 1, { 0xA1A4 }, "GB 2312" },
/* 39*/ { 29, 0, "釦", -1, ZINT_ERROR_INVALID_DATA, -1, {0}, "GB 18030 U+91E6 not in GB 2312" },
/* 40*/ { 30, 0, "¡¡", -1, 0, 4, { 0x22 + 0x80, 0x2E + 0x80, 0x22 + 0x80, 0x2E + 0x80 }, "EUC-KR U+00A1 (0xA2AE)" },
diff --git a/backend/tests/test_gridmtx.c b/backend/tests/test_gridmtx.c
index 0ed0723d..7d8a4273 100644
--- a/backend/tests/test_gridmtx.c
+++ b/backend/tests/test_gridmtx.c
@@ -194,7 +194,7 @@ static void test_input(int index, int generate, int debug) {
// ㈩ U+3229 in GB 2312 0x226E
// 一 U+4E00 in GB 2312 0x523B
struct item data[] = {
- /* 0*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "é", 0, 0, "30 01 69 00", "B1 (ISO 8859-1)" },
+ /* 0*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "é", 0, 0, "08 54 6F 78 00", "H1 (GB 2312) Note: Grid Matrix default is GB 2312, not ISO 8859-1" },
/* 1*/ { UNICODE_MODE, 3, -1, -1, { 0, 0, "" }, "é", 0, 3, "60 01 58 00 74 40", "ECI-3 B1 (ISO 8859-1)" },
/* 2*/ { UNICODE_MODE, 29, -1, -1, { 0, 0, "" }, "é", 0, 29, "60 0E 44 2A 37 7C 00", "ECI-29 H1 (GB 2312)" },
/* 3*/ { UNICODE_MODE, 26, -1, -1, { 0, 0, "" }, "é", 0, 26, "60 0D 18 01 61 6A 20", "ECI-26 B2 (UTF-8)" },
@@ -202,16 +202,16 @@ static void test_input(int index, int generate, int debug) {
/* 5*/ { DATA_MODE, 0, -1, -1, { 0, 0, "" }, "é", 0, 0, "30 03 43 54 40", "B2 (UTF-8)" },
/* 6*/ { DATA_MODE, 0, -1, ZINT_FULL_MULTIBYTE, { 0, 0, "" }, "é", 0, 0, "0A 51 1F 78 00", "H1 (UTF-8) (full multibyte)" },
/* 7*/ { DATA_MODE, 0, -1, -1, { 0, 0, "" }, "\351", 0, 0, "30 01 69 00", "B1 (ISO 8859-1) (0xE9)" },
- /* 8*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "β", ZINT_WARN_NONCOMPLIANT, 0, "Warning 08 40 2F 78 00", "H1 (GB 2312)" },
+ /* 8*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "β", 0, 0, "08 40 2F 78 00", "H1 (GB 2312)" },
/* 9*/ { UNICODE_MODE, 9, -1, -1, { 0, 0, "" }, "β", 0, 9, "60 04 58 00 71 00", "ECI-9 B1 (ISO 8859-7)" },
/* 10*/ { UNICODE_MODE, 29, -1, -1, { 0, 0, "" }, "β", 0, 29, "60 0E 44 20 17 7C 00", "ECI-29 H1 (GB 2312)" },
/* 11*/ { UNICODE_MODE, 26, -1, -1, { 0, 0, "" }, "β", 0, 26, "60 0D 18 01 67 2C 40", "ECI-26 H1 (UTF-8)" },
/* 12*/ { UNICODE_MODE, 26, -1, ZINT_FULL_MULTIBYTE, { 0, 0, "" }, "β", 0, 26, "60 0D 05 6B 17 7C 00", "ECI-26 H1 (UTF-8) (full multibyte)" },
/* 13*/ { DATA_MODE, 0, -1, -1, { 0, 0, "" }, "β", 0, 0, "30 03 4E 59 00", "B2 (UTF-8)" },
/* 14*/ { DATA_MODE, 0, -1, ZINT_FULL_MULTIBYTE, { 0, 0, "" }, "β", 0, 0, "0B 56 2F 78 00", "H1 (UTF-8) (full multibyte)" },
- /* 15*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "ÿ", 0, 0, "30 01 7F 00", "B1 (ISO 8859-1)" },
- /* 16*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "ÿÿÿ", 0, 0, "30 05 7F 7F 7F 60", "B3 (ISO 8859-1)" },
- /* 17*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "㈩一", ZINT_WARN_NONCOMPLIANT, 0, "Warning 08 15 68 0E 7F 70 00", "H2 (GB 2312)" },
+ /* 15*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "ÿ", ZINT_WARN_USES_ECI, 3, "Warning 60 01 58 00 7F 40", "ECI-3 B1 (ISO 8859-1)" },
+ /* 16*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "ÿÿÿ", ZINT_WARN_USES_ECI, 3, "Warning 60 01 58 02 7F 7F 7F 70", "ECI-3 B3 (ISO 8859-1)" },
+ /* 17*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "㈩一", 0, 0, "08 15 68 0E 7F 70 00", "H2 (GB 2312)" },
/* 18*/ { UNICODE_MODE, 29, -1, -1, { 0, 0, "" }, "㈩一", 0, 29, "60 0E 44 0A 74 07 3F 78 00", "ECI-29 H2 (GB 2312)" },
/* 19*/ { DATA_MODE, 0, -1, -1, { 0, 0, "" }, "\177\177", 0, 0, "30 02 7F 3F 40", "B2 (ASCII)" },
/* 20*/ { DATA_MODE, 0, -1, -1, { 0, 0, "" }, "\177\177\177", 0, 0, "30 04 7F 3F 5F 60", "B3 (ASCII)" },
@@ -233,27 +233,27 @@ static void test_input(int index, int generate, int debug) {
/* 36*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "ABCDE\011F", 0, 0, "20 01 08 32 3E 49 17 30", "U7 (ASCII)" },
/* 37*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "1 1234ABCD12.2abcd-12", 0, 0, "13 7A 23 41 2A 3F 68 01 08 3E 4F 66 1E 5F 70 00 44 1F 2F 6E 0F 0F 74", "N6 U4 N4 L4 N3 (ASCII)" },
/* 38*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "1 123ABCDE12.2abcd-12", 0, 0, "28 1F 40 42 06 28 59 43 27 01 05 7D 56 42 49 16 34 7F 6D 30 08 2F 60", "M21 (ASCII)" },
- /* 39*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "国外通信教材 Matlab6.5", ZINT_WARN_NONCOMPLIANT, 0, "Warning 09 63 27 20 4E 24 1F 05 21 58 22 13 7E 1E 4C 78 09 56 00 3D 3F 4A 45 3F 50", "H6 U2 L5 N3 (GB 2312) (Same as D.2 example)" },
+ /* 39*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "国外通信教材 Matlab6.5", 0, 0, "09 63 27 20 4E 24 1F 05 21 58 22 13 7E 1E 4C 78 09 56 00 3D 3F 4A 45 3F 50", "H6 U2 L5 N3 (GB 2312) (Same as D.2 example)" },
/* 40*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "AAT", 0, 0, "20 00 4F 30", "U3 (ASCII)" },
/* 41*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "aat", 0, 0, "18 00 4F 30", "L3 (ASCII)" },
/* 42*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "AAT2556", 0, 0, "20 00 4F 58 7F 65 47 7A", "U3 N4 (ASCII) (note same bit count as M7)" },
/* 43*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "AAT2556 ", 0, 0, "29 22 4E 42 0A 14 37 6F 60", "M8 (ASCII)" },
- /* 44*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "AAT2556 电", ZINT_WARN_NONCOMPLIANT, 0, "Warning 29 22 4E 42 0A 14 37 6F 62 2C 1F 7E 00", "M8 H1 (GB 2312)" },
+ /* 44*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "AAT2556 电", 0, 0, "29 22 4E 42 0A 14 37 6F 62 2C 1F 7E 00", "M8 H1 (GB 2312)" },
/* 45*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, " 200", 0, 0, "11 7A 06 23 7D 00", "N4 (ASCII)" },
- /* 46*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, " 200mA至", ZINT_WARN_NONCOMPLIANT, 0, "Warning 2F 60 40 00 60 2B 78 63 41 7F 40", "M6 H1 (GB 2312)" },
+ /* 46*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, " 200mA至", 0, 0, "2F 60 40 00 60 2B 78 63 41 7F 40", "M6 H1 (GB 2312)" },
/* 47*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "2A tel:86 019 82512738", 0, 0, "28 22 5F 4F 29 48 5F 6D 7E 6F 55 57 1F 28 63 0F 5A 11 64 0F 74", "M2 L5(with control) N15 (ASCII)" },
- /* 48*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "至2A tel:86 019 82512738", ZINT_WARN_NONCOMPLIANT, 0, "Warning 30 07 56 60 4C 48 13 6A 32 17 7B 3F 5B 75 35 67 6A 18 63 76 44 39 03 7D 00", "B4 L5(with control) N15 (GB 2312)" },
- /* 49*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "AAT2556 电池充电器+降压转换器 200mA至2A tel:86 019 82512738", ZINT_WARN_NONCOMPLIANT, 0, "Warning (62) 29 22 22 1C 4E 41 42 7E 0A 40 14 00 37 7E 6F 00 62 7E 2C 00 1C 7E 4B 00 41 7E 18 00", "M8 H11 M6 B4 L5(with control) N15 (GB 2312) (*NOT SAME* as D3 example Figure D.1, M8 H11 M6 H1 M3 L4(with control) N15, which uses a few more bits)" },
+ /* 48*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "至2A tel:86 019 82512738", 0, 0, "30 07 56 60 4C 48 13 6A 32 17 7B 3F 5B 75 35 67 6A 18 63 76 44 39 03 7D 00", "B4 L5(with control) N15 (GB 2312)" },
+ /* 49*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "AAT2556 电池充电器+降压转换器 200mA至2A tel:86 019 82512738", 0, 0, "(62) 29 22 22 1C 4E 41 42 7E 0A 40 14 00 37 7E 6F 00 62 7E 2C 00 1C 7E 4B 00 41 7E 18 00", "M8 H11 M6 B4 L5(with control) N15 (GB 2312) (*NOT SAME* as D3 example Figure D.1, M8 H11 M6 H1 M3 L4(with control) N15, which uses a few more bits)" },
/* 50*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::", 0, 0, "(588) 37 68 68 68 68 68 74 7E 74 74 74 74 74 3A 3A 3A 3A 3A 3A 3A 1D 1D 1D 1D 1D 1D 1D 0E", "B512 (ASCII)" },
/* 51*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::\177", 0, 0, "(591) 37 68 68 68 68 68 74 7E 74 74 74 74 74 3A 3A 3A 3A 3A 3A 3A 1D 1D 1D 1D 1D 1D 1D 0E", "B513 (ASCII)" },
- /* 52*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, ":::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::至", ZINT_WARN_NONCOMPLIANT, 0, "Warning (591) 37 68 68 68 68 68 74 7C 74 74 74 74 74 3A 3A 3A 3A 3A 3A 3A 1D 1D 1D 1D 1D 1D 1D 0E", "B511 H1 (GB 2312)" },
- /* 53*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, ":::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::至:", ZINT_WARN_NONCOMPLIANT, 0, "Warning (592) 37 68 68 68 68 68 74 7E 74 74 74 74 74 3A 3A 3A 3A 3A 3A 3A 1D 1D 1D 1D 1D 1D 1D 0E", "B513 (GB 2312)" },
- /* 54*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "电电123456", ZINT_WARN_NONCOMPLIANT, 0, "Warning 09 30 72 61 7F 70 41 76 72 1F 68", "H2 (GB 2312) N6" },
- /* 55*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "电电abcdef", ZINT_WARN_NONCOMPLIANT, 0, "Warning 09 30 72 61 7F 71 00 08 43 10 5D 40", "H2 (GB 2312) L6" },
- /* 56*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "电电电电电\011\011\011", ZINT_WARN_NONCOMPLIANT, 0, "Warning 09 30 72 61 65 43 4B 07 16 0F 7F 14 02 04 42 21 10", "H5 (GB 2312) B3" },
- /* 57*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "1234567电电", ZINT_WARN_NONCOMPLIANT, 0, "Warning 14 1E 6E 22 5E 3F 59 30 72 61 7F 70 00", "N7 H2 (GB 2312)" },
+ /* 52*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, ":::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::至", 0, 0, "(591) 37 68 68 68 68 68 74 7C 74 74 74 74 74 3A 3A 3A 3A 3A 3A 3A 1D 1D 1D 1D 1D 1D 1D 0E", "B511 H1 (GB 2312)" },
+ /* 53*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, ":::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::至:", 0, 0, "(592) 37 68 68 68 68 68 74 7E 74 74 74 74 74 3A 3A 3A 3A 3A 3A 3A 1D 1D 1D 1D 1D 1D 1D 0E", "B513 (GB 2312)" },
+ /* 54*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "电电123456", 0, 0, "09 30 72 61 7F 70 41 76 72 1F 68", "H2 (GB 2312) N6" },
+ /* 55*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "电电abcdef", 0, 0, "09 30 72 61 7F 71 00 08 43 10 5D 40", "H2 (GB 2312) L6" },
+ /* 56*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "电电电电电\011\011\011", 0, 0, "09 30 72 61 65 43 4B 07 16 0F 7F 14 02 04 42 21 10", "H5 (GB 2312) B3" },
+ /* 57*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "1234567电电", 0, 0, "14 1E 6E 22 5E 3F 59 30 72 61 7F 70 00", "N7 H2 (GB 2312)" },
/* 58*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "12345678mA 2", 0, 0, "12 1E 6E 23 06 3F 76 02 5F 02 7E 00", "N8 M4" },
- /* 59*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "ABCDEFG电电", ZINT_WARN_NONCOMPLIANT, 0, "Warning 20 01 08 32 0A 37 05 43 4B 07 7F 40", "U7 H2 (GB 2312)" },
+ /* 59*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "ABCDEFG电电", 0, 0, "20 01 08 32 0A 37 05 43 4B 07 7F 40", "U7 H2 (GB 2312)" },
/* 60*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "ABCDEFGHIJ8mA 2", 0, 0, "20 01 08 32 0A 31 68 27 70 46 02 5F 02 7E 00", "U10 M5" },
/* 61*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "ABCDEFGHIJ\011\011\011\011", 0, 0, "20 01 08 32 0A 31 68 27 78 03 04 42 21 10 48 00", "U10 B4" },
/* 62*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "8mA B123456789", 0, 0, "29 0C 05 3E 17 7C 40 7B 39 0C 2B 7E 40", "M5 N9" },
@@ -261,8 +261,8 @@ static void test_input(int index, int generate, int debug) {
/* 64*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "\011\011\011\011123456", 0, 0, "30 06 09 04 42 21 12 03 6D 64 3F 50", "B4 N6" },
/* 65*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "\011\011\011\011ABCDEF", 0, 0, "30 06 09 04 42 21 14 00 11 06 21 3B", "B4 U6" },
/* 66*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "\011\011\011\0118mA 2", 0, 0, "30 06 09 04 42 21 15 11 40 57 60 5F 40", "B4 M5" },
- /* 67*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "电电电电电\015\012", ZINT_WARN_NONCOMPLIANT, 0, "Warning 09 30 72 61 65 43 4B 07 16 0F 73 03 7E 00", "H7 (GB 2312)" },
- /* 68*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "电电电电电12", ZINT_WARN_NONCOMPLIANT, 0, "Warning 09 30 72 61 65 43 4B 07 16 0F 7B 37 7E 00", "H7 (GB 2312)" },
+ /* 67*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "电电电电电\015\012", 0, 0, "09 30 72 61 65 43 4B 07 16 0F 73 03 7E 00", "H7 (GB 2312)" },
+ /* 68*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "电电电电电12", 0, 0, "09 30 72 61 65 43 4B 07 16 0F 7B 37 7E 00", "H7 (GB 2312)" },
/* 69*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "1234567.8\015\012123456", 0, 0, "10 1E 6E 23 79 30 67 77 0F 37 11 7E 40", "N17" },
/* 70*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "˘", ZINT_WARN_USES_ECI, 4, "Warning 60 02 18 00 51 00", "ECI-4 B1 (ISO 8859-2)" },
/* 71*/ { UNICODE_MODE, 4, -1, -1, { 0, 0, "" }, "˘", 0, 4, "60 02 18 00 51 00", "ECI-4 B1 (ISO 8859-2)" },
@@ -272,11 +272,11 @@ static void test_input(int index, int generate, int debug) {
/* 75*/ { UNICODE_MODE, 7, -1, -1, { 0, 0, "" }, "Ж", 0, 7, "60 03 58 00 5B 00", "ECI-7 B1 (ISO 8859-5)" },
/* 76*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "Ș", ZINT_WARN_USES_ECI, 18, "Warning 60 09 18 00 55 00", "ECI-18 B1 (ISO 8859-16)" },
/* 77*/ { UNICODE_MODE, 18, -1, -1, { 0, 0, "" }, "Ș", 0, 18, "60 09 18 00 55 00", "ECI-18 B1 (ISO 8859-16)" },
- /* 78*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "テ", ZINT_WARN_NONCOMPLIANT, 0, "Warning 08 34 6F 78 00", "H1 (GB 2312)" },
+ /* 78*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "テ", 0, 0, "08 34 6F 78 00", "H1 (GB 2312)" },
/* 79*/ { UNICODE_MODE, 20, -1, -1, { 0, 0, "" }, "テ", 0, 20, "60 0A 18 01 41 59 20", "ECI-20 B2 (SHIFT JIS)" },
/* 80*/ { UNICODE_MODE, 20, -1, -1, { 0, 0, "" }, "テテ", 0, 20, "60 0A 18 03 41 59 30 36 28 00", "ECI-20 B4 (SHIFT JIS)" },
/* 81*/ { UNICODE_MODE, 20, -1, -1, { 0, 0, "" }, "\\\\", 0, 20, "60 0A 18 03 40 57 70 15 78 00", "ECI-20 B4 (SHIFT JIS)" },
- /* 82*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "…", ZINT_WARN_NONCOMPLIANT, 0, "Warning 08 01 5F 78 00", "H1 (GB 2312)" },
+ /* 82*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "…", 0, 0, "08 01 5F 78 00", "H1 (GB 2312)" },
/* 83*/ { UNICODE_MODE, 21, -1, -1, { 0, 0, "" }, "…", 0, 21, "60 0A 58 00 42 40", "ECI-21 B1 (Win 1250)" },
/* 84*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "Ґ", ZINT_WARN_USES_ECI, 22, "Warning 60 0B 18 00 52 40", "ECI-22 B1 (Win 1251)" },
/* 85*/ { UNICODE_MODE, 22, -1, -1, { 0, 0, "" }, "Ґ", 0, 22, "60 0B 18 00 52 40", "ECI-22 B1 (Win 1251)" },
@@ -291,7 +291,7 @@ static void test_input(int index, int generate, int debug) {
/* 94*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "龘", ZINT_WARN_USES_ECI, 26, "Warning 60 0D 18 02 74 6F 53 00", "ECI-26 B3 (UTF-8)" },
/* 95*/ { UNICODE_MODE, 28, -1, -1, { 0, 0, "" }, "龘", 0, 28, "60 0E 18 01 7C 75 20", "ECI-28 B2 (Big5)" },
/* 96*/ { UNICODE_MODE, 28, -1, -1, { 0, 0, "" }, "龘龘", 0, 28, "60 0E 18 03 7C 75 3F 1D 28 00", "ECI-28 B4 (Big5)" },
- /* 97*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "齄", ZINT_WARN_NONCOMPLIANT, 0, "Warning 0F 4B 6F 78 00", "H1 (GB 2312)" },
+ /* 97*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "齄", 0, 0, "0F 4B 6F 78 00", "H1 (GB 2312)" },
/* 98*/ { UNICODE_MODE, 29, -1, -1, { 0, 0, "" }, "齄", 0, 29, "60 0E 47 65 77 7C 00", "ECI-29 H1 (GB 2312)" },
/* 99*/ { UNICODE_MODE, 29, -1, -1, { 0, 0, "" }, "齄齄", 0, 29, "60 0E 47 65 77 4B 6F 78 00", "ECI-29 H2 (GB 2312)" },
/*100*/ { UNICODE_MODE, 0, -1, -1, { 0, 0, "" }, "가", ZINT_WARN_USES_ECI, 26, "Warning 60 0D 18 02 75 2C 10 00", "ECI-26 B3 (UTF-8)" },
@@ -422,7 +422,7 @@ static void test_encode(int index, int generate, int debug) {
"101111010010100001010010110111"
"111111000000111111000000111111"
},
- /* 2*/ { "AAT2556 电池充电器+降压转换器 200mA至2A tel:86 019 82512738", UNICODE_MODE, 3, 3, ZINT_WARN_NONCOMPLIANT, 42, 42, "AIMD014 Figure D.1 **NOT SAME** different encodation, see test_input dataset",
+ /* 2*/ { "AAT2556 电池充电器+降压转换器 200mA至2A tel:86 019 82512738", UNICODE_MODE, 3, 3, 0, 42, 42, "AIMD014 Figure D.1 **NOT SAME** different encodation, see test_input dataset",
"111111000000111111000000111111000000111111"
"101101001100101111001010101011001100101101"
"110001011010110101010000100011000000100001"
@@ -523,72 +523,74 @@ static void test_encode_segs(int index, int generate, int debug) {
char *comment;
char *expected;
};
+ // ¶ not in GB 2312 (in ISO/IEC 8869-1)
+ // Ж in GB 2312 (and ISO/IEC 8859-5)
struct item data[] = {
- /* 0*/ { UNICODE_MODE, -1, -1, { 0, 0, "" }, { { TU("¶"), -1, 0 }, { TU("Ж"), -1, 7 }, { TU(""), 0, 0 } }, 0, 30, 30, "Standard example",
+ /* 0*/ { UNICODE_MODE, -1, -1, { 0, 0, "" }, { { TU("¶"), -1, 0 }, { TU("Ж"), -1, 7 }, { TU(""), 0, 0 } }, ZINT_WARN_USES_ECI, 30, 30, "Standard example (adds ECI 3 for ¶)",
"111111000000111111000000111111"
- "111101011110111111011110111111"
- "100101011110111111011110111111"
- "110011000000100001000000100001"
- "110011000000100001000000100001"
+ "111111011110111111011110111111"
+ "100001011110111111011110111111"
+ "100101000000100001000000100001"
+ "100011000000100001000000100001"
"111111000000111111000000111111"
"000000111111000000111111000000"
- "011100110111010000110001011110"
- "010000111111000110111101011110"
- "000010100001000110110001000000"
- "001000100001001100100001000000"
+ "011110110111010000110001011110"
+ "000110111111000000100011011110"
+ "000100100001001010111011000000"
+ "001110100001010000110111000000"
"000000111111000000111111000000"
"111111000000111111000000111111"
"111101010110101001010000111111"
- "101111011110100001000100111111"
- "100011000000110111011000100001"
- "110111000000100001000000100001"
+ "100001011110100001001110111111"
+ "100011000000111101000000100001"
+ "111111000000100001000000100001"
"111111000000111111000000111111"
"000000111111000000111111000000"
- "011110110111010110110001011010"
- "010110111111011110100001010000"
- "011010100001000000101011011100"
- "001000100001000000110001000110"
+ "011000110111010000110001011110"
+ "011100111111000000100011001010"
+ "000010100001001100101101000010"
+ "011100100001011000100001001110"
"000000111111000000111111000000"
"111111000000111111000000111111"
- "111001011100111111011000111111"
- "100001001100111101001110111011"
- "100001001010111011011110100011"
- "101011000010100001001110100101"
+ "111001011110111011011100111011"
+ "100001010100111101001110110001"
+ "110011001110101111010110110001"
+ "100011001100110011010100100101"
"111111000000111111000000111111"
},
- /* 1*/ { UNICODE_MODE, -1, -1, { 0, 0, "" }, { { TU("¶"), -1, 0 }, { TU("Ж"), -1, 0 }, { TU(""), 0, 0 } }, ZINT_WARN_USES_ECI, 30, 30, "Standard example auto-ECI",
+ /* 1*/ { UNICODE_MODE, -1, -1, { 0, 0, "" }, { { TU("¶"), -1, 0 }, { TU("Ж"), -1, 0 }, { TU(""), 0, 0 } }, ZINT_WARN_USES_ECI, 30, 30, "Standard example auto-ECI (adds ECI-3 from ¶, ECI-29 for Ж)",
"111111000000111111000000111111"
- "111101011110111111011110111111"
- "100101011110111111011110111111"
- "110011000000100001000000100001"
- "110011000000100001000000100001"
+ "111111011110111111011110111111"
+ "100001011110111111011110111111"
+ "100101000000100001000000100001"
+ "100011000000100001000000100001"
"111111000000111111000000111111"
"000000111111000000111111000000"
- "011100110111010000110001011110"
- "010000111111000110111101011110"
- "000010100001000110110001000000"
- "001000100001001100100001000000"
+ "011110110111010000110001011110"
+ "000110111111000000100011011110"
+ "000100100001001010111011000000"
+ "001110100001010000110111000000"
"000000111111000000111111000000"
"111111000000111111000000111111"
"111101010110101001010000111111"
- "101111011110100001000100111111"
- "100011000000110111011000100001"
- "110111000000100001000000100001"
+ "100001011110100001001110111111"
+ "100011000000111101000000100001"
+ "111111000000100001000000100001"
"111111000000111111000000111111"
"000000111111000000111111000000"
- "011110110111010110110001011010"
- "010110111111011110100001010000"
- "011010100001000000101011011100"
- "001000100001000000110001000110"
+ "011000110111010000110001011110"
+ "011100111111000000100011001010"
+ "000010100001001100101101000010"
+ "011100100001011000100001001110"
"000000111111000000111111000000"
"111111000000111111000000111111"
- "111001011100111111011000111111"
- "100001001100111101001110111011"
- "100001001010111011011110100011"
- "101011000010100001001110100101"
+ "111001011110111011011100111011"
+ "100001010100111101001110110001"
+ "110011001110101111010110110001"
+ "100011001100110011010100100101"
"111111000000111111000000111111"
},
- /* 2*/ { UNICODE_MODE, -1, -1, { 0, 0, "" }, { { TU("Ж"), -1, 7 }, { TU("¶"), -1, 0 }, { TU(""), 0, 0 } }, 0, 30, 30, "Standard example inverted",
+ /* 2*/ { UNICODE_MODE, -1, -1, { 0, 0, "" }, { { TU("Ж"), -1, 7 }, { TU("¶"), -1, 0 }, { TU(""), 0, 0 } }, ZINT_WARN_USES_ECI, 30, 30, "Standard example inverted",
"111111000000111111000000111111"
"111001011110111111011110111111"
"101111011110111111011110111111"
@@ -654,146 +656,146 @@ static void test_encode_segs(int index, int generate, int debug) {
},
/* 4*/ { UNICODE_MODE, -1, -1, { 0, 0, "" }, { { TU("product:Google Pixel 4a - 128 GB of Storage - Black;price:$439.97"), -1, 3 }, { TU("品名:Google 谷歌 Pixel 4a -128 GB的存储空间-黑色;零售价:¥3149.79"), -1, 29 }, { TU("Produkt:Google Pixel 4a - 128 GB Speicher - Schwarz;Preis:444,90 €"), -1, 17 } }, 0, 78, 78, "AIM ITS/04-023:2022 Annex A example",
"111111000000111111000000111111000000111111000000111111000000111111000000111111"
- "100101000100100101000110100001000100100101000000100111000010100111000000100001"
- "101001011010100111011110101001011100101111001110100001001110111101000110100101"
- "101111011000100011001010101111000000110001000100110101001010110111001010111001"
- "101011001010110111000010101111011100111011011100101001001100111101000000101101"
+ "100001000100100011000110100011000010100001000100100001000010100111000000100111"
+ "111111001110101001010010111011001010100111010100101011011100101011001010101011"
+ "110111000010100101001000100111010100101011001110111111011100101111000110111011"
+ "111001011000100011010100101011010110101111010100100011011110110101001110111111"
"111111000000111111000000111111000000111111000000111111000000111111000000111111"
"000000111111000000111111000000111111000000111111000000111111000000111111000000"
- "000000111011011010111001011000111001011010111111011010111111011110111011000100"
- "011110101101010010110001000000101111010110111111000000100011011110111111011010"
- "010010100001011010110101001010100011010000101001011110110001000010111111001100"
- "001000100111000000110011001010111111000000110001011100100001011010101011010100"
+ "000010111111011110111001011110111111011010111111011010111111011110111111000010"
+ "011000110001000000110001011110101011010110111111011100100011011110111011001000"
+ "000100101111011010110001000000110011010000101111011110110001000010101111001100"
+ "011100110011000000100001010010111111000000110011011100100001011110101011010110"
"000000111111000000111111000000111111000000111111000000111111000000111111000000"
"111111000000111111000000111111000000111111000000111111000000111111000000111111"
- "100101011000110001010110110111010010110111010000110011010110110111011010100011"
- "111001010010110001001100111011010100111111001110101111011100111101010110110001"
- "111101011110100011000000111001001010100001001010110111000110111111000000101111"
- "111111000010110111010000111011001000100011000010110011011100110101000000110001"
+ "100001011010110001010110110111010010110111010000110101010110110001011010100011"
+ "111101001010100001001100110111001010111111000110101111011100101001010110100111"
+ "100011011010100111001110110011001010101101010000110111001110110101000000110101"
+ "110001010110111111000110100111001000111101001000110011011010100111000000110101"
"111111000000111111000000111111000000111111000000111111000000111111000000111111"
"000000111111000000111111000000111111000000111111000000111111000000111111000000"
- "000100111001010110101101001000101001001000101111001000101011010100111111000110"
- "000010111011011000110011011010111011011110101001011100110101011010111111010000"
- "010010110001000000111011011110101001010010100011010110111011011110100011001010"
- "011110100001000010111111011010110011011010110001011110111111000110101111011110"
+ "000100111011010110101001001000101011001100101111001010101111010100111111000100"
+ "010010101011011000101001011010101111011110101001000010111101000110111111010110"
+ "011100100001000000111011011100111001010010100011001000111011011110101101000100"
+ "010010100001000000111111010100111111011010111101010000111111000110100001010000"
"000000111111000000111111000000111111000000111111000000111111000000111111000000"
"111111000000111111000000111111000000111111000000111111000000111111000000111111"
- "100101011100110111001100100111000100100101000110100111001110110011011100100111"
- "100011010100101111011110110001001110101111010000110001011000111011010010100001"
- "111001010110111001000100101111000000110111000100111111000100101101011110101011"
- "111101011010100011001010100111000100111111000100101101001010100001011110111111"
+ "100011011010110111001000100011000000100101000110100111001110110011011000100101"
+ "101001010010100011001000100101011010101111011010111111011000111011001000101111"
+ "100011011010101001000100101111000000111111011010111111000000100001001110101001"
+ "101101011000100011001110100111000100110111000010101101000100110001011110110011"
"111111000000111111000000111111000000111111000000111111000000111111000000111111"
"000000111111000000111111000000111111000000111111000000111111000000111111000000"
- "000010111111010110101101000000111101011000111101000110101111010110111111000000"
- "001010111111011100100001010000110001000000100111011110110011011110100011001100"
- "010110100111001100101011010110110001010110111101011000111001011100110001010100"
- "000010100101011010101001011110110111011100101111010010100001001110100001010100"
+ "000000111111010100101101000100111101011000111101000110101001010100111111000010"
+ "011100111111001000100001000000101001000000111101011110111101001010100011001010"
+ "000000100111001100101011011110111101010110111001010100101101010100110001011100"
+ "000100111101000000110001010000110001000110110111011000100101011010100001010000"
"000000111111000000111111000000111111000000111111000000111111000000111111000000"
"111111000000111111000000111111000000111111000000111111000000111111000000111111"
- "100101011010110111001100100011011000110101011010100001001010110001011110100011"
- "110111011010111011011100100011011100111111010110111111000000110001011110110011"
- "110111010000110011001110111001010110101101001000111101010100100011001110110011"
- "101111000000111111011000100101010110100001011010110001001000100001011110111111"
+ "100111011010110111001100100011011000110111011000100111001000110001011110100011"
+ "110101011000111011001100100011011100110001010010111101000000111001011110100101"
+ "100111010000110001001110111011010000111101011000100011010100110011001010111101"
+ "111101000000100101011000100011001000100001011010100111001000100001001010111101"
"111111000000111111000000111111000000111111000000111111000000111111000000111111"
"000000111111000000111111000000111111000000111111000000111111000000111111000000"
- "000110111001010100101101000100111011011010111111000010101101010000111011000000"
- "011000111001001010111001010000100101010110111001001110101111001100101101001010"
- "011010110101000010110011011010101011000010101101011100111101001010101111010110"
- "011010101001001010101101011110111001010010101101000100101001000010100101000100"
+ "000010111111010010101101000100111001011110111111000110101101010000111101000110"
+ "001110110101000110100111011110101101011110111001010010101111001100101111010100"
+ "000100100101000010110011011010111011010100100001011100111001001110101111010100"
+ "001100101001001010101001011110111001011100110111000100110001001100100101010100"
"000000111111000000111111000000111111000000111111000000111111000000111111000000"
"111111000000111111000000111111000000111111000000111111000000111111000000111111"
- "100001011110110111001000100101000010100011000010100001001010110001011100100011"
- "110011011110100001001000100001001010110111010100101101000000110001011110101101"
- "110001001110111001001110100111001000101011011100100111000000111011010000100001"
- "111011001000101111011010110111011110110011001100111111010000110111000000100111"
+ "100101011110110001001000100111000010100001000000100001001110110111011100100011"
+ "101001011110101001001000101001001010111101010000101101011100111111011110100111"
+ "101011000100110111001110111101000000111011010010100001011110111001010000111001"
+ "110011010110111111000000110001011110110011010110101001011110110111000000110101"
"111111000000111111000000111111000000111111000000111111000000111111000000111111"
"000000111111000000111111000000111111000000111111000000111111000000111111000000"
- "000110111111010000101001001100101111001100101101001100101111010010111111000010"
- "000110100111000000100111011010100001011110101001011010111101011010111111000000"
- "001010110001011100100101001110100001011100111001000100101011000100100001001000"
- "000000100001010010100011001110111111001110100001000110111111001110100011001010"
+ "000100111111010000101111001010101111001000101111001100101011010110111111000000"
+ "011100100111000000100101000100100001011110101101011010111011011010111111011010"
+ "010010110001011100100101010000101001001100110011001010101011000100101011011110"
+ "011010100001000000100011010100111011001110110001001110111111001110111001000010"
"000000111111000000111111000000111111000000111111000000111111000000111111000000"
"111111000000111111000000111111000000111111000000111111000000111111000000111111"
- "100001011010110001010100110011010010110111010100110011010010110101011000100011"
- "111111010100100111001110111111010010110101011000110011011110111011001010100111"
- "111001011110110101011010100111011010110111011100101111001100100001001100100111"
- "110011011100111001011100101111000000101011011110111011011010110011010110111001"
+ "100001011000110001010110110011010100110101010100110101010010110101011100100101"
+ "111011010100100011011110111111010100101111011000110001011100111011010010100011"
+ "100001011110110101011010100001011010100001011110101111000110100101011100111011"
+ "100111011100111001010100110011000000111011011100111011010000110111010110110111"
"111111000000111111000000111111000000111111000000111111000000111111000000111111"
"000000111111000000111111000000111111000000111111000000111111000000111111000000"
- "000000111111011110111101011110111001011010111111011110111111011110111001000010"
- "001100111111000000111011011110101101011110111111000000101011011110100001000010"
- "010010101111010000110111000000110001010110101001000000110111001010100001000110"
- "000100111111000000101111010110100001011110110101000000110101010010100001001000"
+ "000100111111011110111011011110111001011110111111011110111101011110111001000110"
+ "010100111111000000100001011110101101011010111111000000111101011110100001011010"
+ "000000101001010000110111000100110001010010101011000000110111001110100001010110"
+ "001100110111000000101111011110100001001110111111000000110101010000100001010010"
"000000111111000000111111000000111111000000111111000000111111000000111111000000"
"111111000000111111000000111111000000111111000000111111000000111111000000111111"
- "100111000110100111000110100101000110100101000100100011000100100111000100100011"
- "110011011100111011000100100011001010111001000110110101001100110011000110100001"
- "111001000010100011001010100001000010100111010110111011000000110101011100110111"
- "110111001010111011001010101011001000101111011110111001011010111111010100111111"
+ "100111000010100111000110100001000000100011000000100111000110100001000100100111"
+ "101101010110100111000010111111001000100011001010101011011110110011011100100101"
+ "101001001000110101000110111011010000100111010100110101000100101111001100111011"
+ "110011010110101111001110110111010000100111010010110111000100111111000010100001"
"111111000000111111000000111111000000111111000000111111000000111111000000111111"
},
- /* 5*/ { DATA_MODE, -1, -1, { 0, 0, "" }, { { TU("\266"), 1, 0 }, { TU("\266"), 1, 7 }, { TU("\266"), 1, 0 } }, 0, 30, 30, "Standard example + extra seg, data mode",
+ /* 5*/ { DATA_MODE, -1, -1, { 0, 0, "" }, { { TU("\266"), 1, 0 }, { TU("\266"), 1, 7 }, { TU("\266"), 1, 0 } }, 0, 30, 30, "Standard example + extra seg, data mode (ECIs 0, 7, 29)",
"111111000000111111000000111111"
- "111101011110111111011110111111"
- "111011011110111111011110111111"
- "111101000000100001000000100001"
- "101001000000100001000000100001"
- "111111000000111111000000111111"
- "000000111111000000111111000000"
- "011010110111010000110001011110"
- "000010111111000110111101011110"
- "001010100001000110110001000000"
- "011100100001001100100001000000"
- "000000111111000000111111000000"
- "111111000000111111000000111111"
- "111111010000101001010000111111"
- "101111000000100001000100111111"
- "110001001100110111011000100001"
+ "111111011110111111011110111111"
+ "101111011110111111011110111111"
"101111000000100001000000100001"
+ "101011000000100001000000100001"
"111111000000111111000000111111"
"000000111111000000111111000000"
- "011110110001010010110001011010"
- "010100110111010110111001001100"
- "000110100001000000101011010010"
- "010000100001000000110001000110"
+ "011100110111010000110001011110"
+ "010010111111000110111101011110"
+ "011100100001000110110001000000"
+ "010110100001001100100001000000"
"000000111111000000111111000000"
"111111000000111111000000111111"
- "111011011010111101011010111111"
- "111001000110101111011000101001"
- "111101011000111011010010111011"
- "101101011100110001001000111001"
+ "111101010000101001010000111111"
+ "100101000000100001000100111111"
+ "100001001100110111011000100001"
+ "110101000000100001000000100001"
+ "111111000000111111000000111111"
+ "000000111111000000111111000000"
+ "011000110001010100110001011000"
+ "001110110111010110111001011010"
+ "000110100001000000101011000010"
+ "010100100001000110110001010100"
+ "000000111111000000111111000000"
+ "111111000000111111000000111111"
+ "111011011000111101011100111011"
+ "100001001100100101010110101101"
+ "101111000000110001001000111001"
+ "100111010100111001001110101011"
"111111000000111111000000111111"
},
- /* 6*/ { UNICODE_MODE, -1, -1, { 1, 16, "" }, { { TU("齄齄"), -1, 29 }, { TU("Τεχτ"), -1, 0 }, { TU("Text"), -1, 0 } }, ZINT_WARN_USES_ECI, 30, 30, "Structured Append",
+ /* 6*/ { UNICODE_MODE, -1, -1, { 1, 16, "" }, { { TU("齄齄"), -1, 29 }, { TU("Τεχτ"), -1, 0 }, { TU("Text"), -1, 0 } }, 0, 30, 30, "Structured Append (ECIs 29, 0, 0)",
"111111000000111111000000111111"
- "111011011000111101011010111111"
- "101011000000101111001110100001"
- "111011000010110111011100100011"
- "110101010000101001000100111101"
+ "111001011010111011011000111111"
+ "111011011110111101000000111111"
+ "101111010010100001001110100001"
+ "110111000100110011010110100001"
"111111000000111111000000111111"
"000000111111000000111111000000"
- "011000110101010000110111011110"
- "010110110001000010111111011110"
- "011010100111011010111111000000"
- "011100111111010000110111000000"
+ "011100110111010110110101011110"
+ "010000110001000100101011011110"
+ "010010101111011000111111000000"
+ "011000111111001110101111000000"
"000000111111000000111111000000"
"111111000000111111000000111111"
- "111011010100101001010110111111"
- "111111011110101111011110111111"
- "100101010010101101011010100001"
- "100101011000100001011100100001"
+ "111001010000101001010110111111"
+ "110101000100101111011000111111"
+ "111001001100101101001100100001"
+ "110001000010100001011110100001"
"111111000000111111000000111111"
"000000111111000000111111000000"
- "011100110111010010110011011100"
- "010110110101001100110001011000"
- "000100110001000000101111010100"
- "000100100011000100100001001010"
+ "011100110101010010110001011010"
+ "011010100011000000101111011100"
+ "001100100101001000110001000010"
+ "001100110001011000100101011100"
"000000111111000000111111000000"
"111111000000111111000000111111"
- "111011011010111001011000111011"
- "111001010110100101011000111001"
- "110111000010101001011100110011"
- "100011011010111011001110101011"
+ "111001011000111011011100111101"
+ "111011011010111111001110111101"
+ "101111001100111001001000101011"
+ "101101010000100101000000110001"
"111111000000111111000000111111"
},
};
diff --git a/backend/tests/test_hanxin.c b/backend/tests/test_hanxin.c
index a87b3670..5f492d72 100644
--- a/backend/tests/test_hanxin.c
+++ b/backend/tests/test_hanxin.c
@@ -183,7 +183,7 @@ static void test_input(int index, int generate, int debug) {
struct item data[] = {
/* 0*/ { UNICODE_MODE, 0, -1, "é", -1, 0, 0, "30 00 F4 80 00 00 00 00 00", 1, "B1 (ISO 8859-1)" },
/* 1*/ { UNICODE_MODE, 3, -1, "é", -1, 0, 3, "80 33 00 0F 48 00 00 00 00", 1, "ECI-3 B1 (ISO 8859-1)" },
- /* 2*/ { UNICODE_MODE, 29, -1, "é", -1, 0, 29, "81 D3 00 15 45 30 00 00 00", 1, "ECI-29 B2 (GB 2312)" },
+ /* 2*/ { UNICODE_MODE, 29, -1, "é", -1, 0, 29, "81 D4 FC FF FF 00 00 00 00", 1, "ECI-29 H(1)1 (GB 2312)" },
/* 3*/ { UNICODE_MODE, 32, -1, "é", -1, 0, 32, "82 04 FC FF FF 00 00 00 00", 1, "ECI-32 H(1)1 (GB 18030) (Region One)" },
/* 4*/ { UNICODE_MODE, 26, -1, "é", -1, 0, 26, "81 A3 00 16 1D 48 00 00 00", 1, "ECI-26 B2 (UTF-8)" },
/* 5*/ { UNICODE_MODE, 26, ZINT_FULL_MULTIBYTE, "é", -1, 0, 26, "81 A4 70 2F FF 00 00 00 00", 1, "ECI-26 H(1)1 (Region One) (UTF-8) (full multibyte)" },
@@ -254,10 +254,10 @@ static void test_input(int index, int generate, int debug) {
/* 70*/ { UNICODE_MODE, 28, -1, "龘", -1, 0, 28, "81 C3 00 17 CE A8 00 00 00", 1, "ECI-28 B2 (Big5)" },
/* 71*/ { UNICODE_MODE, 28, -1, "龘龘", -1, 0, 28, "81 C3 00 27 CE AF CE A8 00", 1, "ECI-28 B4 (Big5)" },
/* 72*/ { UNICODE_MODE, 0, -1, "齄", -1, ZINT_WARN_NONCOMPLIANT, 0, "Warning 5B BF FF F0 00 00 00 00 00", 1, "H(2)1 (GB 18030)" },
- /* 73*/ { UNICODE_MODE, 29, -1, "齄", -1, 0, 29, "81 D3 00 17 BF F0 00 00 00", 1, "ECI-29 B2 (GB 2312)" },
- /* 74*/ { UNICODE_MODE, 32, -1, "齄", -1, 0, 32, "82 05 BB FF FF 00 00 00 00", 1, "ECI-32 H(2)1 (GB 2312)" },
- /* 75*/ { UNICODE_MODE, 29, -1, "齄齄", -1, 0, 29, "81 D3 00 27 BF F7 BF F0 00", 1, "ECI-29 B4 (GB 2312)" },
- /* 76*/ { UNICODE_MODE, 32, -1, "齄齄", -1, 0, 32, "82 05 BB FB BF FF F0 00 00", 1, "ECI-32 H(2)2 (GB 2312)" },
+ /* 73*/ { UNICODE_MODE, 29, -1, "齄", -1, 0, 29, "81 D5 BB FF FF 00 00 00 00", 1, "ECI-29 H(2)1 (GB 2312)" },
+ /* 74*/ { UNICODE_MODE, 32, -1, "齄", -1, 0, 32, "82 05 BB FF FF 00 00 00 00", 1, "ECI-32 H(2)1 (GB 18030)" },
+ /* 75*/ { UNICODE_MODE, 29, -1, "齄齄", -1, 0, 29, "81 D5 BB FB BF FF F0 00 00", 1, "ECI-29 H(2)2 (GB 2312)" },
+ /* 76*/ { UNICODE_MODE, 32, -1, "齄齄", -1, 0, 32, "82 05 BB FB BF FF F0 00 00", 1, "ECI-32 H(2)2 (GB 18030)" },
/* 77*/ { UNICODE_MODE, 0, -1, "가", -1, ZINT_WARN_NONCOMPLIANT, 0, "Warning 70 2B 5E 80 00 00 00 00 00", 1, "H(f)1 (GB 18030)" },
/* 78*/ { UNICODE_MODE, 30, -1, "가", -1, 0, 30, "81 E3 00 15 85 08 00 00 00", 1, "ECI-30 T2 (EUC-KR)" },
/* 79*/ { UNICODE_MODE, 30, -1, "가가", -1, 0, 30, "81 E3 00 25 85 0D 85 08 00", 1, "ECI-30 B4 (EUC-KR)" },
@@ -2590,52 +2590,52 @@ static void test_encode(int index, int generate, int debug) {
"11101010110101000000001"
"11101010101010001111111"
},
- /* 63*/ { UNICODE_MODE, 29, 2, -1, -1, "条码", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 29 Example 1 **NOT SAME** example uses Region One mode",
+ /* 63*/ { UNICODE_MODE, 29, 2, -1, -1, "条码", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 29 Example 1 same",
"11111110011010101111111"
"10000000010001100000001"
"10111110001010001111101"
"10100000111000100000101"
- "10101110001100001110101"
+ "10101110000010001110101"
"10101110110101101110101"
- "10101110001010001110101"
- "00000000110101000000000"
+ "10101110001111001110101"
+ "00000000111100000000000"
"00010101001010100000000"
- "01010001100101010101100"
- "11011111110100000100011"
- "00110101111011110100111"
- "11001011011001101010100"
- "10110111010101000100100"
+ "01001101100101010100100"
+ "11000011111001010101010"
+ "11001010110100101101110"
+ "10101000001100101010100"
+ "11011011010101000101111"
"00000000101010010101000"
- "00000000010101100000000"
- "11111110000010001110101"
- "00000010110101101110101"
+ "00000000010111100000000"
+ "11111110011001001110101"
+ "00000010100101101110101"
"11111010001011001110101"
- "00001010111110100000101"
- "11101010000010001111101"
+ "00001010110100100000101"
+ "11101010001010001111101"
"11101010110101000000001"
"11101010101010001111111"
},
- /* 64*/ { UNICODE_MODE, 29, 2, -1, -1, "北京", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 29 Example 2 **NOT SAME** example uses Region One mode",
+ /* 64*/ { UNICODE_MODE, 29, 2, -1, -1, "北京", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 29 Example 2 same",
"11111110011010101111111"
"10000000010001100000001"
"10111110001010001111101"
"10100000111000100000101"
- "10101110001100001110101"
+ "10101110000010001110101"
"10101110110101101110101"
"10101110001010001110101"
- "00000000110101000000000"
+ "00000000110011000000000"
"00010101001010100000000"
- "01010001111101010100010"
- "01111010001100100111001"
- "01011010111110000010111"
- "10001011100010101010100"
- "01011111010101000110101"
+ "01001001111101010101000"
+ "01101101100001010101011"
+ "00011010110101110011010"
+ "10101010111001101010100"
+ "00010101010101010101001"
"00000000101010010101000"
- "00000000010110100000000"
- "11111110001001001110101"
- "00000010110101101110101"
- "11111010001011001110101"
- "00001010100110100000101"
+ "00000000010111100000000"
+ "11111110011101001110101"
+ "00000010100101101110101"
+ "11111010001010001110101"
+ "00001010100011100000101"
"11101010010010001111101"
"11101010110101000000001"
"11101010101010001111111"
@@ -2665,7 +2665,32 @@ static void test_encode(int index, int generate, int debug) {
"11101010110101000000001"
"11101010101010001111111"
},
- /* 66*/ { UNICODE_MODE, 30, 2, -1, -1, "서울", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 30 Example 2 **NOT SAME** example uses Region One mode",
+ /* 66*/ { UNICODE_MODE, 30, 2, -1, ZINT_FULL_MULTIBYTE | (4 << 8), "바코드", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 30 Example 1 same with FULL_MULTIBYTE and explicit mask 11 (auto 01)",
+ "11111110111101101111111"
+ "10000000100011000000001"
+ "10111110000000101111101"
+ "10100000110110100000101"
+ "10101110110000001110101"
+ "10101110100111001110101"
+ "10101110111000101110101"
+ "00000000111111100000000"
+ "00010101000111010000000"
+ "00010110100000111001110"
+ "10000101011111100110110"
+ "11100000110001000100111"
+ "10111011100001111000111"
+ "11010111101101010101000"
+ "00000001010010010101000"
+ "00000000110011100000000"
+ "11111110100101101110101"
+ "00000010011101101110101"
+ "11111010001100101110101"
+ "00001010110010100000101"
+ "11101010100010001111101"
+ "11101010011010100000001"
+ "11101010111010101111111"
+ },
+ /* 67*/ { UNICODE_MODE, 30, 2, -1, -1, "서울", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 30 Example 2 **NOT SAME** example uses Region One mode",
"11111110011010101111111"
"10000000010001100000001"
"10111110001010001111101"
@@ -2690,57 +2715,82 @@ static void test_encode(int index, int generate, int debug) {
"11101010110101000000001"
"11101010101010001111111"
},
- /* 67*/ { UNICODE_MODE, 31, 2, -1, -1, "条码", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 31 Example 1 **NOT SAME** example uses Region One mode",
+ /* 68*/ { UNICODE_MODE, 30, 2, -1, ZINT_FULL_MULTIBYTE, "서울", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 30 Example 2 same with FULL_MULTIBYTE",
+ "11111110011010101111111"
+ "10000000010001100000001"
+ "10111110001010001111101"
+ "10100000111011100000101"
+ "10101110000010001110101"
+ "10101110110101101110101"
+ "10101110001000001110101"
+ "00000000110010000000000"
+ "00010101001010100000000"
+ "01011101111101010100111"
+ "10101111100101010101111"
+ "11000010110101111101010"
+ "10101001001000101010101"
+ "11111001010101000101000"
+ "00000000101010010101000"
+ "00000000010110100000000"
+ "11111110001001001110101"
+ "00000010100101101110101"
+ "11111010001011001110101"
+ "00001010111101100000101"
+ "11101010011010001111101"
+ "11101010110101000000001"
+ "11101010101010001111111"
+ },
+ /* 69*/ { UNICODE_MODE, 31, 2, -1, 2 << 8, "条码", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 31 Example 1 same with explicit mask 01 (auto 11)",
"11111110011010101111111"
"10000000010001100000001"
"10111110001010001111101"
"10100000111010100000101"
- "10101110001100001110101"
+ "10101110000010001110101"
"10101110110101101110101"
- "10101110001010001110101"
- "00000000110101000000000"
+ "10101110001111001110101"
+ "00000000111100000000000"
"00010101001010100000000"
- "01010001100101010101100"
- "11010000010000000100100"
- "11111101111010110010011"
- "11001010010100101010100"
- "00111011010101001010101"
+ "01001101100101010100100"
+ "11001100011101010101101"
+ "00000010110101101011010"
+ "10101001000001101010100"
+ "01010111010101001011110"
"00000000101010010101000"
- "00000000010101100000000"
- "11111110010111001110101"
- "00000010100101101110101"
+ "00000000010111100000000"
+ "11111110001100001110101"
+ "00000010110101101110101"
"11111010001011001110101"
- "00001010100111100000101"
- "11101010010010001111101"
+ "00001010101101100000101"
+ "11101010011010001111101"
"11101010110101000000001"
"11101010101010001111111"
},
- /* 68*/ { UNICODE_MODE, 31, 2, -1, -1, "北京", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 31 Example 2 **NOT SAME** example uses Region One mode",
- "11111110011001001111111"
- "10000000000000000000001"
- "10111110011111101111101"
- "10100000000110000000101"
- "10101110000010001110101"
- "10101110011111001110101"
- "10101110101001101110101"
- "00000000100100100000000"
- "00010101011111101000000"
- "01001101100001001000001"
- "11111011100110101001111"
- "00111000010101101110110"
- "01101001001100001001000"
- "10100010100100111001010"
- "00000010111111010101000"
- "00000000101010100000000"
- "11111110110010101110101"
- "00000010001111001110101"
- "11111010001000001110101"
- "00001010001110000000101"
- "11101010110111001111101"
- "11101010001001000000001"
- "11101010000100001111111"
+ /* 70*/ { UNICODE_MODE, 31, 2, -1, 4 << 8, "北京", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 31 Example 2 same with explicit mask 11 (auto 10)",
+ "11111110111101101111111"
+ "10000000100011000000001"
+ "10111110000000101111101"
+ "10100000110111100000101"
+ "10101110110000001110101"
+ "10101110100111001110101"
+ "10101110111001101110101"
+ "00000000100001100000000"
+ "00010101000111010000000"
+ "00000110110000111000101"
+ "01010010110000111000010"
+ "01000010001110100111100"
+ "01000100110000111000110"
+ "00001011101101001001010"
+ "00000001010010010101000"
+ "00000000110000100000000"
+ "11111110110000101110101"
+ "00000010001101101110101"
+ "11111010001101101110101"
+ "00001010100010100000101"
+ "11101010111010001111101"
+ "11101010011010100000001"
+ "11101010111010101111111"
},
- /* 69*/ { UNICODE_MODE, 31, 2, -1, -1, "條碼", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 31 Example 3 **NOT SAME** example uses 2-byte Region mode",
+ /* 71*/ { UNICODE_MODE, 31, 2, -1, -1, "條碼", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 31 Example 3 **NOT SAME** example uses 2-byte Region mode, Zint binary (same bit count)",
"11111110011001001111111"
"10000000000000000000001"
"10111110011111101111101"
@@ -2765,7 +2815,7 @@ static void test_encode(int index, int generate, int debug) {
"11101010001001000000001"
"11101010000100001111111"
},
- /* 70*/ { UNICODE_MODE, 32, 2, -1, 2 << 8, "条码", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 32 Example 1 same with explicit mask 01 (auto 10)",
+ /* 72*/ { UNICODE_MODE, 32, 2, -1, 2 << 8, "条码", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 32 Example 1 same with explicit mask 01 (auto 10)",
"11111110011010101111111"
"10000000011101100000001"
"10111110001010001111101"
@@ -2790,7 +2840,7 @@ static void test_encode(int index, int generate, int debug) {
"11101010110101000000001"
"11101010101010001111111"
},
- /* 71*/ { UNICODE_MODE, 32, 2, -1, 4 << 8, "北京", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 32 Example 2 same with explicit mask 11 (auto 01)",
+ /* 73*/ { UNICODE_MODE, 32, 2, -1, 4 << 8, "北京", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 32 Example 2 same with explicit mask 11 (auto 01)",
"11111110111101101111111"
"10000000101111000000001"
"10111110000000101111101"
@@ -2815,7 +2865,7 @@ static void test_encode(int index, int generate, int debug) {
"11101010011010100000001"
"11101010111010101111111"
},
- /* 72*/ { UNICODE_MODE, 32, 2, -1, -1, "條碼", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 32 Example 3 **NOT SAME** example uses 2-byte Region mode",
+ /* 74*/ { UNICODE_MODE, 32, 2, -1, -1, "條碼", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 32 Example 3 **NOT SAME** example uses 2-byte Region mode, Zint binary (same bit count)",
"11111110011001001111111"
"10000000001100000000001"
"10111110011111101111101"
@@ -2840,7 +2890,7 @@ static void test_encode(int index, int generate, int debug) {
"11101010001001000000001"
"11101010000100001111111"
},
- /* 73*/ { UNICODE_MODE, 32, 2, -1, 2 << 8, "པེ་ཅིང།", -1, 0, 25, 25, "AIM ITS/04-023:2022 ECI 32 Example 4 same with explicit mask 01 (auto 10)",
+ /* 75*/ { UNICODE_MODE, 32, 2, -1, 2 << 8, "པེ་ཅིང།", -1, 0, 25, 25, "AIM ITS/04-023:2022 ECI 32 Example 4 same with explicit mask 01 (auto 10)",
"1111111011101011001111111"
"1000000001011100000000001"
"1011111011000010001111101"
@@ -2867,7 +2917,7 @@ static void test_encode(int index, int generate, int debug) {
"1110101001100100000000001"
"1110101001001010101111111"
},
- /* 74*/ { UNICODE_MODE, 32, 2, -1, -1, "バーコード", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 32 Example 5 same",
+ /* 76*/ { UNICODE_MODE, 32, 2, -1, -1, "バーコード", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 32 Example 5 same",
"11111110111101101111111"
"10000000101100000000001"
"10111110000000101111101"
@@ -2892,7 +2942,7 @@ static void test_encode(int index, int generate, int debug) {
"11101010000101100000001"
"11101010111010101111111"
},
- /* 75*/ { UNICODE_MODE, 32, 2, -1, -1, "바코드", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 32 Example 6 same",
+ /* 77*/ { UNICODE_MODE, 32, 2, -1, -1, "바코드", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 32 Example 6 same",
"11111110111101101111111"
"10000000101111000000001"
"10111110000000101111101"
@@ -2917,7 +2967,7 @@ static void test_encode(int index, int generate, int debug) {
"11101010011010100000001"
"11101010111010101111111"
},
- /* 76*/ { UNICODE_MODE, 33, 2, -1, 4 << 8, "条码", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 33 Example 1 same with explicit mask 11 (auto 10)",
+ /* 78*/ { UNICODE_MODE, 33, 2, -1, 4 << 8, "条码", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 33 Example 1 same with explicit mask 11 (auto 10)",
"11111110111101101111111"
"10000000101111000000001"
"10111110000000101111101"
@@ -2942,7 +2992,7 @@ static void test_encode(int index, int generate, int debug) {
"11101010011010100000001"
"11101010111010101111111"
},
- /* 77*/ { UNICODE_MODE, 33, 2, -1, -1, "バーコード", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 33 Example 2 same",
+ /* 79*/ { UNICODE_MODE, 33, 2, -1, -1, "バーコード", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 33 Example 2 same",
"11111110111101101111111"
"10000000101101000000001"
"10111110000000101111101"
@@ -2967,7 +3017,7 @@ static void test_encode(int index, int generate, int debug) {
"11101010010011100000001"
"11101010111010101111111"
},
- /* 78*/ { UNICODE_MODE, 33, 2, -1, 2 << 8, "바코드", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 33 Example 3 same with explicit mask 01 (auto 11)",
+ /* 80*/ { UNICODE_MODE, 33, 2, -1, 2 << 8, "바코드", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 33 Example 3 same with explicit mask 01 (auto 11)",
"11111110011010101111111"
"10000000011101100000001"
"10111110001010001111101"
@@ -2992,7 +3042,7 @@ static void test_encode(int index, int generate, int debug) {
"11101010110101000000001"
"11101010101010001111111"
},
- /* 79*/ { UNICODE_MODE, 34, 2, -1, 4 << 8, "条码", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 34 Example 1 same with explicit mask 11 (auto 10)",
+ /* 81*/ { UNICODE_MODE, 34, 2, -1, 4 << 8, "条码", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 34 Example 1 same with explicit mask 11 (auto 10)",
"11111110111101101111111"
"10000000101111000000001"
"10111110000000101111101"
@@ -3017,7 +3067,7 @@ static void test_encode(int index, int generate, int debug) {
"11101010011010100000001"
"11101010111010101111111"
},
- /* 80*/ { UNICODE_MODE, 34, 2, -1, 2 << 8, "バーコード", -1, 0, 25, 25, "AIM ITS/04-023:2022 ECI 34 Example 2 same with explicit mask 01 (auto 10)",
+ /* 82*/ { UNICODE_MODE, 34, 2, -1, 2 << 8, "バーコード", -1, 0, 25, 25, "AIM ITS/04-023:2022 ECI 34 Example 2 same with explicit mask 01 (auto 10)",
"1111111011101011001111111"
"1000000001010101000000001"
"1011111010001110001111101"
@@ -3044,7 +3094,7 @@ static void test_encode(int index, int generate, int debug) {
"1110101001110101000000001"
"1110101000101010101111111"
},
- /* 81*/ { UNICODE_MODE, 34, 2, -1, 4 << 8, "바코드", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 34 Example 3 same with explicit mask 11 (auto 01)",
+ /* 83*/ { UNICODE_MODE, 34, 2, -1, 4 << 8, "바코드", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 34 Example 3 same with explicit mask 11 (auto 01)",
"11111110111101101111111"
"10000000101111000000001"
"10111110000010101111101"
@@ -3069,7 +3119,7 @@ static void test_encode(int index, int generate, int debug) {
"11101010011010100000001"
"11101010111010101111111"
},
- /* 82*/ { UNICODE_MODE, 35, 2, -1, 2 << 8, "条码", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 35 Example 1 same with explicit mask 01 (auto 11)",
+ /* 84*/ { UNICODE_MODE, 35, 2, -1, 2 << 8, "条码", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 35 Example 1 same with explicit mask 01 (auto 11)",
"11111110011010101111111"
"10000000011101100000001"
"10111110001010001111101"
@@ -3094,7 +3144,7 @@ static void test_encode(int index, int generate, int debug) {
"11101010110101000000001"
"11101010101010001111111"
},
- /* 83*/ { UNICODE_MODE, 35, 2, -1, -1, "バーコード", -1, 0, 25, 25, "AIM ITS/04-023:2022 ECI 35 Example 2 same",
+ /* 85*/ { UNICODE_MODE, 35, 2, -1, -1, "バーコード", -1, 0, 25, 25, "AIM ITS/04-023:2022 ECI 35 Example 2 same",
"1111111011101011001111111"
"1000000001110101000000001"
"1011111010100100001111101"
@@ -3121,7 +3171,7 @@ static void test_encode(int index, int generate, int debug) {
"1110101000101100000000001"
"1110101000001010101111111"
},
- /* 84*/ { UNICODE_MODE, 35, 2, -1, 4 << 8, "바코드", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 35 Example 3 same with explicit mask 11 (auto 01)",
+ /* 86*/ { UNICODE_MODE, 35, 2, -1, 4 << 8, "바코드", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 35 Example 3 same with explicit mask 11 (auto 01)",
"11111110111101101111111"
"10000000101101000000001"
"10111110010000101111101"
@@ -3146,7 +3196,7 @@ static void test_encode(int index, int generate, int debug) {
"11101010011111100000001"
"11101010111010101111111"
},
- /* 85*/ { UNICODE_MODE, 170, 2, -1, -1, "sn:7QPB4MN", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 170 Example 1 same",
+ /* 87*/ { UNICODE_MODE, 170, 2, -1, -1, "sn:7QPB4MN", -1, 0, 23, 23, "AIM ITS/04-023:2022 ECI 170 Example 1 same",
"11111110111100101111111"
"10000000100111000000001"
"10111110000000101111101"
@@ -3171,7 +3221,7 @@ static void test_encode(int index, int generate, int debug) {
"11101010000110100000001"
"11101010111010101111111"
},
- /* 86*/ { DATA_MODE, 899, 2, -1, -1, "\000\001\002\133\134\135\375\376\377", 9, 0, 23, 23, "AIM ITS/04-023:2022 ECI 899 Example 1 same",
+ /* 88*/ { DATA_MODE, 899, 2, -1, -1, "\000\001\002\133\134\135\375\376\377", 9, 0, 23, 23, "AIM ITS/04-023:2022 ECI 899 Example 1 same",
"11111110011011101111111"
"10000000010110100000001"
"10111110010110001111101"
diff --git a/backend/tests/test_qr.c b/backend/tests/test_qr.c
index c5dacf5b..94408898 100644
--- a/backend/tests/test_qr.c
+++ b/backend/tests/test_qr.c
@@ -4523,6 +4523,7 @@ static void test_microqr_input(int index, int generate, int debug) {
int ret;
char *expected;
int bwipp_cmp;
+ int zxingcpp_cmp;
char *comment;
};
// é U+00E9 in ISO 8859-1 plus other ISO 8859 (but not in ISO 8859-7 or ISO 8859-11), Win 1250 plus other Win, not in Shift JIS, UTF-8 C3A9
@@ -4539,47 +4540,47 @@ static void test_microqr_input(int index, int generate, int debug) {
// 茗 U+8317 kanji, in Shift JIS 0xE4AA (\344\252), UTF-8 E88C97
// Á U+00C1, UTF-8 C381; ȁ U+0201, UTF-8 C881; Ȃ U+0202, UTF-8 C882; ¢ U+00A2, UTF-8 C2A2; á U+00E1, UTF-8 C3A1
struct item data[] = {
- /* 0*/ { UNICODE_MODE, 2, 1, "é", 0, "87 A4 00 EC 11 EC 11 EC 00", 1, "B1 (ISO 8859-1)" },
- /* 1*/ { DATA_MODE, 2, -1, "é", 0, "8B 0E A4 00 EC 11 EC 11 00", 1, "B2 (UTF-8)" },
- /* 2*/ { UNICODE_MODE, 2, -1, "β", 0, "C8 80 00 00 EC 11 EC 11 00", 1, "K1 (Shift JIS)" },
- /* 3*/ { UNICODE_MODE, 2, -1, "ก", ZINT_ERROR_INVALID_DATA, "Error 800: Invalid character in input data", 1, "ก not in Shift JIS" },
- /* 4*/ { UNICODE_MODE, 2, -1, "Ж", 0, "C8 91 C0 00 EC 11 EC 11 00", 1, "K1 (Shift JIS)" },
- /* 5*/ { UNICODE_MODE, 2, -1, "ກ", ZINT_ERROR_INVALID_DATA, "Error 800: Invalid character in input data", 1, "ກ not in Shift JIS" },
- /* 6*/ { UNICODE_MODE, 2, -1, "\\", 0, "85 70 00 EC 11 EC 11 EC 00", 1, "B1 (ASCII)" },
- /* 7*/ { UNICODE_MODE, 2, -1, "¥", 0, "86 94 00 EC 11 EC 11 EC 00", 1, "B1 (ISO 8859-1) (same bytes as ・ Shift JIS below, so ambiguous)" },
- /* 8*/ { UNICODE_MODE, 2, -1, "・", 0, "86 94 00 EC 11 EC 11 EC 00", 1, "B1 (Shift JIS) single-byte codepoint A5 (same bytes as ¥ ISO 8859-1 above, so ambiguous)" },
- /* 9*/ { UNICODE_MODE, 2, -1, "¿", 0, "86 FC 00 EC 11 EC 11 EC 00", 1, "B1 (ISO 8859-1) (same bytes as ソ Shift JIS below, so ambiguous)" },
- /* 10*/ { UNICODE_MODE, 2, -1, "ソ", 0, "86 FC 00 EC 11 EC 11 EC 00", 1, "B1 (Shift JIS) (same bytes as ¿ ISO 8859-1 above, so ambiguous)" },
- /* 11*/ { UNICODE_MODE, 2, -1, "~", 0, "85 F8 00 EC 11 EC 11 EC 00", 1, "B1 (ASCII) (same bytes as ‾ Shift JIS below, so ambiguous)" },
- /* 12*/ { UNICODE_MODE, 2, -1, "‾", 0, "85 F8 00 EC 11 EC 11 EC 00", 1, "B1 (Shift JIS) (same bytes as ~ ASCII above, so ambiguous)" },
- /* 13*/ { UNICODE_MODE, 2, -1, "点", 0, "CB 67 C0 00 EC 11 EC 11 00", 1, "K1 (Shift JIS)" },
- /* 14*/ { DATA_MODE, 2, -1, "\223\137", 0, "8A 4D 7C 00 EC 11 EC 11 00", 0, "B2 (Shift JIS); BWIPP uses Kanji (ZINT_FULL_MULTIBYTE) mode, see below)" },
- /* 15*/ { DATA_MODE, 2, ZINT_FULL_MULTIBYTE, "\223\137", 0, "CB 67 C0 00 EC 11 EC 11 00", 1, "K1 (Shift JIS) (full multibyte)" },
- /* 16*/ { DATA_MODE, 2, -1, "点", 0, "8F 9E 0A E4 00 EC 11 EC 00", 1, "B3 (UTF-8)" },
- /* 17*/ { UNICODE_MODE, 2, -1, "茗", 0, "CE AA 80 00 EC 11 EC 11 00", 1, "K1 (Shift JIS)" },
- /* 18*/ { DATA_MODE, 2, -1, "\344\252", 0, "8B 92 A8 00 EC 11 EC 11 00", 0, "B2 (Shift JIS); BWIPP uses Kanji (ZINT_FULL_MULTIBYTE) mode, see below)" },
- /* 19*/ { DATA_MODE, 2, ZINT_FULL_MULTIBYTE, "\344\252", 0, "CE AA 80 00 EC 11 EC 11 00", 1, "K1 (Shift JIS) (full multibyte)" },
- /* 20*/ { DATA_MODE, 2, -1, "茗", 0, "8F A2 32 5C 00 EC 11 EC 00", 1, "B3 (UTF-8)" },
- /* 21*/ { UNICODE_MODE, 2, -1, "¥点", 0, "8D 72 4D 7C 00 EC 11 EC 00", 1, "B3 (Shift JIS) (optimized from B1 K1)" },
- /* 22*/ { DATA_MODE, 2, -1, "\134\223\137", 0, "8D 72 4D 7C 00 EC 11 EC 00", 1, "B3 (Shift JIS) (optimized from B1 K1)" },
- /* 23*/ { DATA_MODE, 2, -1, "¥点", 0, "97 0A 97 9E 0A E4 00 EC 00", 1, "B5 (UTF-8)" },
- /* 24*/ { UNICODE_MODE, 2, -1, "点茗", 0, "D3 67 F5 54 00 EC 11 EC 00", 1, "K2 (Shift JIS)" },
- /* 25*/ { DATA_MODE, 2, -1, "\223\137\344\252", 0, "92 4D 7F 92 A8 00 EC 11 00", 0, "B4 (Shift JIS; BWIPP uses Kanji (ZINT_FULL_MULTIBYTE) mode, see below))" },
- /* 26*/ { DATA_MODE, 2, ZINT_FULL_MULTIBYTE, "\223\137\344\252", 0, "D3 67 F5 54 00 EC 11 EC 00", 1, "K2 (Shift JIS) (full multibyte)" },
- /* 27*/ { DATA_MODE, 2, -1, "点茗", 0, "9B 9E 0A E7 A2 32 5C 00 00", 1, "B6 (UTF-8)" },
- /* 28*/ { DATA_MODE, 2, ZINT_FULL_MULTIBYTE, "点茗", 0, "9B 9E 0A E7 A2 32 5C 00 00", 1, "B6 (UTF-8)" },
- /* 29*/ { UNICODE_MODE, 2, -1, "点茗・", 0, "D3 67 F5 55 0D 28 00 EC 00", 1, "K2 B1 (Shift JIS)" },
- /* 30*/ { DATA_MODE, 2, -1, "\223\137\344\252\245", 0, "96 4D 7F 92 AA 94 00 EC 00", 0, "B5 (Shift JIS); BWIPP uses Kanji (ZINT_FULL_MULTIBYTE) mode, see below)" },
- /* 31*/ { DATA_MODE, 2, ZINT_FULL_MULTIBYTE, "\223\137\344\252\245", 0, "D3 67 F5 55 0D 28 00 EC 00", 1, "K2 B1 (Shift JIS) (full multibyte)" },
- /* 32*/ { DATA_MODE, 1, -1, "点茗・", 0, "A7 9E 0A E7 A2 32 5F BE F6 94 00", 1, "B9 (UTF-8)" },
- /* 33*/ { UNICODE_MODE, 2, -1, "¥点茗・", 0, "99 72 4D 7F 92 AA 94 00 00", 1, "B6 (Shift JIS) (optimized from B1 K2 B1)" },
- /* 34*/ { DATA_MODE, 2, -1, "\134\223\137\344\252\245", 0, "99 72 4D 7F 92 AA 94 00 00", 1, "B6 (Shift JIS) (optimized from B1 K2 B1)" },
- /* 35*/ { DATA_MODE, 2, -1, "¥点茗・", 0, "4B C2 A5 E7 82 B9 E8 8C 97 EF BD A5 00 00", 1, "B11 (UTF-8)" },
- /* 36*/ { DATA_MODE, 2, -1, "ÁȁȁȁȂ¢", 0, "4C C3 81 C8 81 C8 81 C8 81 C8 82 C2 A2 00", 0, "B12 (UTF-8); BWIPP different encodation (B1 K5 B1)" },
- /* 37*/ { DATA_MODE, 1, -1, "ÁȁȁȁȁȂ¢", 0, "4E C3 81 C8 81 C8 81 C8 81 C8 81 C8 82 C2 A2 00", 0, "B14 (UTF-8); BWIPP uses Kanji (ZINT_FULL_MULTIBYTE) mode, see below)" },
- /* 38*/ { DATA_MODE, 1, ZINT_FULL_MULTIBYTE, "ÁȁȁȁȁȂ¢", 0, "41 C3 6C 08 80 44 02 20 11 00 88 0A 12 0D 10 00", 1, "B1 K6 B1 (UTF-8) (full multibyte)" },
- /* 39*/ { UNICODE_MODE, 2, -1, "áA", 0, "8B 85 04 00 EC 11 EC 11 00", 0, "B2 (ISO 8859-1); BWIPP uses Kanji (ZINT_FULL_MULTIBYTE) mode, see below)" },
- /* 40*/ { UNICODE_MODE, 2, ZINT_FULL_MULTIBYTE, "áA", 0, "CE 00 40 00 EC 11 EC 11 00", 1, "K1 (ISO 8859-1) (full multibyte)" },
+ /* 0*/ { UNICODE_MODE, 2, 1, "é", 0, "87 A4 00 EC 11 EC 11 EC 00", 1, 1, "B1 (ISO 8859-1)" },
+ /* 1*/ { DATA_MODE, 2, -1, "é", 0, "8B 0E A4 00 EC 11 EC 11 00", 1, 0, "B2 (UTF-8); ZXing-C++ test can't handle DATA_MODE for certain inputs" },
+ /* 2*/ { UNICODE_MODE, 2, -1, "β", 0, "C8 80 00 00 EC 11 EC 11 00", 1, 1, "K1 (Shift JIS)" },
+ /* 3*/ { UNICODE_MODE, 2, -1, "ก", ZINT_ERROR_INVALID_DATA, "Error 800: Invalid character in input data", 1, 1, "ก not in Shift JIS" },
+ /* 4*/ { UNICODE_MODE, 2, -1, "Ж", 0, "C8 91 C0 00 EC 11 EC 11 00", 1, 1, "K1 (Shift JIS)" },
+ /* 5*/ { UNICODE_MODE, 2, -1, "ກ", ZINT_ERROR_INVALID_DATA, "Error 800: Invalid character in input data", 1, 1, "ກ not in Shift JIS" },
+ /* 6*/ { UNICODE_MODE, 2, -1, "\\", 0, "85 70 00 EC 11 EC 11 EC 00", 1, 1, "B1 (ASCII)" },
+ /* 7*/ { UNICODE_MODE, 2, -1, "¥", 0, "86 94 00 EC 11 EC 11 EC 00", 1, 1, "B1 (ISO 8859-1) (same bytes as ・ Shift JIS below, so ambiguous)" },
+ /* 8*/ { UNICODE_MODE, 2, -1, "・", 0, "86 94 00 EC 11 EC 11 EC 00", 1, 1, "B1 (Shift JIS) single-byte codepoint A5 (same bytes as ¥ ISO 8859-1 above, so ambiguous)" },
+ /* 9*/ { UNICODE_MODE, 2, -1, "¿", 0, "86 FC 00 EC 11 EC 11 EC 00", 1, 1, "B1 (ISO 8859-1) (same bytes as ソ Shift JIS below, so ambiguous)" },
+ /* 10*/ { UNICODE_MODE, 2, -1, "ソ", 0, "86 FC 00 EC 11 EC 11 EC 00", 1, 1, "B1 (Shift JIS) (same bytes as ¿ ISO 8859-1 above, so ambiguous)" },
+ /* 11*/ { UNICODE_MODE, 2, -1, "~", 0, "85 F8 00 EC 11 EC 11 EC 00", 1, 1, "B1 (ASCII) (same bytes as ‾ Shift JIS below, so ambiguous)" },
+ /* 12*/ { UNICODE_MODE, 2, -1, "‾", 0, "85 F8 00 EC 11 EC 11 EC 00", 1, 0, "B1 (Shift JIS) (same bytes as ~ ASCII above, so ambiguous); ZXing-C++ doesn't map Shift JIS ASCII" },
+ /* 13*/ { UNICODE_MODE, 2, -1, "点", 0, "CB 67 C0 00 EC 11 EC 11 00", 1, 1, "K1 (Shift JIS)" },
+ /* 14*/ { DATA_MODE, 2, -1, "\223\137", 0, "8A 4D 7C 00 EC 11 EC 11 00", 0, 0, "B2 (Shift JIS); BWIPP uses Kanji (ZINT_FULL_MULTIBYTE) mode, see below); ZXing-C++ test can't handle DATA_MODE for certain inputs" },
+ /* 15*/ { DATA_MODE, 2, ZINT_FULL_MULTIBYTE, "\223\137", 0, "CB 67 C0 00 EC 11 EC 11 00", 1, 1, "K1 (Shift JIS) (full multibyte)" },
+ /* 16*/ { DATA_MODE, 2, -1, "点", 0, "8F 9E 0A E4 00 EC 11 EC 00", 1, 0, "B3 (UTF-8); ZXing-C++ test can't handle DATA_MODE for certain inputs" },
+ /* 17*/ { UNICODE_MODE, 2, -1, "茗", 0, "CE AA 80 00 EC 11 EC 11 00", 1, 1, "K1 (Shift JIS)" },
+ /* 18*/ { DATA_MODE, 2, -1, "\344\252", 0, "8B 92 A8 00 EC 11 EC 11 00", 0, 0, "B2 (Shift JIS); BWIPP uses Kanji (ZINT_FULL_MULTIBYTE) mode, see below; ZXing-C++ test can't handle DATA_MODE for certain inputs)" },
+ /* 19*/ { DATA_MODE, 2, ZINT_FULL_MULTIBYTE, "\344\252", 0, "CE AA 80 00 EC 11 EC 11 00", 1, 1, "K1 (Shift JIS) (full multibyte)" },
+ /* 20*/ { DATA_MODE, 2, -1, "茗", 0, "8F A2 32 5C 00 EC 11 EC 00", 1, 0, "B3 (UTF-8); ZXing-C++ test can't handle DATA_MODE for certain inputs" },
+ /* 21*/ { UNICODE_MODE, 2, -1, "¥点", 0, "8D 72 4D 7C 00 EC 11 EC 00", 1, 0, "B3 (Shift JIS) (optimized from B1 K1); ZXing-C++ doesn't map Shift JIS ASCII" },
+ /* 22*/ { DATA_MODE, 2, -1, "\134\223\137", 0, "8D 72 4D 7C 00 EC 11 EC 00", 1, 0, "B3 (Shift JIS) (optimized from B1 K1); ZXing-C++ test can't handle DATA_MODE for certain inputs" },
+ /* 23*/ { DATA_MODE, 2, -1, "¥点", 0, "97 0A 97 9E 0A E4 00 EC 00", 1, 0, "B5 (UTF-8); ZXing-C++ test can't handle DATA_MODE for certain inputs" },
+ /* 24*/ { UNICODE_MODE, 2, -1, "点茗", 0, "D3 67 F5 54 00 EC 11 EC 00", 1, 1, "K2 (Shift JIS)" },
+ /* 25*/ { DATA_MODE, 2, -1, "\223\137\344\252", 0, "92 4D 7F 92 A8 00 EC 11 00", 0, 0, "B4 (Shift JIS; BWIPP uses Kanji (ZINT_FULL_MULTIBYTE) mode, see below)); ZXing-C++ test can't handle DATA_MODE for certain inputs" },
+ /* 26*/ { DATA_MODE, 2, ZINT_FULL_MULTIBYTE, "\223\137\344\252", 0, "D3 67 F5 54 00 EC 11 EC 00", 1, 1, "K2 (Shift JIS) (full multibyte)" },
+ /* 27*/ { DATA_MODE, 2, -1, "点茗", 0, "9B 9E 0A E7 A2 32 5C 00 00", 1, 0, "B6 (UTF-8); ZXing-C++ test can't handle DATA_MODE for certain inputs" },
+ /* 28*/ { DATA_MODE, 2, ZINT_FULL_MULTIBYTE, "点茗", 0, "9B 9E 0A E7 A2 32 5C 00 00", 1, 1, "B6 (UTF-8)" },
+ /* 29*/ { UNICODE_MODE, 2, -1, "点茗・", 0, "D3 67 F5 55 0D 28 00 EC 00", 1, 1, "K2 B1 (Shift JIS)" },
+ /* 30*/ { DATA_MODE, 2, -1, "\223\137\344\252\245", 0, "96 4D 7F 92 AA 94 00 EC 00", 0, 0, "B5 (Shift JIS); BWIPP uses Kanji (ZINT_FULL_MULTIBYTE) mode, see below); ZXing-C++ test can't handle DATA_MODE for certain inputs" },
+ /* 31*/ { DATA_MODE, 2, ZINT_FULL_MULTIBYTE, "\223\137\344\252\245", 0, "D3 67 F5 55 0D 28 00 EC 00", 1, 1, "K2 B1 (Shift JIS) (full multibyte)" },
+ /* 32*/ { DATA_MODE, 1, -1, "点茗・", 0, "A7 9E 0A E7 A2 32 5F BE F6 94 00", 1, 0, "B9 (UTF-8); ZXing-C++ test can't handle DATA_MODE for certain inputs" },
+ /* 33*/ { UNICODE_MODE, 2, -1, "¥点茗・", 0, "99 72 4D 7F 92 AA 94 00 00", 1, 0, "B6 (Shift JIS) (optimized from B1 K2 B1); ZXing-C++ doesn't map Shift JIS ASCII" },
+ /* 34*/ { DATA_MODE, 2, -1, "\134\223\137\344\252\245", 0, "99 72 4D 7F 92 AA 94 00 00", 1, 0, "B6 (Shift JIS) (optimized from B1 K2 B1); ZXing-C++ test can't handle DATA_MODE for certain inputs" },
+ /* 35*/ { DATA_MODE, 2, -1, "¥点茗・", 0, "4B C2 A5 E7 82 B9 E8 8C 97 EF BD A5 00 00", 1, 0, "B11 (UTF-8); ZXing-C++ doesn't map Shift JIS ASCII" },
+ /* 36*/ { DATA_MODE, 2, -1, "ÁȁȁȁȂ¢", 0, "4C C3 81 C8 81 C8 81 C8 81 C8 82 C2 A2 00", 0, 0, "B12 (UTF-8); BWIPP different encodation (B1 K5 B1); ZXing-C++ test can't handle DATA_MODE for certain inputs" },
+ /* 37*/ { DATA_MODE, 1, -1, "ÁȁȁȁȁȂ¢", 0, "4E C3 81 C8 81 C8 81 C8 81 C8 81 C8 82 C2 A2 00", 0, 0, "B14 (UTF-8); BWIPP uses Kanji (ZINT_FULL_MULTIBYTE) mode, see below); ZXing-C++ test can't handle DATA_MODE for certain inputs" },
+ /* 38*/ { DATA_MODE, 1, ZINT_FULL_MULTIBYTE, "ÁȁȁȁȁȂ¢", 0, "41 C3 6C 08 80 44 02 20 11 00 88 0A 12 0D 10 00", 1, 1, "B1 K6 B1 (UTF-8) (full multibyte)" },
+ /* 39*/ { UNICODE_MODE, 2, -1, "áA", 0, "8B 85 04 00 EC 11 EC 11 00", 0, 1, "B2 (ISO 8859-1); BWIPP uses Kanji (ZINT_FULL_MULTIBYTE) mode, see below)" },
+ /* 40*/ { UNICODE_MODE, 2, ZINT_FULL_MULTIBYTE, "áA", 0, "CE 00 40 00 EC 11 EC 11 00", 1, 1, "K1 (ISO 8859-1) (full multibyte)" },
};
int data_size = ARRAY_SIZE(data);
int i, length, ret;
@@ -4590,6 +4591,7 @@ static void test_microqr_input(int index, int generate, int debug) {
char cmp_msg[1024];
int do_bwipp = (debug & ZINT_DEBUG_TEST_BWIPP) && testUtilHaveGhostscript(); // Only do BWIPP test if asked, too slow otherwise
+ int do_zxingcpp = (debug & ZINT_DEBUG_TEST_ZXINGCPP) && testUtilHaveZXingCPPDecoder(); // Only do ZXing-C++ test if asked, too slow otherwise
testStart("test_microqr_input");
@@ -4609,10 +4611,10 @@ static void test_microqr_input(int index, int generate, int debug) {
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (generate) {
- printf(" /*%3d*/ { %s, %d, %s, \"%s\", %s, \"%s\", %d, \"%s\" },\n",
+ printf(" /*%3d*/ { %s, %d, %s, \"%s\", %s, \"%s\", %d, %d, \"%s\" },\n",
i, testUtilInputModeName(data[i].input_mode), data[i].option_1, testUtilOption3Name(data[i].option_3),
testUtilEscape(data[i].data, length, escaped, sizeof(escaped)),
- testUtilErrorName(data[i].ret), symbol->errtxt, data[i].bwipp_cmp, data[i].comment);
+ testUtilErrorName(data[i].ret), symbol->errtxt, data[i].bwipp_cmp, data[i].zxingcpp_cmp, data[i].comment);
} else {
assert_zero(strcmp(symbol->errtxt, data[i].expected), "i:%d strcmp(%s, %s) != 0\n", i, symbol->errtxt, data[i].expected);
@@ -4631,6 +4633,21 @@ static void test_microqr_input(int index, int generate, int debug) {
i, testUtilBarcodeName(symbol->symbology), ret, cmp_msg, cmp_buf, modules_dump);
}
}
+ if (do_zxingcpp && testUtilCanZXingCPP(i, symbol, data[i].data, length, debug)) {
+ if (!data[i].zxingcpp_cmp) {
+ if (debug & ZINT_DEBUG_TEST_PRINT) printf("i:%d %s not ZXing-C++ compatible (%s)\n", i, testUtilBarcodeName(symbol->symbology), data[i].comment);
+ } else {
+ int cmp_len, ret_len;
+ char modules_dump[17 * 17 + 1];
+ assert_notequal(testUtilModulesDump(symbol, modules_dump, sizeof(modules_dump)), -1, "i:%d testUtilModulesDump == -1\n", i);
+ ret = testUtilZXingCPP(i, symbol, data[i].data, length, modules_dump, cmp_buf, sizeof(cmp_buf), &cmp_len);
+ assert_zero(ret, "i:%d %s testUtilZXingCPP ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret);
+
+ ret = testUtilZXingCPPCmp(symbol, cmp_msg, cmp_buf, cmp_len, data[i].data, length, NULL /*primary*/, escaped, &ret_len);
+ assert_zero(ret, "i:%d %s testUtilZXingCPPCmp %d != 0 %s\n actual: %.*s\nexpected: %.*s\n",
+ i, testUtilBarcodeName(symbol->symbology), ret, cmp_msg, cmp_len, cmp_buf, ret_len, escaped);
+ }
+ }
}
}
@@ -4692,6 +4709,10 @@ static void test_microqr_padding(int index, int generate, int debug) {
struct zint_symbol *symbol;
char escaped[4096];
+ char cmp_buf[32768];
+ char cmp_msg[1024];
+
+ int do_zxingcpp = (debug & ZINT_DEBUG_TEST_ZXINGCPP) && testUtilHaveZXingCPPDecoder(); // Only do ZXing-C++ test if asked, too slow otherwise
testStart("test_microqr_padding");
@@ -4722,8 +4743,19 @@ static void test_microqr_padding(int index, int generate, int debug) {
testUtilErrorName(data[i].ret), symbol->errtxt, data[i].comment);
} else {
assert_zero(strcmp(symbol->errtxt, data[i].expected), "i:%d strcmp(%s, %s) != 0\n", i, symbol->errtxt, data[i].expected);
- }
+ if (do_zxingcpp && testUtilCanZXingCPP(i, symbol, data[i].data, length, debug)) {
+ int cmp_len, ret_len;
+ char modules_dump[17 * 17 + 1];
+ assert_notequal(testUtilModulesDump(symbol, modules_dump, sizeof(modules_dump)), -1, "i:%d testUtilModulesDump == -1\n", i);
+ ret = testUtilZXingCPP(i, symbol, data[i].data, length, modules_dump, cmp_buf, sizeof(cmp_buf), &cmp_len);
+ assert_zero(ret, "i:%d %s testUtilZXingCPP ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret);
+
+ ret = testUtilZXingCPPCmp(symbol, cmp_msg, cmp_buf, cmp_len, data[i].data, length, NULL /*primary*/, escaped, &ret_len);
+ assert_zero(ret, "i:%d %s testUtilZXingCPPCmp %d != 0 %s\n actual: %.*s\nexpected: %.*s\n",
+ i, testUtilBarcodeName(symbol->symbology), ret, cmp_msg, cmp_len, cmp_buf, ret_len, escaped);
+ }
+ }
ZBarcode_Delete(symbol);
}
@@ -4741,22 +4773,23 @@ static void test_microqr_optimize(int index, int generate, int debug) {
int ret;
char *expected;
int bwipp_cmp;
+ int zxingcpp_cmp;
char *comment;
};
struct item data[] = {
- /* 0*/ { UNICODE_MODE, -1, -1, -1, "1", 0, "22 00 00", 1, "N1" },
- /* 1*/ { UNICODE_MODE, 1, 2, -1, "A123", 0, "92 86 3D 80 EC", 1, "A1 N3" },
- /* 2*/ { UNICODE_MODE, 1, -1, -1, "AAAAAA", 0, "E3 98 73 0E 60", 1, "A6" },
- /* 3*/ { UNICODE_MODE, 1, -1, -1, "AA123456", 0, "A3 98 61 ED C8", 1, "A2 N6" },
- /* 4*/ { UNICODE_MODE, 1, 3, -1, "01a", 0, "04 06 16 10 00 EC 11 EC 11 EC 00", 1, "N3 B1" },
- /* 5*/ { UNICODE_MODE, 1, 4, -1, "01a", 0, "43 30 31 61 00 00 EC 11 EC 11 EC 11 EC 11 EC 11", 1, "B3" },
- /* 6*/ { UNICODE_MODE, 1, -1, -1, "こんwa、αβ", 0, "46 82 B1 82 F1 77 61 66 00 10 FF 88 00 00 EC 11", 1, "B6 K3" },
- /* 7*/ { UNICODE_MODE, 1, -1, -1, "こんにwa、αβ", 0, "66 13 10 B8 85 25 09 DD 85 98 00 43 FE 20 00 00", 1, "K3 B2 K3" },
- /* 8*/ { UNICODE_MODE, 1, 3, -1, "こんAB123\177", 0, "D0 4C 42 E2 91 CD 06 3D C2 FE 00", 0, "K2 A2 N3 B1; BWIPP different encodation (K2 A5 B1)" },
- /* 9*/ { UNICODE_MODE, 1, 4, -1, "こんAB123\177", 0, "64 13 10 B8 92 9C D0 5E 1A 0B F8 00 EC 11 EC 11", 1, "K2 A5 B1" },
- /* 10*/ { DATA_MODE, 1, -1, -1, "\223\137", 0, "8A 4D 7C 00 EC 11 EC 11 EC 11 00", 0, "B2; BWIPP uses Kanji (ZINT_FULL_MULTIBYTE) mode, see below)" },
- /* 11*/ { DATA_MODE, 1, -1, ZINT_FULL_MULTIBYTE, "\223\137", 0, "CB 67 C0 00 EC 11 EC 11 EC 11 00", 1, "K1" },
- /* 12*/ { DATA_MODE, 1, -1, ZINT_FULL_MULTIBYTE | (1 << 8), "\223\137", 0, "CB 67 C0 00 EC 11 EC 11 EC 11 00", 1, "K1" },
+ /* 0*/ { UNICODE_MODE, -1, -1, -1, "1", 0, "22 00 00", 1, 1, "N1" },
+ /* 1*/ { UNICODE_MODE, 1, 2, -1, "A123", 0, "92 86 3D 80 EC", 1, 1, "A1 N3" },
+ /* 2*/ { UNICODE_MODE, 1, -1, -1, "AAAAAA", 0, "E3 98 73 0E 60", 1, 1, "A6" },
+ /* 3*/ { UNICODE_MODE, 1, -1, -1, "AA123456", 0, "A3 98 61 ED C8", 1, 1, "A2 N6" },
+ /* 4*/ { UNICODE_MODE, 1, 3, -1, "01a", 0, "04 06 16 10 00 EC 11 EC 11 EC 00", 1, 1, "N3 B1" },
+ /* 5*/ { UNICODE_MODE, 1, 4, -1, "01a", 0, "43 30 31 61 00 00 EC 11 EC 11 EC 11 EC 11 EC 11", 1, 1, "B3" },
+ /* 6*/ { UNICODE_MODE, 1, -1, -1, "こんwa、αβ", 0, "46 82 B1 82 F1 77 61 66 00 10 FF 88 00 00 EC 11", 1, 1, "B6 K3" },
+ /* 7*/ { UNICODE_MODE, 1, -1, -1, "こんにwa、αβ", 0, "66 13 10 B8 85 25 09 DD 85 98 00 43 FE 20 00 00", 1, 1, "K3 B2 K3" },
+ /* 8*/ { UNICODE_MODE, 1, 3, -1, "こんAB123\177", 0, "D0 4C 42 E2 91 CD 06 3D C2 FE 00", 0, 1, "K2 A2 N3 B1; BWIPP different encodation (K2 A5 B1)" },
+ /* 9*/ { UNICODE_MODE, 1, 4, -1, "こんAB123\177", 0, "64 13 10 B8 92 9C D0 5E 1A 0B F8 00 EC 11 EC 11", 1, 1, "K2 A5 B1" },
+ /* 10*/ { DATA_MODE, 1, -1, -1, "\223\137", 0, "8A 4D 7C 00 EC 11 EC 11 EC 11 00", 0, 0, "B2; BWIPP uses Kanji (ZINT_FULL_MULTIBYTE) mode, see below); ZXing-C++ test can't handle DATA_MODE for certain inputs" },
+ /* 11*/ { DATA_MODE, 1, -1, ZINT_FULL_MULTIBYTE, "\223\137", 0, "CB 67 C0 00 EC 11 EC 11 EC 11 00", 1, 1, "K1" },
+ /* 12*/ { DATA_MODE, 1, -1, ZINT_FULL_MULTIBYTE | (1 << 8), "\223\137", 0, "CB 67 C0 00 EC 11 EC 11 EC 11 00", 1, 1, "K1" },
};
int data_size = ARRAY_SIZE(data);
int i, length, ret;
@@ -4767,6 +4800,7 @@ static void test_microqr_optimize(int index, int generate, int debug) {
char cmp_msg[1024];
int do_bwipp = (debug & ZINT_DEBUG_TEST_BWIPP) && testUtilHaveGhostscript(); // Only do BWIPP test if asked, too slow otherwise
+ int do_zxingcpp = (debug & ZINT_DEBUG_TEST_ZXINGCPP) && testUtilHaveZXingCPPDecoder(); // Only do ZXing-C++ test if asked, too slow otherwise
testStart("test_microqr_optimize");
@@ -4785,10 +4819,10 @@ static void test_microqr_optimize(int index, int generate, int debug) {
assert_equal(ret, data[i].ret, "i:%d ZBarcode_Encode ret %d != %d (%s)\n", i, ret, data[i].ret, symbol->errtxt);
if (generate) {
- printf(" /*%3d*/ { %s, %d, %d, %s, \"%s\", %s, \"%s\", %d, \"%s\" },\n",
+ printf(" /*%3d*/ { %s, %d, %d, %s, \"%s\", %s, \"%s\", %d, %d, \"%s\" },\n",
i, testUtilInputModeName(data[i].input_mode), data[i].option_1, data[i].option_2, testUtilOption3Name(data[i].option_3),
testUtilEscape(data[i].data, length, escaped, sizeof(escaped)),
- testUtilErrorName(data[i].ret), symbol->errtxt, data[i].bwipp_cmp, data[i].comment);
+ testUtilErrorName(data[i].ret), symbol->errtxt, data[i].bwipp_cmp, data[i].zxingcpp_cmp, data[i].comment);
} else {
assert_zero(strcmp(symbol->errtxt, data[i].expected), "i:%d strcmp(%s, %s) != 0\n", i, symbol->errtxt, data[i].expected);
@@ -4806,6 +4840,21 @@ static void test_microqr_optimize(int index, int generate, int debug) {
i, testUtilBarcodeName(symbol->symbology), ret, cmp_msg, cmp_buf, modules_dump);
}
}
+ if (do_zxingcpp && testUtilCanZXingCPP(i, symbol, data[i].data, length, debug)) {
+ if (!data[i].zxingcpp_cmp) {
+ if (debug & ZINT_DEBUG_TEST_PRINT) printf("i:%d %s not ZXing-C++ compatible (%s)\n", i, testUtilBarcodeName(symbol->symbology), data[i].comment);
+ } else {
+ int cmp_len, ret_len;
+ char modules_dump[17 * 17 + 1];
+ assert_notequal(testUtilModulesDump(symbol, modules_dump, sizeof(modules_dump)), -1, "i:%d testUtilModulesDump == -1\n", i);
+ ret = testUtilZXingCPP(i, symbol, data[i].data, length, modules_dump, cmp_buf, sizeof(cmp_buf), &cmp_len);
+ assert_zero(ret, "i:%d %s testUtilZXingCPP ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret);
+
+ ret = testUtilZXingCPPCmp(symbol, cmp_msg, cmp_buf, cmp_len, data[i].data, length, NULL /*primary*/, escaped, &ret_len);
+ assert_zero(ret, "i:%d %s testUtilZXingCPPCmp %d != 0 %s\n actual: %.*s\nexpected: %.*s\n",
+ i, testUtilBarcodeName(symbol->symbology), ret, cmp_msg, cmp_len, cmp_buf, ret_len, escaped);
+ }
+ }
}
ZBarcode_Delete(symbol);
@@ -5118,6 +5167,7 @@ static void test_microqr_encode(int index, int generate, int debug) {
char cmp_msg[1024];
int do_bwipp = (debug & ZINT_DEBUG_TEST_BWIPP) && testUtilHaveGhostscript(); // Only do BWIPP test if asked, too slow otherwise
+ int do_zxingcpp = (debug & ZINT_DEBUG_TEST_ZXINGCPP) && testUtilHaveZXingCPPDecoder(); // Only do ZXing-C++ test if asked, too slow otherwise
testStart("test_microqr_encode");
@@ -5161,6 +5211,17 @@ static void test_microqr_encode(int index, int generate, int debug) {
i, testUtilBarcodeName(symbol->symbology), ret, cmp_msg, cmp_buf, data[i].expected);
}
}
+ if (do_zxingcpp && testUtilCanZXingCPP(i, symbol, data[i].data, length, debug)) {
+ int cmp_len, ret_len;
+ char modules_dump[17 * 17 + 1];
+ assert_notequal(testUtilModulesDump(symbol, modules_dump, sizeof(modules_dump)), -1, "i:%d testUtilModulesDump == -1\n", i);
+ ret = testUtilZXingCPP(i, symbol, data[i].data, length, modules_dump, cmp_buf, sizeof(cmp_buf), &cmp_len);
+ assert_zero(ret, "i:%d %s testUtilZXingCPP ret %d != 0\n", i, testUtilBarcodeName(symbol->symbology), ret);
+
+ ret = testUtilZXingCPPCmp(symbol, cmp_msg, cmp_buf, cmp_len, data[i].data, length, NULL /*primary*/, escaped, &ret_len);
+ assert_zero(ret, "i:%d %s testUtilZXingCPPCmp %d != 0 %s\n actual: %.*s\nexpected: %.*s\n",
+ i, testUtilBarcodeName(symbol->symbology), ret, cmp_msg, cmp_len, cmp_buf, ret_len, escaped);
+ }
}
}
diff --git a/backend/tests/test_sjis.c b/backend/tests/test_sjis.c
index ce2e6585..956d383e 100644
--- a/backend/tests/test_sjis.c
+++ b/backend/tests/test_sjis.c
@@ -208,9 +208,9 @@ static void test_sjis_utf8_to_eci(int index) {
/* 11*/ { 3, 1, "éaúbàcëdìeµ", -1, 0, 8, { 0xE961, 0xFA, 0x62, 0xE063, 0xEB64, 0xEC, 0x65, 0xB5 }, "" },
/* 12*/ { 3, 0, "ëÀ", -1, 0, 2, { 0xEB, 0xC0 }, "Not full multibyte" },
/* 13*/ { 3, 1, "ëÀ", -1, 0, 2, { 0xEB, 0xC0 }, "Outside QR Kanji mode range" },
- /* 14*/ { 20, 0, "\\\\", -1, 0, 4, { 0x81, 0x5F, 0x81, 0x5F }, "Shift JIS reverse solidus (backslash) mapping from ASCII to double byte" },
+ /* 14*/ { 20, 0, "\\\\", -1, 0, 2, { 0x815F, 0x815F }, "Shift JIS reverse solidus (backslash) mapping from ASCII to double byte" },
/* 15*/ { 20, 1, "\\\\", -1, 0, 2, { 0x815F, 0x815F }, "Shift JIS reverse solidus (backslash) mapping from ASCII to double byte" },
- /* 16*/ { 20, 0, "爍", -1, 0, 2, { 0xE0, 0xA1 }, "Shift JIS U+720D" },
+ /* 16*/ { 20, 0, "爍", -1, 0, 1, { 0xE0A1 }, "Shift JIS U+720D" },
/* 17*/ { 20, 1, "爍", -1, 0, 1, { 0xE0A1 }, "Shift JIS" },
/* 18*/ { 20, 0, "~", -1, ZINT_ERROR_INVALID_DATA, -1, {0}, "ASCII tilde not in Shift JIS" },
/* 19*/ { 25, 0, "12", -1, 0, 4, { 0x00, 0x31, 0x00, 0x32 }, "UCS-2BE ASCII" },
diff --git a/backend/tests/testcommon.c b/backend/tests/testcommon.c
index 9f132024..0710e05f 100644
--- a/backend/tests/testcommon.c
+++ b/backend/tests/testcommon.c
@@ -3285,7 +3285,7 @@ static const char *testUtilZXingCPPName(int index, const struct zint_symbol *sym
{ "", -1, 94, },
{ "", -1, 95, },
{ "Code128", BARCODE_DPD, 96, },
- { "", BARCODE_MICROQR, 97, },
+ { "MicroQRCode", BARCODE_MICROQR, 97, },
{ "Code128", BARCODE_HIBC_128, 98, },
{ "Code39", BARCODE_HIBC_39, 99, },
{ "", -1, 100, },
@@ -3425,7 +3425,7 @@ int testUtilZXingCPP(int index, struct zint_symbol *symbol, const char *source,
}
if ((symbol->input_mode & 0x07) == UNICODE_MODE && symbol->eci == 0
- && (symbology == BARCODE_QRCODE || symbology == BARCODE_HANXIN)) {
+ && (symbology == BARCODE_QRCODE || symbology == BARCODE_MICROQR || symbology == BARCODE_HANXIN)) {
int converted_len = length;
unsigned char *converted_buf = (unsigned char *) testutil_alloca(converted_len + 1);
if (symbology == BARCODE_HANXIN) {
diff --git a/backend/tests/tools/run_zxingcpp_tests.sh b/backend/tests/tools/run_zxingcpp_tests.sh
index c089a892..14ba16d8 100755
--- a/backend/tests/tools/run_zxingcpp_tests.sh
+++ b/backend/tests/tools/run_zxingcpp_tests.sh
@@ -4,8 +4,13 @@
set -e
function run_zxingcpp_test() {
- echo -e "\n$1 -f $2"
- backend/tests/$1 -f "$2" -d $(expr 512 + 16 + 32) || exit 1
+ if [ -z "$2" ]; then
+ echo -e "\n$1"
+ backend/tests/$1 -d $(expr 512 + 16 + 32) || exit 1
+ else
+ echo -e "\n$1 -f $2"
+ backend/tests/$1 -f "$2" -d $(expr 512 + 16 + 32) || exit 1
+ fi
}
run_zxingcpp_test "test_2of5" "encode"
@@ -28,11 +33,7 @@ run_zxingcpp_test "test_maxicode" "encode_segs"
run_zxingcpp_test "test_medical" "encode"
run_zxingcpp_test "test_pdf417" "encode"
run_zxingcpp_test "test_pdf417" "encode_segs"
-run_zxingcpp_test "test_qr" "qr_input"
-run_zxingcpp_test "test_qr" "qr_optimize"
-run_zxingcpp_test "test_qr" "qr_encode"
-run_zxingcpp_test "test_qr" "qr_encode_segs"
-run_zxingcpp_test "test_qr" "upnqr_encode"
+run_zxingcpp_test "test_qr"
run_zxingcpp_test "test_rss" "binary_div_modulo_divisor"
run_zxingcpp_test "test_rss" "examples"
run_zxingcpp_test "test_upcean" "upce_input"
diff --git a/backend/zint.h b/backend/zint.h
index 4f485903..c70ec296 100644
--- a/backend/zint.h
+++ b/backend/zint.h
@@ -205,7 +205,7 @@ extern "C" {
#define BARCODE_MICROPDF417 84 /* MicroPDF417 */
#define BARCODE_USPS_IMAIL 85 /* USPS Intelligent Mail (OneCode) */
#define BARCODE_ONECODE 85 /* Legacy */
-#define BARCODE_PLESSEY 86 /* Plessey Code */
+#define BARCODE_PLESSEY 86 /* UK Plessey */
/* Tbarcode 8 codes */
#define BARCODE_TELEPEN_NUM 87 /* Telepen Numeric */
diff --git a/backend_qt/qzint.cpp b/backend_qt/qzint.cpp
index 54868c59..8a363d9f 100644
--- a/backend_qt/qzint.cpp
+++ b/backend_qt/qzint.cpp
@@ -1074,7 +1074,7 @@ namespace Zint {
void QZint::arg_str(QString& cmd, const char *const opt, const QString& val) {
if (!val.isEmpty()) {
QByteArray bstr = val.toUtf8();
- cmd += QString::asprintf(" %s%.*s", opt, bstr.length(), bstr.data());
+ cmd += QString::asprintf(" %s%.*s", opt, (int) bstr.length(), bstr.data());
}
}
@@ -1119,11 +1119,11 @@ namespace Zint {
text.replace("\\\\", "\\\\\\\\"); // Double-up backslashed backslash `\\` -> `\\\\`
text.replace("\"", "\\\""); // Backslash quote `"` -> `\"`
QByteArray bstr = text.toUtf8();
- cmd += QString::asprintf(" %s%c%.*s%c", opt, delim, bstr.length(), bstr.data(), delim);
+ cmd += QString::asprintf(" %s%c%.*s%c", opt, delim, (int) bstr.length(), bstr.data(), delim);
} else {
text.replace("'", "'\\''"); // Single quote `'` -> `'\''`
QByteArray bstr = text.toUtf8();
- cmd += QString::asprintf(" %s%c%.*s%c", opt, delim, bstr.length(), bstr.data(), delim);
+ cmd += QString::asprintf(" %s%c%.*s%c", opt, delim, (int) bstr.length(), bstr.data(), delim);
}
}
@@ -1140,7 +1140,8 @@ namespace Zint {
cmd += QString::asprintf(" %s%d,%d", opt, index, count);
} else {
QByteArray bstr = id.toUtf8();
- arg_data(cmd, opt, QString::asprintf("%d,%d,%.*s", index, count, bstr.length(), bstr.data()), win);
+ arg_data(cmd, opt, QString::asprintf("%d,%d,%.*s", index, count, (int) bstr.length(), bstr.data()),
+ win);
}
}
}
diff --git a/docs/Makefile b/docs/Makefile
new file mode 100644
index 00000000..98dd6fa9
--- /dev/null
+++ b/docs/Makefile
@@ -0,0 +1,159 @@
+# Makefile for generating "manual.txt" and "manual.pdf" from "manual.pmd" using pandoc
+# Copyright (C) 2022
+#
+# Requires a recent version of pandoc, plus pandoc-tablenos, xelatex and various other packages - see "README"
+# .svg images generated by "zint_images.sh"
+
+SOURCE = manual.pmd
+OUT_PDF = manual.pdf
+OUT_TXT = manual.txt
+HIGHLIGHT_THEME = pygments.theme
+INC_HEADER_PDF = inc_header_pdf.tex
+INC_BEFORE_BODY_PDF = inc_before_body_pdf.tex
+INCLUDES_PDF = $(INC_HEADER_PDF) $(INC_BEFORE_BODY_PDF)
+INC_PDF = --include-in-header $(INC_HEADER_PDF) --include-before-body $(INC_BEFORE_BODY_PDF)
+INCLUDES_TXT = inc_header_txt.tex
+INC_TXT = --include-in-header $(INCLUDES_TXT)
+IMAGES = \
+ images/zint.png \
+ images/zint-qt.png \
+ images/gui_main.png \
+ images/gui_menus.png \
+ images/gui_composite.png \
+ images/gui_segs.png \
+ images/gui_aztec.png \
+ images/gui_appearance.png \
+ images/gui_colour.png \
+ images/gui_data_dialog.png \
+ images/gui_sequence.png \
+ images/gui_export.png \
+ images/gui_cli_equivalent.png \
+ images/pdf417_heightperrow.svg \
+ images/code128_box.svg \
+ images/qrcode_box.svg \
+ images/code128_green.svg \
+ images/code128_green_alpha.svg \
+ images/code128_rotate90.svg \
+ images/datamatrix_euro.svg \
+ images/datamatrix_big5.svg \
+ images/qrcode_binary_utf8.svg \
+ images/codeone_s_dotty.svg \
+ images/aztec_segs.svg \
+ images/datamatrix_structapp.svg \
+ images/code128_small_bold.svg \
+ images/code11.svg \
+ images/c25standard.svg \
+ images/c25iata.svg \
+ images/c25ind.svg \
+ images/c25inter.svg \
+ images/c25logic.svg \
+ images/itf14.svg \
+ images/itf14_border0.svg \
+ images/dpleit.svg \
+ images/dpident.svg \
+ images/upca.svg \
+ images/upca_5.svg \
+ images/upce.svg \
+ images/eanx13.svg \
+ images/eanx5.svg \
+ images/eanx8_5.svg \
+ images/isbnx.svg \
+ images/plessey.svg \
+ images/msi_plessey.svg \
+ images/telepen.svg \
+ images/telepen_num.svg \
+ images/code39.svg \
+ images/excode39.svg \
+ images/code93.svg \
+ images/pzn.svg \
+ images/logmars.svg \
+ images/code32.svg \
+ images/hibc_39.svg \
+ images/vin.svg \
+ images/codabar.svg \
+ images/pharma.svg \
+ images/code128.svg \
+ images/code128b.svg \
+ images/gs1_128.svg \
+ images/ean14.svg \
+ images/nve18.svg \
+ images/hibc_128.svg \
+ images/dpd.svg \
+ images/dbar_omn.svg \
+ images/dbar_truncated.svg \
+ images/dbar_ltd.svg \
+ images/dbar_exp.svg \
+ images/koreapost.svg \
+ images/channel.svg \
+ images/code128_stacked.svg \
+ images/code128_stacked_sep2.svg \
+ images/codablockf.svg \
+ images/code16k.svg \
+ images/pdf417.svg \
+ images/pdf417comp.svg \
+ images/micropdf417.svg \
+ images/dbar_stk.svg \
+ images/dbar_omnstk.svg \
+ images/dbar_expstk.svg \
+ images/code49.svg \
+ images/eanx_cc_a.svg \
+ images/eanx_cc_b.svg \
+ images/gs1_128_cc_c.svg \
+ images/pharma_two.svg \
+ images/postnet.svg \
+ images/planet.svg \
+ images/auspost.svg \
+ images/ausroute.svg \
+ images/ausreply.svg \
+ images/ausredirect.svg \
+ images/kix.svg \
+ images/rm4scc.svg \
+ images/mailmark.svg \
+ images/usps_imail.svg \
+ images/japanpost.svg \
+ images/hibc_dm.svg \
+ images/qrcode.svg \
+ images/microqr.svg \
+ images/rmqr.svg \
+ images/upnqr.svg \
+ images/maxicode.svg \
+ images/aztec.svg \
+ images/azrune.svg \
+ images/codeone.svg \
+ images/gridmatrix.svg \
+ images/dotcode.svg \
+ images/hanxin.svg \
+ images/ultra.svg \
+ images/fim.svg \
+ images/flat.svg \
+ images/daft_rm4scc.svg
+MAIN_FONT = mainfont="TeX Gyre Pagella"
+MONO_FONT = monofont="Liberation Mono"
+CJK_FONT = CJKmainfont="WenQuanYi Micro Hei Mono"
+PDF_OPTS = --pdf-engine=xelatex --filter pandoc-tablenos --highlight-style=$(HIGHLIGHT_THEME) -V block-headings \
+ -V colorlinks -V geometry:margin=20mm -V papersize=a4 --dpi=300 -M tablenos-warning-level=0
+TXT_OPTS = --columns 80 --eol=lf -t plain
+SOURCE_MAN = zint.1.pmd
+OUT_MAN = zint.1
+MAN_OPTS = -t man -s
+
+all : $(OUT_PDF) $(OUT_TXT) $(OUT_MAN)
+
+$(OUT_PDF) : $(SOURCE) $(HIGHLIGHT_THEME) $(INC_HEADER_PDF) $(INC_BEFORE_BODY_PDF) $(IMAGES) Makefile
+ pandoc $(SOURCE) -f markdown $(INC_PDF) --toc --toc-depth=4 \
+ -V $(MAIN_FONT) -V $(MONO_FONT) -V $(CJK_FONT) \
+ $(PDF_OPTS) \
+ -o $(OUT_PDF)
+
+$(OUT_TXT) : $(SOURCE) $(INCLUDES_TXT) Makefile
+ pandoc $(SOURCE) -f markdown $(INC_TXT) --toc --toc-depth=4 \
+ -V $(MAIN_FONT) -V $(MONO_FONT) -V $(CJK_FONT) \
+ $(TXT_OPTS) \
+ -o $(OUT_TXT)
+ sed -i -e 's/ *$//' $(OUT_TXT)
+
+$(OUT_MAN) : $(SOURCE_MAN) Makefile
+ pandoc $(SOURCE_MAN) -f markdown \
+ $(MAN_OPTS) \
+ -o $(OUT_MAN)
+ gzip -c -9 $(OUT_MAN) > $(OUT_MAN).gz
diff --git a/docs/README b/docs/README
new file mode 100644
index 00000000..316cfd78
--- /dev/null
+++ b/docs/README
@@ -0,0 +1,34 @@
+For generation of "docs/manual.pdf" and "docs/manual.txt" from "manual.pmd" using a recent version of pandoc
+
+On Ubuntu/Debian (tested on Ubuntu 22.04)
+
+ wget https://github.com/jgm/pandoc/releases/download/2.18/pandoc-2.18-1-amd64.deb
+ sudo dpkg -i pandoc-2.18-1-amd64.deb
+ sudo apt install python3-pip
+ pip install pandoc-tablenos --user
+ export PATH=~/.local/bin:"$PATH"
+ sudo apt install librsvg2-bin
+ sudo apt install texlive-xetex
+ sudo apt install texlive-lang-cjk
+ sudo apt install fonts-wqy-microhei
+ make
+
+On Windows
+
+Install https://github.com/jgm/pandoc/releases/download/2.18/pandoc-2.18-windows-x86_64.msi
+
+From command prompt run as administrator
+
+ choco install make
+ choco install rsvg-convert
+ choco install python
+ choco install miktex
+
+ pip install pandoc-tablenos --user
+
+From normal command prompt run from zint "docs" directory
+
+ set "PATH=:%PATH%"
+
+TODO
+??? On make, get various font errors Helvetica, TeX Gyre Pagella which miktex can't handle ???
diff --git a/docs/images/auspost.svg b/docs/images/auspost.svg
new file mode 100644
index 00000000..5b5af1df
--- /dev/null
+++ b/docs/images/auspost.svg
@@ -0,0 +1,49 @@
+
+
+
diff --git a/docs/images/ausredirect.svg b/docs/images/ausredirect.svg
new file mode 100644
index 00000000..a1667561
--- /dev/null
+++ b/docs/images/ausredirect.svg
@@ -0,0 +1,49 @@
+
+
+
diff --git a/docs/images/ausreply.svg b/docs/images/ausreply.svg
new file mode 100644
index 00000000..90db861c
--- /dev/null
+++ b/docs/images/ausreply.svg
@@ -0,0 +1,49 @@
+
+
+
diff --git a/docs/images/ausroute.svg b/docs/images/ausroute.svg
new file mode 100644
index 00000000..5fb57372
--- /dev/null
+++ b/docs/images/ausroute.svg
@@ -0,0 +1,49 @@
+
+
+
diff --git a/docs/images/azrune.svg b/docs/images/azrune.svg
new file mode 100644
index 00000000..eae25a28
--- /dev/null
+++ b/docs/images/azrune.svg
@@ -0,0 +1,32 @@
+
+
+
diff --git a/docs/images/aztec.svg b/docs/images/aztec.svg
new file mode 100644
index 00000000..5d79d96f
--- /dev/null
+++ b/docs/images/aztec.svg
@@ -0,0 +1,58 @@
+
+
+
diff --git a/docs/images/aztec_segs.svg b/docs/images/aztec_segs.svg
new file mode 100644
index 00000000..48b67282
--- /dev/null
+++ b/docs/images/aztec_segs.svg
@@ -0,0 +1,125 @@
+
+
+
diff --git a/docs/images/c25iata.svg b/docs/images/c25iata.svg
new file mode 100644
index 00000000..51668977
--- /dev/null
+++ b/docs/images/c25iata.svg
@@ -0,0 +1,70 @@
+
+
+
diff --git a/docs/images/c25ind.svg b/docs/images/c25ind.svg
new file mode 100644
index 00000000..c53380a0
--- /dev/null
+++ b/docs/images/c25ind.svg
@@ -0,0 +1,72 @@
+
+
+
diff --git a/docs/images/c25inter.svg b/docs/images/c25inter.svg
new file mode 100644
index 00000000..6b88e20d
--- /dev/null
+++ b/docs/images/c25inter.svg
@@ -0,0 +1,45 @@
+
+
+
diff --git a/docs/images/c25logic.svg b/docs/images/c25logic.svg
new file mode 100644
index 00000000..d9159821
--- /dev/null
+++ b/docs/images/c25logic.svg
@@ -0,0 +1,50 @@
+
+
+
diff --git a/docs/images/c25standard.svg b/docs/images/c25standard.svg
new file mode 100644
index 00000000..51a41031
--- /dev/null
+++ b/docs/images/c25standard.svg
@@ -0,0 +1,52 @@
+
+
+
diff --git a/docs/images/channel.svg b/docs/images/channel.svg
new file mode 100644
index 00000000..9427768f
--- /dev/null
+++ b/docs/images/channel.svg
@@ -0,0 +1,28 @@
+
+
+
diff --git a/docs/images/codabar.svg b/docs/images/codabar.svg
new file mode 100644
index 00000000..7e99db56
--- /dev/null
+++ b/docs/images/codabar.svg
@@ -0,0 +1,44 @@
+
+
+
diff --git a/docs/images/codablockf.svg b/docs/images/codablockf.svg
new file mode 100644
index 00000000..91cbcc49
--- /dev/null
+++ b/docs/images/codablockf.svg
@@ -0,0 +1,102 @@
+
+
+
diff --git a/docs/images/code11.svg b/docs/images/code11.svg
new file mode 100644
index 00000000..24c29f58
--- /dev/null
+++ b/docs/images/code11.svg
@@ -0,0 +1,58 @@
+
+
+
diff --git a/docs/images/code128.svg b/docs/images/code128.svg
new file mode 100644
index 00000000..fc2d9a71
--- /dev/null
+++ b/docs/images/code128.svg
@@ -0,0 +1,50 @@
+
+
+
diff --git a/docs/images/code128_box.svg b/docs/images/code128_box.svg
new file mode 100644
index 00000000..c42ebb67
--- /dev/null
+++ b/docs/images/code128_box.svg
@@ -0,0 +1,57 @@
+
+
+
diff --git a/docs/images/code128_green.svg b/docs/images/code128_green.svg
new file mode 100644
index 00000000..53e1fbda
--- /dev/null
+++ b/docs/images/code128_green.svg
@@ -0,0 +1,53 @@
+
+
+
diff --git a/docs/images/code128_green_alpha.svg b/docs/images/code128_green_alpha.svg
new file mode 100644
index 00000000..1ef3c5f1
--- /dev/null
+++ b/docs/images/code128_green_alpha.svg
@@ -0,0 +1,53 @@
+
+
+
diff --git a/docs/images/code128_rotate90.svg b/docs/images/code128_rotate90.svg
new file mode 100644
index 00000000..5681f9ab
--- /dev/null
+++ b/docs/images/code128_rotate90.svg
@@ -0,0 +1,53 @@
+
+
+
diff --git a/docs/images/code128_small_bold.svg b/docs/images/code128_small_bold.svg
new file mode 100644
index 00000000..1ef0243d
--- /dev/null
+++ b/docs/images/code128_small_bold.svg
@@ -0,0 +1,53 @@
+
+
+
diff --git a/docs/images/code128_stacked.svg b/docs/images/code128_stacked.svg
new file mode 100644
index 00000000..f82ca4e7
--- /dev/null
+++ b/docs/images/code128_stacked.svg
@@ -0,0 +1,42 @@
+
+
+
diff --git a/docs/images/code128_stacked_sep2.svg b/docs/images/code128_stacked_sep2.svg
new file mode 100644
index 00000000..7c01ef03
--- /dev/null
+++ b/docs/images/code128_stacked_sep2.svg
@@ -0,0 +1,39 @@
+
+
+
diff --git a/docs/images/code128b.svg b/docs/images/code128b.svg
new file mode 100644
index 00000000..11f48a90
--- /dev/null
+++ b/docs/images/code128b.svg
@@ -0,0 +1,56 @@
+
+
+
diff --git a/docs/images/code16k.svg b/docs/images/code16k.svg
new file mode 100644
index 00000000..c45fea36
--- /dev/null
+++ b/docs/images/code16k.svg
@@ -0,0 +1,49 @@
+
+
+
diff --git a/docs/images/code32.svg b/docs/images/code32.svg
new file mode 100644
index 00000000..996447bb
--- /dev/null
+++ b/docs/images/code32.svg
@@ -0,0 +1,56 @@
+
+
+
diff --git a/docs/images/code39.svg b/docs/images/code39.svg
new file mode 100644
index 00000000..60d4cf4a
--- /dev/null
+++ b/docs/images/code39.svg
@@ -0,0 +1,41 @@
+
+
+
diff --git a/docs/images/code49.svg b/docs/images/code49.svg
new file mode 100644
index 00000000..b8044f51
--- /dev/null
+++ b/docs/images/code49.svg
@@ -0,0 +1,93 @@
+
+
+
diff --git a/docs/images/code93.svg b/docs/images/code93.svg
new file mode 100644
index 00000000..2dcf5582
--- /dev/null
+++ b/docs/images/code93.svg
@@ -0,0 +1,38 @@
+
+
+
diff --git a/docs/images/codeone.svg b/docs/images/codeone.svg
new file mode 100644
index 00000000..5c1bff6b
--- /dev/null
+++ b/docs/images/codeone.svg
@@ -0,0 +1,59 @@
+
+
+
diff --git a/docs/images/codeone_s_dotty.svg b/docs/images/codeone_s_dotty.svg
new file mode 100644
index 00000000..211f5f52
--- /dev/null
+++ b/docs/images/codeone_s_dotty.svg
@@ -0,0 +1,139 @@
+
+
+
diff --git a/docs/images/daft_rm4scc.svg b/docs/images/daft_rm4scc.svg
new file mode 100644
index 00000000..4ca91272
--- /dev/null
+++ b/docs/images/daft_rm4scc.svg
@@ -0,0 +1,50 @@
+
+
+
diff --git a/docs/images/datamatrix_big5.svg b/docs/images/datamatrix_big5.svg
new file mode 100644
index 00000000..ba670a1e
--- /dev/null
+++ b/docs/images/datamatrix_big5.svg
@@ -0,0 +1,52 @@
+
+
+
diff --git a/docs/images/datamatrix_euro.svg b/docs/images/datamatrix_euro.svg
new file mode 100644
index 00000000..b7fd88dc
--- /dev/null
+++ b/docs/images/datamatrix_euro.svg
@@ -0,0 +1,52 @@
+
+
+
diff --git a/docs/images/datamatrix_structapp.svg b/docs/images/datamatrix_structapp.svg
new file mode 100644
index 00000000..c4bffd3b
--- /dev/null
+++ b/docs/images/datamatrix_structapp.svg
@@ -0,0 +1,76 @@
+
+
+
diff --git a/docs/images/dbar_exp.svg b/docs/images/dbar_exp.svg
new file mode 100644
index 00000000..d4d8687b
--- /dev/null
+++ b/docs/images/dbar_exp.svg
@@ -0,0 +1,60 @@
+
+
+
diff --git a/docs/images/dbar_expstk.svg b/docs/images/dbar_expstk.svg
new file mode 100644
index 00000000..ec8bce87
--- /dev/null
+++ b/docs/images/dbar_expstk.svg
@@ -0,0 +1,137 @@
+
+
+
diff --git a/docs/images/dbar_ltd.svg b/docs/images/dbar_ltd.svg
new file mode 100644
index 00000000..faa04ea9
--- /dev/null
+++ b/docs/images/dbar_ltd.svg
@@ -0,0 +1,39 @@
+
+
+
diff --git a/docs/images/dbar_omn.svg b/docs/images/dbar_omn.svg
new file mode 100644
index 00000000..dab901e7
--- /dev/null
+++ b/docs/images/dbar_omn.svg
@@ -0,0 +1,39 @@
+
+
+
diff --git a/docs/images/dbar_omnstk.svg b/docs/images/dbar_omnstk.svg
new file mode 100644
index 00000000..8b0b30c6
--- /dev/null
+++ b/docs/images/dbar_omnstk.svg
@@ -0,0 +1,75 @@
+
+
+
diff --git a/docs/images/dbar_stk.svg b/docs/images/dbar_stk.svg
new file mode 100644
index 00000000..f863572a
--- /dev/null
+++ b/docs/images/dbar_stk.svg
@@ -0,0 +1,53 @@
+
+
+
diff --git a/docs/images/dbar_truncated.svg b/docs/images/dbar_truncated.svg
new file mode 100644
index 00000000..810a08c4
--- /dev/null
+++ b/docs/images/dbar_truncated.svg
@@ -0,0 +1,39 @@
+
+
+
diff --git a/docs/images/dotcode.svg b/docs/images/dotcode.svg
new file mode 100644
index 00000000..5ba34a2d
--- /dev/null
+++ b/docs/images/dotcode.svg
@@ -0,0 +1,177 @@
+
+
+
diff --git a/docs/images/dpd.svg b/docs/images/dpd.svg
new file mode 100644
index 00000000..d31dcd53
--- /dev/null
+++ b/docs/images/dpd.svg
@@ -0,0 +1,74 @@
+
+
+
diff --git a/docs/images/dpident.svg b/docs/images/dpident.svg
new file mode 100644
index 00000000..cac75f1c
--- /dev/null
+++ b/docs/images/dpident.svg
@@ -0,0 +1,50 @@
+
+
+
diff --git a/docs/images/dpleit.svg b/docs/images/dpleit.svg
new file mode 100644
index 00000000..5a29691a
--- /dev/null
+++ b/docs/images/dpleit.svg
@@ -0,0 +1,55 @@
+
+
+
diff --git a/docs/images/ean14.svg b/docs/images/ean14.svg
new file mode 100644
index 00000000..46e55381
--- /dev/null
+++ b/docs/images/ean14.svg
@@ -0,0 +1,53 @@
+
+
+
diff --git a/docs/images/eanx13.svg b/docs/images/eanx13.svg
new file mode 100644
index 00000000..b47cff6d
--- /dev/null
+++ b/docs/images/eanx13.svg
@@ -0,0 +1,54 @@
+
+
+
diff --git a/docs/images/eanx5.svg b/docs/images/eanx5.svg
new file mode 100644
index 00000000..f1925131
--- /dev/null
+++ b/docs/images/eanx5.svg
@@ -0,0 +1,32 @@
+
+
+
diff --git a/docs/images/eanx8_5.svg b/docs/images/eanx8_5.svg
new file mode 100644
index 00000000..7457ae0a
--- /dev/null
+++ b/docs/images/eanx8_5.svg
@@ -0,0 +1,62 @@
+
+
+
diff --git a/docs/images/eanx_cc_a.svg b/docs/images/eanx_cc_a.svg
new file mode 100644
index 00000000..9f610fc1
--- /dev/null
+++ b/docs/images/eanx_cc_a.svg
@@ -0,0 +1,119 @@
+
+
+
diff --git a/docs/images/eanx_cc_b.svg b/docs/images/eanx_cc_b.svg
new file mode 100644
index 00000000..654ea9fd
--- /dev/null
+++ b/docs/images/eanx_cc_b.svg
@@ -0,0 +1,168 @@
+
+
+
diff --git a/docs/images/excode39.svg b/docs/images/excode39.svg
new file mode 100644
index 00000000..c9dc5bc7
--- /dev/null
+++ b/docs/images/excode39.svg
@@ -0,0 +1,76 @@
+
+
+
diff --git a/docs/images/fim.svg b/docs/images/fim.svg
new file mode 100644
index 00000000..d12f56b3
--- /dev/null
+++ b/docs/images/fim.svg
@@ -0,0 +1,18 @@
+
+
+
diff --git a/docs/images/flat.svg b/docs/images/flat.svg
new file mode 100644
index 00000000..51dc4d8a
--- /dev/null
+++ b/docs/images/flat.svg
@@ -0,0 +1,17 @@
+
+
+
diff --git a/docs/images/gridmatrix.svg b/docs/images/gridmatrix.svg
new file mode 100644
index 00000000..529773e1
--- /dev/null
+++ b/docs/images/gridmatrix.svg
@@ -0,0 +1,498 @@
+
+
+
diff --git a/docs/images/gs1_128.svg b/docs/images/gs1_128.svg
new file mode 100644
index 00000000..70aee55f
--- /dev/null
+++ b/docs/images/gs1_128.svg
@@ -0,0 +1,80 @@
+
+
+
diff --git a/docs/images/gs1_128_cc_c.svg b/docs/images/gs1_128_cc_c.svg
new file mode 100644
index 00000000..4a306137
--- /dev/null
+++ b/docs/images/gs1_128_cc_c.svg
@@ -0,0 +1,207 @@
+
+
+
diff --git a/docs/images/gui_appearance.png b/docs/images/gui_appearance.png
new file mode 100644
index 00000000..04b522dc
Binary files /dev/null and b/docs/images/gui_appearance.png differ
diff --git a/docs/images/gui_aztec.png b/docs/images/gui_aztec.png
new file mode 100644
index 00000000..6efab76a
Binary files /dev/null and b/docs/images/gui_aztec.png differ
diff --git a/docs/images/gui_cli_equivalent.png b/docs/images/gui_cli_equivalent.png
new file mode 100644
index 00000000..cfba5c79
Binary files /dev/null and b/docs/images/gui_cli_equivalent.png differ
diff --git a/docs/images/gui_colour.png b/docs/images/gui_colour.png
new file mode 100644
index 00000000..d087800b
Binary files /dev/null and b/docs/images/gui_colour.png differ
diff --git a/docs/images/gui_composite.png b/docs/images/gui_composite.png
new file mode 100644
index 00000000..7b246856
Binary files /dev/null and b/docs/images/gui_composite.png differ
diff --git a/docs/images/gui_data_dialog.png b/docs/images/gui_data_dialog.png
new file mode 100644
index 00000000..975982fb
Binary files /dev/null and b/docs/images/gui_data_dialog.png differ
diff --git a/docs/images/gui_export.png b/docs/images/gui_export.png
new file mode 100644
index 00000000..a7950347
Binary files /dev/null and b/docs/images/gui_export.png differ
diff --git a/docs/images/gui_main.png b/docs/images/gui_main.png
new file mode 100644
index 00000000..e2fd51b0
Binary files /dev/null and b/docs/images/gui_main.png differ
diff --git a/docs/images/gui_menus.png b/docs/images/gui_menus.png
new file mode 100644
index 00000000..27c1aab0
Binary files /dev/null and b/docs/images/gui_menus.png differ
diff --git a/docs/images/gui_segs.png b/docs/images/gui_segs.png
new file mode 100644
index 00000000..23d3e4e4
Binary files /dev/null and b/docs/images/gui_segs.png differ
diff --git a/docs/images/gui_sequence.png b/docs/images/gui_sequence.png
new file mode 100644
index 00000000..1c474be9
Binary files /dev/null and b/docs/images/gui_sequence.png differ
diff --git a/docs/images/hanxin.svg b/docs/images/hanxin.svg
new file mode 100644
index 00000000..0f6428ef
--- /dev/null
+++ b/docs/images/hanxin.svg
@@ -0,0 +1,105 @@
+
+
+
diff --git a/docs/images/hibc_128.svg b/docs/images/hibc_128.svg
new file mode 100644
index 00000000..d5ecbd4d
--- /dev/null
+++ b/docs/images/hibc_128.svg
@@ -0,0 +1,71 @@
+
+
+
diff --git a/docs/images/hibc_39.svg b/docs/images/hibc_39.svg
new file mode 100644
index 00000000..eaa1060e
--- /dev/null
+++ b/docs/images/hibc_39.svg
@@ -0,0 +1,76 @@
+
+
+
diff --git a/docs/images/hibc_dm.svg b/docs/images/hibc_dm.svg
new file mode 100644
index 00000000..1468d864
--- /dev/null
+++ b/docs/images/hibc_dm.svg
@@ -0,0 +1,106 @@
+
+
+
diff --git a/docs/images/isbnx.svg b/docs/images/isbnx.svg
new file mode 100644
index 00000000..0ae14b04
--- /dev/null
+++ b/docs/images/isbnx.svg
@@ -0,0 +1,54 @@
+
+
+
diff --git a/docs/images/itf14.svg b/docs/images/itf14.svg
new file mode 100644
index 00000000..739e20c6
--- /dev/null
+++ b/docs/images/itf14.svg
@@ -0,0 +1,59 @@
+
+
+
diff --git a/docs/images/itf14_border0.svg b/docs/images/itf14_border0.svg
new file mode 100644
index 00000000..18a58a10
--- /dev/null
+++ b/docs/images/itf14_border0.svg
@@ -0,0 +1,55 @@
+
+
+
diff --git a/docs/images/japanpost.svg b/docs/images/japanpost.svg
new file mode 100644
index 00000000..d0f93273
--- /dev/null
+++ b/docs/images/japanpost.svg
@@ -0,0 +1,79 @@
+
+
+
diff --git a/docs/images/kix.svg b/docs/images/kix.svg
new file mode 100644
index 00000000..dbf70630
--- /dev/null
+++ b/docs/images/kix.svg
@@ -0,0 +1,56 @@
+
+
+
diff --git a/docs/images/koreapost.svg b/docs/images/koreapost.svg
new file mode 100644
index 00000000..fac663d8
--- /dev/null
+++ b/docs/images/koreapost.svg
@@ -0,0 +1,44 @@
+
+
+
diff --git a/docs/images/logmars.svg b/docs/images/logmars.svg
new file mode 100644
index 00000000..c4503afc
--- /dev/null
+++ b/docs/images/logmars.svg
@@ -0,0 +1,86 @@
+
+
+
diff --git a/docs/images/mailmark.svg b/docs/images/mailmark.svg
new file mode 100644
index 00000000..f06d89be
--- /dev/null
+++ b/docs/images/mailmark.svg
@@ -0,0 +1,78 @@
+
+
+
diff --git a/docs/images/maxicode.svg b/docs/images/maxicode.svg
new file mode 100644
index 00000000..88448c7e
--- /dev/null
+++ b/docs/images/maxicode.svg
@@ -0,0 +1,451 @@
+
+
+
diff --git a/docs/images/micropdf417.svg b/docs/images/micropdf417.svg
new file mode 100644
index 00000000..7ec983a6
--- /dev/null
+++ b/docs/images/micropdf417.svg
@@ -0,0 +1,80 @@
+
+
+
diff --git a/docs/images/microqr.svg b/docs/images/microqr.svg
new file mode 100644
index 00000000..38136443
--- /dev/null
+++ b/docs/images/microqr.svg
@@ -0,0 +1,43 @@
+
+
+
diff --git a/docs/images/msi_plessey.svg b/docs/images/msi_plessey.svg
new file mode 100644
index 00000000..2b639ecc
--- /dev/null
+++ b/docs/images/msi_plessey.svg
@@ -0,0 +1,43 @@
+
+
+
diff --git a/docs/images/nve18.svg b/docs/images/nve18.svg
new file mode 100644
index 00000000..a6d4fd36
--- /dev/null
+++ b/docs/images/nve18.svg
@@ -0,0 +1,59 @@
+
+
+
diff --git a/docs/images/pdf417.svg b/docs/images/pdf417.svg
new file mode 100644
index 00000000..20d2d62e
--- /dev/null
+++ b/docs/images/pdf417.svg
@@ -0,0 +1,113 @@
+
+
+
diff --git a/docs/images/pdf417_heightperrow.svg b/docs/images/pdf417_heightperrow.svg
new file mode 100644
index 00000000..dc49b3d0
--- /dev/null
+++ b/docs/images/pdf417_heightperrow.svg
@@ -0,0 +1,140 @@
+
+
+
diff --git a/docs/images/pdf417comp.svg b/docs/images/pdf417comp.svg
new file mode 100644
index 00000000..039c6292
--- /dev/null
+++ b/docs/images/pdf417comp.svg
@@ -0,0 +1,87 @@
+
+
+
diff --git a/docs/images/pharma.svg b/docs/images/pharma.svg
new file mode 100644
index 00000000..316f461c
--- /dev/null
+++ b/docs/images/pharma.svg
@@ -0,0 +1,28 @@
+
+
+
diff --git a/docs/images/pharma_two.svg b/docs/images/pharma_two.svg
new file mode 100644
index 00000000..67003b84
--- /dev/null
+++ b/docs/images/pharma_two.svg
@@ -0,0 +1,28 @@
+
+
+
diff --git a/docs/images/planet.svg b/docs/images/planet.svg
new file mode 100644
index 00000000..904f4615
--- /dev/null
+++ b/docs/images/planet.svg
@@ -0,0 +1,84 @@
+
+
+
diff --git a/docs/images/plessey.svg b/docs/images/plessey.svg
new file mode 100644
index 00000000..ed15115c
--- /dev/null
+++ b/docs/images/plessey.svg
@@ -0,0 +1,45 @@
+
+
+
diff --git a/docs/images/postnet.svg b/docs/images/postnet.svg
new file mode 100644
index 00000000..145b59aa
--- /dev/null
+++ b/docs/images/postnet.svg
@@ -0,0 +1,74 @@
+
+
+
diff --git a/docs/images/pzn.svg b/docs/images/pzn.svg
new file mode 100644
index 00000000..e9b127e2
--- /dev/null
+++ b/docs/images/pzn.svg
@@ -0,0 +1,71 @@
+
+
+
diff --git a/docs/images/qrcode.svg b/docs/images/qrcode.svg
new file mode 100644
index 00000000..0b516b88
--- /dev/null
+++ b/docs/images/qrcode.svg
@@ -0,0 +1,83 @@
+
+
+
diff --git a/docs/images/qrcode_binary_utf8.svg b/docs/images/qrcode_binary_utf8.svg
new file mode 100644
index 00000000..5177ffff
--- /dev/null
+++ b/docs/images/qrcode_binary_utf8.svg
@@ -0,0 +1,93 @@
+
+
+
diff --git a/docs/images/qrcode_box.svg b/docs/images/qrcode_box.svg
new file mode 100644
index 00000000..a0ada253
--- /dev/null
+++ b/docs/images/qrcode_box.svg
@@ -0,0 +1,97 @@
+
+
+
diff --git a/docs/images/rm4scc.svg b/docs/images/rm4scc.svg
new file mode 100644
index 00000000..05fe5512
--- /dev/null
+++ b/docs/images/rm4scc.svg
@@ -0,0 +1,50 @@
+
+
+
diff --git a/docs/images/rmqr.svg b/docs/images/rmqr.svg
new file mode 100644
index 00000000..a52c5043
--- /dev/null
+++ b/docs/images/rmqr.svg
@@ -0,0 +1,79 @@
+
+
+
diff --git a/docs/images/telepen.svg b/docs/images/telepen.svg
new file mode 100644
index 00000000..10501ee9
--- /dev/null
+++ b/docs/images/telepen.svg
@@ -0,0 +1,48 @@
+
+
+
diff --git a/docs/images/telepen_num.svg b/docs/images/telepen_num.svg
new file mode 100644
index 00000000..369449d7
--- /dev/null
+++ b/docs/images/telepen_num.svg
@@ -0,0 +1,50 @@
+
+
+
diff --git a/docs/images/ultra.svg b/docs/images/ultra.svg
new file mode 100644
index 00000000..c6fd1210
--- /dev/null
+++ b/docs/images/ultra.svg
@@ -0,0 +1,282 @@
+
+
+
diff --git a/docs/images/upca.svg b/docs/images/upca.svg
new file mode 100644
index 00000000..7858819f
--- /dev/null
+++ b/docs/images/upca.svg
@@ -0,0 +1,58 @@
+
+
+
diff --git a/docs/images/upca_5.svg b/docs/images/upca_5.svg
new file mode 100644
index 00000000..9c5d4fc2
--- /dev/null
+++ b/docs/images/upca_5.svg
@@ -0,0 +1,78 @@
+
+
+
diff --git a/docs/images/upce.svg b/docs/images/upce.svg
new file mode 100644
index 00000000..c7789bfe
--- /dev/null
+++ b/docs/images/upce.svg
@@ -0,0 +1,41 @@
+
+
+
diff --git a/docs/images/upnqr.svg b/docs/images/upnqr.svg
new file mode 100644
index 00000000..3b9d46d0
--- /dev/null
+++ b/docs/images/upnqr.svg
@@ -0,0 +1,1574 @@
+
+
+
diff --git a/docs/images/usps_imail.svg b/docs/images/usps_imail.svg
new file mode 100644
index 00000000..f413c2e7
--- /dev/null
+++ b/docs/images/usps_imail.svg
@@ -0,0 +1,77 @@
+
+
+
diff --git a/docs/images/vin.svg b/docs/images/vin.svg
new file mode 100644
index 00000000..cc53f531
--- /dev/null
+++ b/docs/images/vin.svg
@@ -0,0 +1,116 @@
+
+
+
diff --git a/docs/images/zint-qt.png b/docs/images/zint-qt.png
new file mode 100644
index 00000000..b783ac83
Binary files /dev/null and b/docs/images/zint-qt.png differ
diff --git a/docs/images/zint-qt.svg b/docs/images/zint-qt.svg
new file mode 100644
index 00000000..d6ff5893
--- /dev/null
+++ b/docs/images/zint-qt.svg
@@ -0,0 +1,8 @@
+
+
diff --git a/docs/images/zint.png b/docs/images/zint.png
new file mode 100644
index 00000000..f5bdd9be
Binary files /dev/null and b/docs/images/zint.png differ
diff --git a/docs/images/zint.svg b/docs/images/zint.svg
new file mode 100644
index 00000000..12a10c25
--- /dev/null
+++ b/docs/images/zint.svg
@@ -0,0 +1,8 @@
+
+
diff --git a/docs/inc_before_body_pdf.tex b/docs/inc_before_body_pdf.tex
new file mode 100644
index 00000000..3219b093
--- /dev/null
+++ b/docs/inc_before_body_pdf.tex
@@ -0,0 +1,15 @@
+\begin{center}
+\end{center}
+\begin{figure}
+\begin{center}
+\includegraphics{images/zint.png}
+\vfill
+\includegraphics{images/zint-qt.png}
+\end{center}
+\end{figure}
+\hypersetup{
+ pdfauthor=Robin Stuart,
+ pdfsubject={Zint},
+ pdfkeywords={zint,barcode,generator}
+}
+\thispagestyle{empty}
diff --git a/docs/inc_header_pdf.tex b/docs/inc_header_pdf.tex
new file mode 100644
index 00000000..34c746a0
--- /dev/null
+++ b/docs/inc_header_pdf.tex
@@ -0,0 +1,82 @@
+%% For pandoc --include-in-header
+%%
+%% Start sections on new pages
+\usepackage{sectsty}
+\sectionfont{\clearpage}
+
+%% Place figures "here" (i.e. immediately, don't move them around)
+\usepackage{graphicx}
+\usepackage{float}
+\floatplacement{figure}{H}
+
+%% For glossary definition list
+%% https://github.com/jgm/pandoc/wiki/Pandoc-Tricks#definition-list-terms-on-their-own-line-in-latex
+\let\originalitem\item
+\makeatletter
+\renewcommand{\item}[1][\@nil]{
+ \def\tmp{#1}
+ \ifx\tmp\@nnil\originalitem\else\originalitem[#1]\hfill\par\fi}
+\makeatother
+
+%% Text and background color for inline code
+\usepackage{xcolor}
+\usepackage{fvextra}
+\definecolor{icfg}{HTML}{331a33}
+\let\oldtexttt\texttt
+\renewcommand{\texttt}[1]{\textcolor{icfg}{\oldtexttt{#1}}}
+%% Unfortunately this messes up wrapping TODO: fix
+%% Background color for inline code https://tex.stackexchange.com/a/507116
+%\definecolor{icbg}{HTML}{fafafa} % Same as modified pygments.theme
+%\newcommand{\code}[1]{
+ %\begingroup\setlength{\fboxsep}{1pt}
+ %\colorbox{icbg}{\oldtexttt{\hspace*{0.1pt}\vphantom{A}#1\hspace*{0.1pt}}}\endgroup}
+%\renewcommand{\texttt}[1]{\textcolor{icfg}{\code{\oldtexttt{#1}}}}
+
+%% Make level-4 headings standalone (not run-in) - for some reason "-V block-headings" doesn't seem to work, so do
+%% what it does manually here
+\let\oldparagraph\paragraph
+\renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}}
+
+%% https://github.com/tomduck/pandoc-tablenos
+%% As using --include-in-header (this file), need to manually include the following (displayed by setting
+%% "-M tablenos-warning-level=2"):
+
+%% PDF metadata - the values are set in "docs/inc_before_body.tex" (otherwise may get overridden)
+\usepackage{hyperref}
+
+%% pandoc-tablenos: required package
+\usepackage{caption}
+
+%% pandoc-tablenos: environment to disable table caption prefixes
+\makeatletter
+\newcounter{tableno}
+\newenvironment{tablenos:no-prefix-table-caption}{
+ \caption@ifcompatibility{}{
+ \let\oldthetable\thetable
+ \let\oldtheHtable\theHtable
+ \renewcommand{\thetable}{tableno:\thetableno}
+ \renewcommand{\theHtable}{tableno:\thetableno}
+ \stepcounter{tableno}
+ \captionsetup{labelformat=empty}
+ }
+}{
+ \caption@ifcompatibility{}{
+ \captionsetup{labelformat=default}
+ \let\thetable\oldthetable
+ \let\theHtable\oldtheHtable
+ \addtocounter{table}{-1}
+ }
+}
+\makeatother
+
+%% pandoc-tablenos: environment for tagged tables
+\newenvironment{tablenos:tagged-table}[1][]{
+ \let\oldthetable\thetable
+ \let\oldtheHtable\theHtable
+ \renewcommand{\thetable}{#1}
+ \renewcommand{\theHtable}{#1}
+}{
+ \let\thetable\oldthetable
+ \let\theHtable\oldtheHtable
+ \addtocounter{table}{-1}
+}
diff --git a/docs/inc_header_txt.tex b/docs/inc_header_txt.tex
new file mode 100644
index 00000000..ad305ee3
--- /dev/null
+++ b/docs/inc_header_txt.tex
@@ -0,0 +1,6 @@
+*******************************************************************************
+* For reference the following is a text-only version of the Zint manual, *
+* generated from "docs/manual.pmd" by pandoc. *
+* A HTML version can be accessed at http://zint.org.uk/Manual.aspx *
+* however this text file is more likely to be up-to-date. *
+*******************************************************************************
diff --git a/docs/manual.pdf b/docs/manual.pdf
new file mode 100644
index 00000000..d84fecb7
Binary files /dev/null and b/docs/manual.pdf differ
diff --git a/docs/manual.pmd b/docs/manual.pmd
new file mode 100644
index 00000000..e4e0bca3
--- /dev/null
+++ b/docs/manual.pmd
@@ -0,0 +1,4217 @@
+% Zint Barcode Generator and Zint Barcode Studio User Manual
+% Version 2.10.0.9
+% May 2022
+
+# 1. Introduction
+
+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.
+
+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 either a Portable Network
+Graphic (PNG) image, Windows Bitmap (BMP), Graphics Interchange Format (GIF),
+ZSoft Paintbrush image (PCX), Tagged Image File Format (TIF), Enhanced Metafile
+Format (EMF), as Encapsulated PostScript (EPS), or as a Scalable Vector Graphic
+(SVG). 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.
+
+## 1.1 Glossary
+
+Some of the words and phrases used in this document are specific to barcoding,
+and so a brief explanation is given to help understanding:
+
+symbol:
+: 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.
+
+symbology:
+: A method of encoding data to create a certain type of symbol.
+
+linear:
+: 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.
+
+stacked:
+: 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.
+
+matrix:
+: A matrix or two-dimensional 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.
+
+composite:
+: 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.
+
+X-dimension:
+: 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 multiples of the
+ X-dimension. 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.
+
+GS1 data:
+: 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.
+
+Reader Initialisation:
+: 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.
+
+ECI:
+: 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.
+
+Two other concepts that are important are raster and vector.
+
+raster:
+: A low level bitmap representation of an image. BMP, GIF, PCX, PNG and TIF
+ are raster file formats.
+
+vector:
+: 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.
+
+
+# 2. Installing Zint
+
+## 2.1 Linux
+
+The easiest way to configure compilation is to take advantage of the CMake
+utilities. You will need to install CMake and `libpng-dev` first. For instance
+on `apt` systems:
+
+```bash
+sudo apt install git cmake build-essential libpng-dev
+```
+
+If you want to take advantage of Zint Barcode Studio you will also need to have
+Qt and its component `"Desktop gcc 64-bit"` installed, as well as `mesa`. For
+details see `"README.linux"` in the project root directory.
+
+Once you have fulfilled these requirements unzip the source code tarball or
+clone the latest source
+
+```bash
+git clone https://git.code.sf.net/p/zint/code zint
+```
+
+and follow these steps in the top directory:
+
+```bash
+mkdir build
+cd build
+cmake ..
+make
+sudo make install
+```
+
+The CLI command line program can be accessed by typing
+
+```bash
+zint [options]
+```
+
+The GUI can be accessed by typing
+
+```bash
+zint-qt
+```
+
+To test that the installation has been successful a shell script is included in
+the `"frontend"` sub-directory. To run the test type
+
+```bash
+./test.sh
+```
+
+This should create numerous files in the sub-directory `"frontend/test_sh_out"`
+showing the many modes of operation which are available from Zint.
+
+## 2.2 Microsoft Windows
+
+For Microsoft Windows, Zint is distributed as a binary executable. Simply
+download the ZIP file, then right-click on the ZIP file and `"Extract All"`. A
+new folder will be created within which are two binary files:
+
+* `qtZint.exe` - Zint Barcode Studio
+* `zint.exe` - Command Line Interface
+
+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.
+
+To build Zint on Windows from source, see `"win32/README"`.
+
+## 2.3 Apple macOS
+
+Zint can be installed using Homebrew. To install Homebrew input the following
+line into the macOS terminal
+
+```bash
+/usr/bin/ruby -e "$(curl -fsSL
+ https://raw.githubusercontent.com/Homebrew/install/master/install)"
+```
+
+Once Homebrew is installed use the following command to install Zint.
+
+```bash
+brew install zint
+```
+
+## 2.4 Zint Tcl Backend
+
+The Tcl backend in the `"backend_tcl"` sub-directory may be built using the
+provided TEA (Tcl Extension Architecture) build on Linux, Windows, macOS and
+Android. For Windows, an MSVC6 makefile is also available.
+
+
+# 3. Using Zint Barcode Studio
+
+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
+
+```bash
+zint-qt
+```
+
+or on Windows
+
+```bash
+qtZint.exe
+```
+
+See the note in section [2.2 Microsoft Windows] about Microsoft Defender
+SmartScreen.
+
+Below is a brief guide to Zint Barcode Studio.
+
+## 3.1 Main Window and Data Tab
+
+![Zint Barcode Studio on startup - main window with Data
+tab](images/gui_main.png)
+
+This is the main window of Zint Barcode Studio. The top of the window shows a
+preview of the barcode which the current settings would create. These settings
+can be changed using the controls below. The text box in the `"Data to Encode"`
+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 `"Save As"` button to save the
+resulting image to a file.
+
+The `"Symbology"` 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 `"mail"` will
+only show barcodes in the drop-down whose names contain the word `"mail"`. Each
+word entered will match. So typing `"mail post"` will show barcodes whose names
+contain `"mail"` or `"post"` (or both).
+
+The `"BMP"` and `"SVG"` 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 `"Menu"` button, along with
+`"CLI Equivalent"`, `"Save As"`, `"Help"`, `"About"` and `"Quit"` options. Most
+of the options are also available in a context menu by right-clicking the
+preview.
+
+![Zint Barcode Studio main menu (left) and context menu
+(right)](images/gui_menus.png)
+
+## 3.2 Composite Groupbox
+
+![Zint Barcode Studio encoding GS1 composite data](images/gui_composite.png)
+
+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
+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 [6.3 Composite Symbols (ISO 24723)].
+
+## 3.3 Additional ECI/Data Segments Groupbox
+
+![Zint Barcode Studio encoding multiple segments](images/gui_segs.png)
+
+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 `"Data to Encode"` as segment 0) may
+be specified. See [4.15 Multiple Segments] for details.
+
+## 3.4 Symbology-specific Tab
+
+![Zint Barcode Studio showing Aztec Code options](images/gui_aztec.png)
+
+For a number of symbologies extra options are available to fine-tune the format,
+appearance and content of the symbol generated. These are given in a second tab.
+
+Here the method is shown for adjusting the size or error correction level of an
+Aztec Code symbol, selecting how its data is to be treated, and setting it as
+part of a Structured Append sequence of symbols.
+
+## 3.5 Appearance Tab
+
+![Zint Barcode Studio showing Appearance tab options](images/gui_appearance.png)
+
+The Appearance tab can be used to adjust the dimensions and other properties of
+the symbol. The `"Height"` value affects the height of symbologies which do not
+have a fixed width-to-height ratio, i.e. those other than matrix symbologies.
+Boundary bars (`"Border Type"`) can be added and adjusted and the size of the
+saved image (`"Printing Scale"`) can be determined.
+
+## 3.6 Colour Dialog
+
+![The colour picker tool](images/gui_colour.png)
+
+A colour dialog is used to adjust the colour of the foreground and background of
+the generated image. In the Appearance tab click on the `"Foreground"` or
+`"Background"` button respectively. The colours can be reset to black-on-white
+using the `"Reset"` button.
+
+## 3.7 Data Dialog
+
+![Entering longer text input](images/gui_data_dialog.png)
+
+Clicking on the ellipsis `"..."` button next to the `"Data to Encode"` 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.
+
+The dialog is also available for additional ECI/Data segments by clicking the
+ellipsis button to the right of their data text boxes.
+
+Note that if your data contains line feeds (`LF`) 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 `'\n'` and the
+`"Parse Escapes"` checkbox will be set. This only affects line feeds, not
+carriage returns (`CR`) or `CR+LF` pairs, and behaves the same on both
+Windows and Unix. (For details on escape sequences, see [4.1 Inputting Data].)
+
+## 3.8 Sequence Dialog
+
+![Creating a sequence of barcode symbols](images/gui_sequence.png)
+
+Clicking on the sequence button (labelled `"1234.."`) 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:
+
+| Character | Effect |
+|:-------------------|:------------------------|
+|`#` | Insert leading spaces |
+|`$` | Insert leading zeroes |
+|`*` | Insert leading asterisks|
+|Any other character | Interpreted literally |
+
+Table: {#tbl:sequence_format_characters tag=": Sequence Format Characters"}
+
+## 3.9 Export Dialog
+
+![Setting filenames for an exported sequence of barcode
+symbols](images/gui_export.png)
+
+The Export Dialog invoked by pressing the `"Export"` button in the Sequence
+Dialog sets the parameters for exporting a sequence of barcode images. Here you
+can set the filename and the output image format. Note that the symbology,
+colour and other formatting information are taken from the main window.
+
+## 3.10 CLI Equivalent Dialog
+
+![CLI Equivalent Dialog](images/gui_cli_equivalent.png)
+
+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 `"Copy"` button to copy the command to the
+clipboard, which can then be pasted into the command line.
+
+
+# 4. Using the Command Line
+
+This section describes how to encode data using the command line frontend
+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 `".EXE"` is not in your `PATHEXT` environment variable, i.e.:
+
+```bash
+zint.exe -d "This Text"
+```
+
+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:
+
+```bash
+zint -d 'Text containing a single quote '\'' in the middle'
+```
+
+Some examples use backslash (`\`) to continue commands onto the next line. For
+Windows, use caret (`^`) instead.
+
+Certain options that take values have short names as well as long ones, namely
+`-b` (`--barcode`), `-d` (`--data`), `-i` (`--input`), `-o` (`--output`) and
+`-w` (`--whitesp`). 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:
+
+```bash
+zint -d "This Text"
+zint --data="This Text"
+zint --data "This Text"
+```
+
+The examples use a space separator for short option names, and an equals sign
+for long option names.
+
+## 4.1 Inputting Data
+
+The data to encode can be entered at the command line using the `-d` or `--data`
+option, for example
+
+```bash
+zint -d "This Text"
+```
+
+This will encode the text `"This Text"`. Zint will use the default symbology,
+Code 128, and output to the default file `"out.png"` in the current directory.
+Alternatively, if `libpng` was not present when Zint was built, the default
+output file will be `"out.gif"`.
+
+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 [4.10 Input Modes]
+below.
+
+Non-printing characters can be entered on the command line using backslash (`\`)
+as an escape character in combination with the `--esc` switch. Permissible
+sequences are shown in the table below.
+
+-------------------------------------------------------------------------
+Escape ASCII Name Interpretation
+Sequence Equivalent
+-------- ---------- ----- -------------------------------------------
+`\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
+
+`\xNN` 0xNN Any 8-bit character where NN is hexadecimal
+
+`\uNNNN` Any 16-bit Unicode BMP[^1] character where
+ NNNN is hexadecimal
+-------------------------------------------------------------------------
+
+Table: {#tbl:escape_sequences tag=": Escape Sequences"}
+
+[^1]: 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!
+
+Input data can be read directly from file using the `-i` or `--input` switch as
+shown below. The input file is assumed to be UTF-8 formatted unless an
+alternative mode is selected. This command replaces the use of the `-d` switch.
+
+```bash
+zint -i somefile.txt
+```
+
+Note that except when batch processing (see [4.11 Batch Processing] below), the
+file should not end with a newline (`LF` on Unix, `CR+LF` on Windows) unless you
+want the newline to be encoded in the symbol.
+
+## 4.2 Directing Output
+
+Output can be directed to a file other than the default using the `-o` or
+`--output` switch. For example:
+
+```bash
+zint -o here.png -d "This Text"
+```
+
+This draws a Code 128 barcode in the file `"here.png"`. If an Encapsulated
+PostScript file is needed simply append the filename with `".eps"`, and so on
+for the other supported file types:
+
+```bash
+zint -o there.eps -d "This Text"
+```
+
+## 4.3 Selecting Barcode Type
+
+Selecting which type of barcode you wish to produce (i.e. which symbology to
+use) can be done at the command line using the `-b` or `--barcode` switch
+followed by the appropriate integer value or name in the following table. For
+example to create a Data Matrix symbol you could use:
+
+```bash
+zint -b 71 -o datamatrix.png -d "Data to encode"
+```
+
+or
+
+```bash
+zint -b DATAMATRIX -o datamatrix.png -d "Data to encode"
+```
+
+Names are treated case-insensitively by the CLI, and the `BARCODE_` prefix and
+any underscores are optional.
+
+--------------------------------------------------------------------------------
+Numeric Name[^2] Barcode Name
+Value
+------- ------------------------ ---------------------------------------------
+ 1 `BARCODE_CODE11` Code 11
+
+ 2`*` `BARCODE_C25STANDARD` Standard Code 2 of 5
+
+ 3 `BARCODE_C25INTER` Interleaved 2 of 5
+
+ 4 `BARCODE_C25IATA` Code 2 of 5 IATA
+
+ 6 `BARCODE_C25LOGIC` Code 2 of 5 Data Logic
+
+ 7 `BARCODE_C25IND` Code 2 of 5 Industrial
+
+ 8 `BARCODE_CODE39` Code 3 of 9 (Code 39)
+
+ 9 `BARCODE_EXCODE39` Extended Code 3 of 9 (Code 39+)
+
+ 13 `BARCODE_EANX` EAN (including EAN-8 and EAN-13)
+
+ 14 `BARCODE_EANX_CHK` EAN + Check Digit
+
+ 16`*` `BARCODE_GS1_128` GS1-128 (UCC.EAN-128)
+
+ 18 `BARCODE_CODABAR` Codabar
+
+ 20 `BARCODE_CODE128` Code 128 (automatic subset switching)
+
+ 21 `BARCODE_DPLEIT` Deutshe Post Leitcode
+
+ 22 `BARCODE_DPIDENT` Deutshe Post Identcode
+
+ 23 `BARCODE_CODE16K` Code 16K
+
+ 24 `BARCODE_CODE49` Code 49
+
+ 25 `BARCODE_CODE93` Code 93
+
+ 28 `BARCODE_FLAT` Flattermarken
+
+ 29`*` `BARCODE_DBAR_OMN` GS1 DataBar Omnidirectional (including GS1
+ DataBar Truncated)
+
+ 30`*` `BARCODE_DBAR_LTD` GS1 DataBar Limited
+
+ 31`*` `BARCODE_DBAR_EXP` GS1 DataBar Expanded
+
+ 32 `BARCODE_TELEPEN` Telepen Alpha
+
+ 34 `BARCODE_UPCA` UPC-A
+
+ 35 `BARCODE_UPCA_CHK` UPC-A + Check Digit
+
+ 37 `BARCODE_UPCE` UPC-E
+
+ 38 `BARCODE_UPCE_CHK` UPC-E + Check Digit
+
+ 40 `BARCODE_POSTNET` POSTNET
+
+ 47 `BARCODE_MSI_PLESSEY` MSI Plessey
+
+ 49 `BARCODE_FIM` FIM
+
+ 50 `BARCODE_LOGMARS` LOGMARS
+
+ 51 `BARCODE_PHARMA` Pharmacode One-Track
+
+ 52 `BARCODE_PZN` PZN
+
+ 53 `BARCODE_PHARMA_TWO` Pharmacode Two-Track
+
+ 55 `BARCODE_PDF417` PDF417
+
+ 56`*` `BARCODE_PDF417COMP` Compact PDF417 (Truncated PDF417)
+
+ 57 `BARCODE_MAXICODE` MaxiCode
+
+ 58 `BARCODE_QRCODE` QR Code
+
+ 60 `BARCODE_CODE128B` Code 128 (Subset B)
+
+ 63 `BARCODE_AUSPOST` Australia Post Standard Customer
+
+ 66 `BARCODE_AUSREPLY` Australia Post Reply Paid
+
+ 67 `BARCODE_AUSROUTE` Australia Post Routing
+
+ 68 `BARCODE_AUSDIRECT` Australia Post Redirection
+
+ 69 `BARCODE_ISBNX` ISBN (EAN-13 with verification stage)
+
+ 70 `BARCODE_RM4SCC` Royal Mail 4-State (RM4SCC)
+
+ 71 `BARCODE_DATAMATRIX` Data Matrix (ECC200)
+
+ 72 `BARCODE_EAN14` EAN-14
+
+ 73 `BARCODE_VIN` Vehicle Identification Number
+
+ 74 `BARCODE_CODABLOCKF` Codablock-F
+
+ 75 `BARCODE_NVE18` NVE-18 (SSCC-18)
+
+ 76 `BARCODE_JAPANPOST` Japanese Postal Code
+
+ 77 `BARCODE_KOREAPOST` Korea Post
+
+ 79`*` `BARCODE_DBAR_STK` GS1 DataBar Stacked
+
+ 80`*` `BARCODE_DBAR_OMNSTK` GS1 DataBar Stacked Omnidirectional
+
+ 81`*` `BARCODE_DBAR_EXPSTK` GS1 DataBar Expanded Stacked
+
+ 82 `BARCODE_PLANET` PLANET
+
+ 84 `BARCODE_MICROPDF417` MicroPDF417
+
+ 85`*` `BARCODE_USPS_IMAIL` USPS Intelligent Mail (OneCode)
+
+ 86 `BARCODE_PLESSEY` UK Plessey
+
+ 87 `BARCODE_TELEPEN_NUM` Telepen Numeric
+
+ 89 `BARCODE_ITF14` ITF-14
+
+ 90 `BARCODE_KIX` Dutch Post KIX Code
+
+ 92 `BARCODE_AZTEC` Aztec Code
+
+ 93 `BARCODE_DAFT` DAFT Code
+
+ 96 `BARCODE_DPD` DPD Code
+
+ 97 `BARCODE_MICROQR` Micro QR Code
+
+ 98 `BARCODE_HIBC_128` HIBC Code 128
+
+ 99 `BARCODE_HIBC_39` HIBC Code 39
+
+ 102 `BARCODE_HIBC_DM` HIBC Data Matrix ECC200
+
+ 104 `BARCODE_HIBC_QR` HIBC QR Code
+
+ 106 `BARCODE_HIBC_PDF` HIBC PDF417
+
+ 108 `BARCODE_HIBC_MICPDF` HIBC MicroPDF417
+
+ 110 `BARCODE_HIBC_BLOCKF` HIBC Codablock-F
+
+ 112 `BARCODE_HIBC_AZTEC` HIBC Aztec Code
+
+ 115 `BARCODE_DOTCODE` DotCode
+
+ 116 `BARCODE_HANXIN` Han Xin (Chinese Sensible) Code
+
+ 121 `BARCODE_MAILMARK` Royal Mail 4-state Mailmark
+
+ 128 `BARCODE_AZRUNE` Aztec Runes
+
+ 129 `BARCODE_CODE32` Code 32
+
+ 130 `BARCODE_EANX_CC` Composite Symbol with EAN linear component
+
+ 131`*` `BARCODE_GS1_128_CC` Composite Symbol with GS1-128 linear
+ component
+
+ 132`*` `BARCODE_DBAR_OMN_CC` Composite Symbol with GS1 DataBar
+ Omnidirectional linear component
+
+ 133`*` `BARCODE_DBAR_LTD_CC` Composite Symbol with GS1 DataBar Limited
+ linear component
+
+ 134`*` `BARCODE_DBAR_EXP_CC` Composite Symbol with GS1 DataBar Expanded
+ linear component
+
+ 135 `BARCODE_UPCA_CC` Composite Symbol with UPC-A linear component
+
+ 136 `BARCODE_UPCE_CC` Composite Symbol with UPC-E linear component
+
+ 137`*` `BARCODE_DBAR_STK_CC` Composite Symbol with GS1 DataBar Stacked
+ component
+
+ 138`*` `BARCODE_DBAR_OMNSTK_CC` Composite Symbol with GS1 DataBar Stacked
+ Omnidirectional component
+
+ 139`*` `BARCODE_DBAR_EXPSTK_CC` Composite Symbol with GS1 DataBar Expanded
+ Stacked component
+
+ 140 `BARCODE_CHANNEL` Channel Code
+
+ 141 `BARCODE_CODEONE` Code One
+
+ 142 `BARCODE_GRIDMATRIX` Grid Matrix
+
+ 143 `BARCODE_UPNQR` UPNQR (Univerzalnega Plačilnega Naloga QR)
+
+ 144 `BARCODE_ULTRA` Ultracode
+
+ 145 `BARCODE_RMQR` Rectangular Micro QR Code (rMQR)
+--------------------------------------------------------------------------------
+
+Table: {#tbl:barcode_types tag=": Barcode Types (Symbologies)"}
+
+[^2]: The symbologies marked with an asterisk (`*`) in the above table used
+different names in Zint before version 2.9.0. For example, symbology 29 used the
+name `BARCODE_RSS14`. These names are now deprecated but are still recognised by
+Zint and will continue to be supported in future versions.
+
+## 4.4 Adjusting Height
+
+The height of a symbol (except those with a fixed width-to-height ratio) can be
+adjusted using the `--height` switch. For example:
+
+```bash
+zint --height=100 -d "This Text"
+```
+
+This specifies a symbol height of 100 times the X-dimension of the symbol.
+
+The default height of most linear barcodes is 50X, but this can be changed for
+barcodes whose specifications give a standard height by using the switch
+`--compliantheight`. For instance
+
+```bash
+zint -b LOGMARS -d "This Text" --compliantheight
+```
+
+will produce a barcode of height 45.455X instead of the normal default of 50X.
+The flag also causes Zint to return a warning if a non-compliant height is
+given:
+
+```bash
+zint -b LOGMARS -d "This Text" --compliantheight --height=6.2
+Warning 247: Height not compliant with standards
+```
+
+Another switch is `--heightperrow`, 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
+
+```bash
+zint -b PDF417 -d "This Text" --height=4 --heightperrow
+```
+
+![`zint -b PDF417 -d "This Text" --height=4
+--heightperrow`](images/pdf417_heightperrow.svg)
+
+will produce a barcode of height 32X, with each of the 8 rows 4X high.
+
+## 4.5 Adjusting Whitespace
+
+The amount of horizontal whitespace to the left and right of the generated
+barcode can be altered using the `-w` or `--whitesp` switch. For example:
+
+```bash
+zint -w 10 -d "This Text"
+```
+
+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.
+
+The amount of vertical whitespace above and below the barcode can be altered
+using the `--vwhitesp` switch. For example for 3 times the X-dimension:
+
+```bash
+zint --vwhitesp=3 -d "This Text"
+```
+
+Note that the whitespace at the bottom appears below the text, if any.
+
+Horizontal and vertical whitespace can of course be used together:
+
+```bash
+zint -b DATAMATRIX --whitesp=1 --vwhitesp=1 -d "This Text"
+```
+
+A `--quietzones` option is also available which adds quiet zones compliant with
+the symbology's specification. This is in addition to any whitespace specified
+with the `--whitesp` or `--vwhitesp` switches.
+
+Note that Codablock-F, Code 16K, Code 49, ITF-14, EAN-13, EAN-8, EAN-5, EAN-2,
+ISBN, UPC-A and UPC-E have compliant quiet zones added by default. This can be
+disabled with the option `--noquietzones`.
+
+## 4.6 Adding Boundary Bars and Boxes
+
+Zint allows the symbol to be bound with 'boundary bars' (also known as 'bearer
+bars') using the option `--bind`. 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 `--box` option.
+
+The width of the boundary or box must be specified using the `--border` switch.
+For example:
+
+```bash
+zint --box --border=10 -w 10 -d "This Text"
+```
+
+![`zint --border=10 --box -d "This Text" -w 10`](images/code128_box.svg)
+
+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.
+
+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.
+
+![`zint -b QRCODE --border=1 --box -d "This Text"
+--quietzones`](images/qrcode_box.svg)
+
+Codablock-F, Code 16K and Code 49 always have boundary bars, and default to
+particular horizontal whitespace values. Special considerations apply to ITF-14
+- see [6.1.2.6 ITF-14] for that symbology.
+
+## 4.7 Using Colour
+
+The default colours of a symbol are a black symbol on a white background. Zint
+allows you to change this. The `-r` or `--reverse` switch allows the default
+colours to be inverted so that a white symbol is shown on a black background
+(known as reflectance reversal). For example the command
+
+```bash
+zint -r -d "This Text"
+```
+
+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, Han Xin Code, Grid
+Matrix and QR Code symbology specifications.
+
+For more specific needs the foreground (ink) and background (paper) colours can
+be specified using the `--fg` and `--bg` options followed by a number in RRGGBB
+hexadecimal notation (the same system used in HTML). For example the command
+
+```bash
+zint --fg=00FF00 -d "This Text"
+```
+
+alters the symbol to a bright green.
+
+![`zint -d "This Text" --fg=00FF00`](images/code128_green.svg)
+
+Zint also supports RGBA colour information for some output file formats which
+support alpha channels (currently only PNG, SVG and TIF) in a RRGGBBAA format.
+For example:
+
+```bash
+zint --fg=00ff0055 -d "This Text"
+```
+
+![`zint -d "This Text" --fg=00FF0055`](images/code128_green_alpha.svg)
+
+will produce a semi-transparent green foreground with standard (white)
+background. Note that transparency is handled differently for raster and
+vector files so that...
+
+```bash
+zint --bg=ff0000 --fg=ffffff00 ...
+```
+
+will give different results for PNG and SVG. Experimentation is advised!
+
+In addition the `--nobackground` option will simply remove the background from
+EMF, EPS, GIF, PNG, SVG and TIF files.
+
+## 4.8 Rotating the Symbol
+
+The symbol can be rotated through four orientations using the `--rotate` option
+followed by the angle of rotation as shown below.
+
+```
+--rotate=0 (default)
+--rotate=90
+--rotate=180
+--rotate=270
+```
+
+![`zint -d "This Text" --rotate=90`](images/code128_rotate90.svg)
+
+## 4.9 Adjusting Image Size
+
+The scale of the image can be altered using the `--scale` option followed by a
+multiple of the default X-dimension. The scale is multiplied by 2 before being
+applied. The default scale is 1.
+
+For raster output, the default X-dimension is 2 pixels (except for MaxiCode, see
+[4.9.2 MaxiCode Raster Scaling] below). For example for PNG images a scale of 5
+will increase the X-dimension to 10 pixels. Scales for 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.
+
+The minimum scale for non-dotty raster output is 0.5, giving a minimum
+X-dimension of 1 pixel, and text will not be printed for scales less than 1.
+The minimum scale for raster output in dotty mode is 1 (see [4.14 Working with
+Dots]).
+
+The minimum scale for vector output is 0.1, giving a minimum X-dimension of 0.2.
+
+The maximum scale for both raster and vector is 100.
+
+### 4.9.1 Scaling Example
+
+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 dots per mm (dpmm), the equivalent of 300 dots
+per inch (`dpi = dpmm * 25.4`), specify a scale of 2, since `0.33 * 12 = 3.96`
+pixels, or 4 pixels rounding to the nearest pixel:
+
+```bash
+zint -b EANX -d "501234567890" --compliantheight --scale=2
+```
+
+This will result in output of 38.27mm x 26.08mm (WxH) at 300 dpi. The following
+table shows the scale to use (in 0.5 increments) depending on the dpmm desired,
+for a target X-dimension of 0.33mm:
+
+dpmm dpi scale
+---- ---- -----
+ 6 150 1
+ 8 200 1.5
+ 12 300 2
+ 16 400 3
+ 24 600 4
+ 47 1200 8
+ 95 2400 15.5
+189 4800 31
+
+Table: {#tbl:scaling_xdim_0_33mm tag=": Scaling for X-dimension 0.33mm"}
+
+### 4.9.2 MaxiCode Raster Scaling
+
+For MaxiCode symbols, which use hexagons, the scale for raster output is
+multiplied by 10 before being applied. The minimum scale is 0.2, so the minimum
+X-dimension is 2 pixels.
+
+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 following table shows
+the scale to use depending on the dpmm desired, with dpi equivalents:
+
+dpmm dpi scale
+---- ---- -----
+ 6 150 0.5
+ 8 200 0.7
+ 12 300 1
+ 16 400 1.4
+ 24 600 2.1
+ 47 1200 4.1
+ 95 2400 8.2
+189 4800 16.4
+
+Table: {#tbl:maxicode_raster_scaling tag=": MaxiCode Raster Scaling"}
+
+Note that the 0.5 increment recommended for normal raster output does not apply.
+Scales below 0.5 are not recommended and may produce symbols that are not within
+the minimum/maximum size ranges.
+
+## 4.10 Input Modes
+
+### 4.10.1 Unicode, Data, and GS1 Modes
+
+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.
+
+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).
+
+Symbology Default character sets Alternate if input not Latin-1
+------------- ------------------------ ------------------------------
+Aztec Code Latin-1 None
+Codablock-F Latin-1 None
+Code 128 Latin-1 None
+Code 16k Latin-1 None
+Code One Latin-1 None
+Data Matrix Latin-1 None
+DotCode Latin-1 None
+Grid Matrix GB 2312 (includes ASCII) N/A
+Han Xin Latin-1 GB 18030 (includes ASCII)
+MaxiCode Latin-1 None
+MicroPDF417 Latin-1 None
+Micro QR Code Latin-1 Shift JIS (includes ASCII[^3])
+PDF417 Latin-1 None
+QR Code Latin-1 Shift JIS (see above)
+rMQR Latin-1 Shift JIS (see above)
+Ultracode Latin-1 None
+UPNQR Latin-2 N/A
+All others ASCII N/A
+
+Table: {#tbl:default_character_sets tag=": Default Character Sets"}
+
+[^3]: Shift JIS (JIS X 0201 Roman) re-maps two ASCII characters: backslash (`\`)
+to the yen sign (¥), and tilde (`~`) to overline (U+203E).
+
+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
+[4.10.2 Input Modes and ECI] below.
+
+GS1 data can be encoded in a number of symbologies. Application Identifiers
+(AIs) should be enclosed in `[square brackets]` followed by the data to be
+encoded (see [6.1.10.3 GS1-128]). To encode GS1 data use the `--gs1` option.
+GS1 mode is assumed (and doesn't need to be set) for GS1-128, EAN-14, GS1
+DataBar and Composite symbologies but is also available for Aztec Code, Code
+16K, Code 49, Code One, Data Matrix, DotCode, QR Code and Ultracode.
+
+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 `'+'` and the check character are
+automatically added, conforming to HIBC Labeler Identification Code (HIBC LIC).
+For HIBC Provider Applications Standard (HIBC PAS), preface the data with a
+slash `'/'`.
+
+The `--binary` 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.
+
+The `--fullmultibyte` 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.
+
+### 4.10.2 Input Modes and ECI
+
+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
+{@tbl:eci_codes} below. The ECI information is added to your code symbol as
+prefix data. The symbologies that support ECI are
+
+------------ ------------ ------------ ------------
+Aztec Code DotCode MaxiCode QR Code
+Code One Grid Matrix MicroPDF417 rMQR
+Data Matrix Han Xin Code PDF417 Ultracode
+------------ ------------ ------------ ------------
+
+Table: {#tbl:eci_aware_symbologies tag=": ECI-Aware Symbologies"}
+
+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.
+
+The ECI value may be specified with the `--eci` switch, followed by the value in
+the column `"ECI Code"`. The input data should be UTF-8 formatted. Zint
+automatically translates the data into the target encoding.
+
+ECI Code Character Encoding Scheme (ISO/IEC 8859 schemes include ASCII)
+-------- --------------------------------------------------------------
+3 ISO/IEC 8859-1 - Latin alphabet No. 1
+4 ISO/IEC 8859-2 - Latin alphabet No. 2
+5 ISO/IEC 8859-3 - Latin alphabet No. 3
+6 ISO/IEC 8859-4 - Latin alphabet No. 4
+7 ISO/IEC 8859-5 - Latin/Cyrillic alphabet
+8 ISO/IEC 8859-6 - Latin/Arabic alphabet
+9 ISO/IEC 8859-7 - Latin/Greek alphabet
+10 ISO/IEC 8859-8 - Latin/Hebrew alphabet
+11 ISO/IEC 8859-9 - Latin alphabet No. 5 (Turkish)
+12 ISO/IEC 8859-10 - Latin alphabet No. 6 (Nordic)
+13 ISO/IEC 8859-11 - Latin/Thai alphabet
+15 ISO/IEC 8859-13 - Latin alphabet No. 7 (Baltic)
+16 ISO/IEC 8859-14 - Latin alphabet No. 8 (Celtic)
+17 ISO/IEC 8859-15 - Latin alphabet No. 9
+18 ISO/IEC 8859-16 - Latin alphabet No. 10
+20 Shift JIS (JIS X 0208 and JIS X 0201)
+21 Windows 1250 - Latin 2 (Central Europe)
+22 Windows 1251 - Cyrillic
+23 Windows 1252 - Latin 1
+24 Windows 1256 - Arabic
+25 UTF-16BE (High order byte first)
+26 UTF-8
+27 ASCII (ISO/IEC 646 IRV)
+28 Big5 (Taiwan) Chinese Character Set
+29 GB 2312 (PRC) Chinese Character Set
+30 Korean Character Set EUC-KR (KS X 1001:2002)
+31 GBK Chinese Character Set
+32 GB 18030 Chinese Character Set
+33 UTF-16LE (Low order byte first)
+34 UTF-32BE (High order bytes first)
+35 UTF-32LE (Low order bytes first)
+170 ISO/IEC 646 Invariant[^4]
+899 8-bit binary data
+
+Table: {#tbl:eci_codes tag=": ECI Codes"}
+
+[^4]: ISO/IEC 646 Invariant is a subset of ASCII with 12 characters undefined:
+`#`, `$`, `@`, `[`, `\`, `]`, `^`, `` ` ``, `{`, `|`, `}`, `~`.
+
+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 @tbl:default_character_sets above).
+
+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 `--binary` option is given.
+
+Multiple ECIs can be specified using the `--segN` options - see [4.15 Multiple
+Segments].
+
+Note: the `--eci=3` 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.
+
+#### 4.10.2.1 Input Modes and ECI Example 1
+
+The Euro sign U+20AC can be encoded in ISO/IEC 8859-15. The Euro sign has the
+ISO/IEC 8859-15 codepoint hex `"A4"`. It is encoded in UTF-8 as the hex
+sequence: `"E2 82 AC"`. Those 3 bytes are contained in the file
+`"utf8euro.txt"`. This command will generate the corresponding code:
+
+```bash
+zint -b 71 --scale=10 --eci=17 -i utf8euro.txt
+```
+
+This is equivalent to the commands (using the `--esc` switch):
+
+```bash
+zint -b 71 --scale=10 --eci=17 --esc -d "\xE2\x82\xAC"
+
+zint -b 71 --scale=10 --eci=17 --esc -d "\u20AC"
+```
+
+and to the command:
+
+```bash
+zint -b 71 --scale=10 --eci=17 -d "€"
+```
+
+![`zint -b DATAMATRIX --eci=17 -d "€"`](images/datamatrix_euro.svg)
+
+#### 4.10.2.2 Input Modes and ECI Example 2
+
+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:
+`"B1 60"` (contained in the file `"big5char.txt"`). The generation command for
+Data Matrix is:
+
+```bash
+zint -b 71 --scale=10 --eci=28 --binary -i big5char.txt
+```
+
+This is equivalent to the command (using the `--esc` switch):
+
+```bash
+zint -b 71 --scale=10 --eci=28 --binary --esc -d "\xB1\x60"
+```
+
+and to the commands (no `--binary` switch so conversion occurs):
+
+```bash
+zint -b 71 --scale=10 --eci=28 --esc -d "\xE5\xB8\xB8"
+
+zint -b 71 --scale=10 --eci=28 --esc -d "\u5E38"
+
+zint -b 71 --scale=10 --eci=28 -d "常"
+```
+
+![`zint -b DATAMATRIX --eci=28 -d "\u5E38" --esc`](images/datamatrix_big5.svg)
+
+#### 4.10.2.3 Input Modes and ECI Example 3
+
+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
+`--binary` switch so that the data will be encoded as UTF-8 without conversion:
+
+```bash
+zint -b 58 --binary -d "UTF-8 data"
+```
+
+![`zint -b QRCODE --binary -d "\xE2\x82\xAC\xE5\xB8\xB8"
+--esc`](images/qrcode_binary_utf8.svg)
+
+## 4.11 Batch Processing
+
+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
+`--batch` switch. To select the input file from which to read data use the `-i`
+option. 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. 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.
+
+By default Zint will output numbered filenames starting with `00001.png`,
+`00002.png` etc. To change this behaviour use the `-o` option in combination
+with `--batch` using special characters in the output filename as shown in the
+table below:
+
+Input Character Interpretation
+--------------- ------------------------
+`~` Insert a number or 0
+`#` Insert a number or space
+`@` Insert a number or `*`
+Any other Insert literally
+
+Table: {#tbl:batch_filename_formatting tag=": Batch Filename Formatting"}
+
+The following table shows some examples to clarify this method:
+
+Input Filenames Generated
+----------------- ------------------------------------------------
+`-o file~~~.svg` `file001.svg`, `file002.svg`, `file003.svg`
+`-o @@@@bar.png` `***1.png`, `***2.png`, `***3.png`
+`-o my~~~bar.eps` `my001.bar.eps`, `my002.bar.eps`, `my003bar.eps`
+`-o t@es~t~.png` `t*es0t1.png`, `t*es0t2.png`, `t*es0t3.png`
+
+Table: {#tbl:batch_filename_examples tag=": Batch Filename Examples"}
+
+## 4.12 Direct Output
+
+The finished image files can be output directly to stdout for use as part of a
+pipe by using the `--direct` option. By default `--direct` will output data as a
+PNG image (or GIF image if `libpng` is not present), but this can be altered by
+supplementing the `--direct` option with a `--filetype` option followed by the
+suffix of the file type required. For example:
+
+```bash
+zint -b 84 --direct --filetype=pcx -d "Data to encode"
+```
+
+This command will output the symbol as a PCX file to stdout. The currently
+supported output file formats are shown in the following table:
+
+Abbreviation File format
+------------ ---------------------------
+BMP Windows Bitmap
+EMF Enhanced Metafile Format
+EPS Encapsulated PostScript
+GIF Graphics Interchange Format
+PCX ZSoft Paintbrush image
+PNG Portable Network Graphic
+SVG Scalable Vector Graphic
+TIF Tagged Image File Format
+TXT Text file (see [4.18 Other Output Options])
+
+Table: {#tbl:output_file_formats tag=": Output File Formats"}
+
+* * *
+CAUTION: Outputting binary files to the command shell without catching that
+data in a pipe can have unpredictable results. Use with care!
+
+* * *
+
+## 4.13 Automatic Filenames
+
+The `--mirror` 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 `"1234567"` will result in
+a file named `"1234567.png"`.
+
+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.
+
+To set the output file format use the `--filetype` option as detailed above in
+[4.12 Direct Output].
+
+## 4.14 Working with Dots
+
+Matrix codes can be rendered as a series of dots or circles rather than the
+normal squares by using the `--dotty` 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 `--dotsize` option followed by the diameter
+of the dot, where that diameter is given as a multiple of the X-dimension. The
+minimum dot size is 0.01, the maximum is 20. The default size is 0.8.
+
+The default and minimum scale for raster output in dotty mode is 1.
+
+![`zint -b CODEONE -d "123456789012345678" --dotty
+--vers=9`](images/codeone_s_dotty.svg)
+
+## 4.15 Multiple Segments
+
+If you need to specify different ECIs for different sections of the input data,
+the `--seg1` to `--seg9` options can be used. Each option is of the form
+`--segN=ECI,data` where `ECI` is the ECI code (see Table {@tbl:eci_codes}) and
+`data` is the data to which this applies. This is in addition to the ECI and
+data specified using the `--eci` and `-d` options which must still be present
+and which in effect constitute segment 0. For instance
+
+```bash
+zint -b AZTEC_CODE --eci=9 -d "Κείμενο" --seg1=7,"Текст" --seg2=20,"文章"
+```
+
+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.
+
+The symbology must be ECI-aware (see Table {@tbl:eci_aware_symbologies}).
+
+![`zint -b AZTEC --eci=9 -d "Κείμενο" --seg1=7,"Текст"
+--seg2=20,"文章"`](images/aztec_segs.svg)
+
+ECIs of zero may be given, in which case Zint will automatically determine an
+ECI if necessary, as described in section [4.10.2 Input Modes and ECI].
+
+Multiple segments are not currently supported for use with GS1 data.
+
+## 4.16 Structured Append
+
+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.
+
+The `--structapp` option marks a symbol as part of a Structured Append sequence,
+and has the format
+
+```
+--structapp=I,C[,ID]
+```
+
+![`zint -b DATAMATRIX -d "2nd of 3"
+--structapp="2,3,5006"`](images/datamatrix_structapp.svg)
+
+where `I` is the index (position) of the symbol in the Structured Append
+sequence, `C` is the count or total number of symbols in the sequence, and `ID`
+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.
+
+## 4.17 Help Options
+
+There are three help options which give information about how to use the
+command line. The `-h` or `--help` 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 `-v` or `--version`).
+
+The `-t` or `--types` option gives the table of symbologies along with the
+symbol ID numbers and names.
+
+The `-e` or `--ecinos` option gives a list of the ECI codes.
+
+## 4.18 Other Output Options
+
+For linear barcodes the text present in the output image can be removed by
+using the `--notext` option.
+
+The text can be set to bold using the `--bold` option, or a smaller font
+can be substituted using the `--small` option. The `--bold` and `--small`
+options can be used together if required, but only for vector output.
+
+![`zint --bold -d "This Text" --small`](images/code128_small_bold.svg)
+
+Zint can output a representation of the symbol data as a set of hexadecimal
+values if asked to output to a text file (`"*.txt"`) or if given the option
+`--filetype=txt`. This can be used for test and diagnostic purposes.
+
+The `--cmyk` option is specific to output in Encapsulated PostScript and TIF,
+and converts the RGB colours used to the CMYK colour space. Setting custom
+colours at the command line will still need to be done in RRGGBB format.
+
+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 [6. Types of
+Symbology] of this guide.
+
+
+# 5. Using the API
+
+Zint has been written using the C language and has an API for use with C/C++
+language programs. A Qt interface is available in the `"backend_qt"`
+sub-directory, and a Tcl interface is available in the `"backend_tcl"`
+sub-directory.
+
+The `libzint` 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.
+
+## 5.1 Creating and Deleting Symbols
+
+The symbols manipulated by Zint are held in a `zint_symbol` structure defined in
+`"zint.h"`. These symbols are created with the `ZBarcode_Create()` function and
+deleted using the `ZBarcode_Delete()` function. For example the following code
+creates and then deletes a symbol:
+
+```c
+#include
+#include
+int main()
+{
+ struct zint_symbol *my_symbol;
+ my_symbol = ZBarcode_Create();
+ if (my_symbol != NULL) {
+ printf("Symbol successfully created!\n");
+ }
+ ZBarcode_Delete(my_symbol);
+ return 0;
+}
+```
+
+When compiling this code it will need to be linked with the `libzint` library
+using the `-lzint` option:
+
+```bash
+gcc -o simple simple.c -lzint
+```
+
+## 5.2 Encoding and Saving to File
+
+To encode data in a barcode use the `ZBarcode_Encode()` function. To write the
+symbol to a file use the `ZBarcode_Print()` function. For example the following
+code takes a string from the command line and outputs a Code 128 symbol in a
+PNG file named `"out.png"` (or a GIF file called `"out.gif"` if `libpng` is not
+present) in the current working directory:
+
+```c
+#include
+int main(int argc, char **argv)
+{
+ struct zint_symbol *my_symbol;
+ my_symbol = ZBarcode_Create();
+ ZBarcode_Encode(my_symbol, argv[1], 0);
+ ZBarcode_Print(my_symbol, 0);
+ ZBarcode_Delete(my_symbol);
+ return 0;
+}
+```
+
+This can also be done in one stage using the `ZBarcode_Encode_and_Print()`
+function as shown in the next example:
+
+```c
+#include
+int main(int argc, char **argv)
+{
+ struct zint_symbol *my_symbol;
+ my_symbol = ZBarcode_Create();
+ ZBarcode_Encode_and_Print(my_symbol, argv[1], 0, 0);
+ ZBarcode_Delete(my_symbol);
+ return 0;
+}
+```
+
+Note that when using the API, the input data is assumed to be 8-bit binary
+unless the `input_mode` variable in the `zint_symbol` structure is set - see
+[5.10 Setting the Input Mode] for details.
+
+## 5.3 Encoding and Printing Functions in Depth
+
+The functions for encoding and printing barcodes are defined as:
+
+```c
+int ZBarcode_Encode(struct zint_symbol *symbol,
+ const unsigned char *source, int length);
+
+int ZBarcode_Encode_File(struct zint_symbol *symbol,
+ const char *filename);
+
+int ZBarcode_Print(struct zint_symbol *symbol, int rotate_angle);
+
+int ZBarcode_Encode_and_Print(struct zint_symbol *symbol,
+ const unsigned char *source, int length, int rotate_angle);
+
+int ZBarcode_Encode_File_and_Print(struct zint_symbol *symbol,
+ const char *filename, int rotate_angle);
+```
+
+In these definitions `length` can be used to set the length of the input
+string. This allows the encoding of `NUL` (ASCII 0) characters in those
+symbologies which allow this. A value of 0 will disable this usage and Zint
+will encode data up to the first `NUL` character in the input string, which must
+be present.
+
+The `rotate_angle` value can be used to rotate the image when outputting. Valid
+values are 0, 90, 180 and 270.
+
+The `ZBarcode_Encode_File()` and `ZBarcode_Encode_File_and_Print()` functions
+can be used to encode data read directly from a text file where the filename is
+given in the `NUL`-terminated `filename` string.
+
+If printing more than one barcode, the `zint_symbol` structure may be re-used by
+calling the `ZBarcode_Clear()` function after each barcode to free any output
+buffers allocated. The `zint_symbol` input variables must be reset.
+
+## 5.4 Buffering Symbols in Memory (raster)
+
+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:
+
+```c
+int ZBarcode_Buffer(struct zint_symbol *symbol, int rotate_angle);
+
+int ZBarcode_Encode_and_Buffer(struct zint_symbol *symbol,
+ const unsigned char *source, int length, int rotate_angle);
+
+int ZBarcode_Encode_File_and_Buffer(struct zint_symbol *symbol,
+ const char *filename, int rotate_angle);
+```
+
+The arguments here are the same as above. The difference is that instead of
+saving the image to a file it is placed in an unsigned character array. The
+`bitmap` pointer is set to the first memory location in the array and the values
+`barcode_width` and `barcode_height` indicate the size of the resulting image
+in pixels. Rotation and colour options can be used with the buffer functions in
+the same way as when saving to a file. The pixel data can be extracted from the
+array by the method shown in the example below where `render_pixel()` is assumed
+to be a function for drawing a pixel on the screen implemented by the external
+application:
+
+```c
+int row, col, i = 0;
+int red, blue, green;
+
+for (row = 0; row < my_symbol->bitmap_height; row++) {
+ for (col = 0; col < my_symbol->bitmap_width; col++) {
+ red = (int) my_symbol->bitmap[i];
+ green = (int) my_symbol->bitmap[i + 1];
+ blue = (int) my_symbol->bitmap[i + 2];
+ render_pixel(row, col, red, green, blue);
+ i += 3;
+ }
+}
+```
+
+Where speed is important, the buffer can be returned instead in a more compact
+intermediate form using the output option `OUT_BUFFER_INTERMEDIATE`. Here each
+byte is an ASCII value: `'1'` for foreground colour and `'0'` for background
+colour, except for Ultracode, which also uses colour codes: `'W'` for white,
+`'C'` for cyan, `'B'` for blue, `'M'` for magenta, `'R'` for red, `'Y'` for
+yellow, `'G'` for green, and `'K'` for black. The loop for accessing the data is
+then:
+
+```c
+int row, col, i = 0;
+
+for (row = 0; row < my_symbol->bitmap_height; row++) {
+ for (col = 0; col < my_symbol->bitmap_width; col++) {
+ render_pixel(row, col, my_symbol->bitmap[i]);
+ i++;
+ }
+}
+```
+
+## 5.5 Buffering Symbols in Memory (vector)
+
+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:
+
+```c
+int ZBarcode_Buffer_Vector(struct zint_symbol *symbol, int rotate_angle);
+
+int ZBarcode_Encode_and_Buffer_Vector(struct zint_symbol *symbol,
+ const unsigned char *source, int length, int rotate_angle);
+
+int ZBarcode_Encode_File_and_Buffer_Vector(struct zint_symbol *symbol,
+ const char *filename, int rotate_angle);
+```
+
+Here the `vector` pointer is set to a header 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
+`prepare_canvas()`, `draw_rect()`, `draw_hexagon()`, `draw_string()`, and
+`draw_circle()` routines available:
+
+```c
+struct zint_vector_rect *rect;
+struct zint_vector_hexagon *hexagon;
+struct zint_vector_string *string;
+struct zint_vector_circle *circle;
+
+prepare_canvas(my_symbol->vector->width, my_symbol->vector->height,
+ my_symbol->scale, my_symbol->fgcolour, my_symbol->bgcolor,
+ rotate_angle);
+
+for (rect = my_symbol->vector->rectangles; rect; rect = rect->next) {
+ draw_rect(rect->x, rect->y, rect->width, rect->height,
+ rect->colour);
+}
+for (hexagon = my_symbol->vector->hexagons; hexagon; hexagon = hexagon->next) {
+ draw_hexagon(hexagon->x, hexagon->y, hexagon->diameter,
+ hexagon->rotation);
+}
+for (string = my_symbol->vector->strings; string; string = string->next) {
+ draw_string(string->x, string->y, string->fsize,
+ string->rotation, string->halign,
+ string->text, string->length);
+}
+for (circle = my_symbol->vector->circles; circle; circle = circle->next) {
+ draw_circle(circle->x, circle->y, circle->diameter,
+ circle->width, circle->colour);
+}
+```
+
+## 5.6 Setting Options
+
+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 `"out.png"`. As with the CLI
+program, of course, these options can be altered. The way this is done is by
+altering the contents of the `zint_symbol` structure between the creation and
+encoding stages. The `zint_symbol` structure consists of the following
+variables:
+
+--------------------------------------------------------------------------------
+Variable Name Type Meaning Default Value
+-------------------- ---------- --------------------------- -----------------
+`symbology` integer Symbol to use (see [5.8 `BARCODE_CODE128`
+ Specifying a Symbology]).
+
+`height` float Symbol height, excluding Symbol dependent
+ fixed width-to-height
+ symbols.[^5]
+
+`scale` float Scale factor for adjusting 1.0
+ size of image.
+
+`whitespace_width` integer Horizontal whitespace width. 0
+
+`whitespace_height` integer Vertical whitespace height. 0
+
+`border_width` integer Border width. 0
+
+`output_options` integer Set various output file 0 (none)
+ parameters (see [5.9
+ Adjusting Other Output
+ Options]).
+
+`fgcolour` character Foreground (ink) `"000000"`
+ string colour as RGB/RGBA
+ hexadecimal string. Must be
+ 6 or 8 characters followed
+ by a terminating `NUL`.
+
+`bgcolour` character Background (paper) `"ffffff"`
+ string colour as RGB/RGBA
+ hexadecimal string. Must be
+ 6 or 8 characters followed
+ by a terminating `NUL`.
+
+`fgcolor` pointer Points to fgcolour allowing
+ alternate spelling.
+
+`bgcolor` pointer Points to bgcolour allowing
+ alternate spelling.
+
+`outfile` character Contains the name of the `"out.png"`
+ string file to output a resulting
+ barcode symbol to. Must end
+ in `.png`, `.gif`, `.bmp`,
+ `.emf`, `.eps`, `.pcx`,
+ `.svg`, `.tif` or `.txt`
+ followed by a terminating
+ `NUL`.
+
+`primary` character Primary message data for `""` (empty)
+ string more complex symbols, with
+ a terminating `NUL`.
+
+`option_1` integer Symbol specific options. -1
+
+`option_2` integer Symbol specific options. 0
+
+`option_3` integer Symbol specific options. 0
+
+`show_hrt` integer Set to 0 to hide text 1
+
+`input_mode` integer Set encoding of input `DATA_MODE`
+ data (see [5.10 Setting the
+ Input Mode]).
+
+`eci` integer Extended Channel 0 (none)
+ Interpretation code.
+
+`dot_size` float Diameter of dots used in 4.0 / 5.0
+ dotty mode.
+
+`guard_descent` float Height of guard bar 5.0
+ descent (UPC/EAN only)
+
+`structapp` Structured Mark a symbol as part of a count 0
+ Append sequence of symbols. (disabled)
+ structure
+
+`warn_level` integer Affects error/warning value `WARN_DEFAULT`
+ returned by Zint API (see
+ [5.7 Handling Errors]).
+
+`text` unsigned Human Readable Text, which `""` (empty)
+ character usually consists of input (output only)
+ string data plus one more check
+ digit. Uses UTF-8
+ formatting, with a
+ terminating `NUL`.
+
+`rows` integer Number of rows used by the (output only)
+ symbol.
+
+`width` integer Width of the generated (output only)
+ symbol.
+
+`encoding_data` array of Representation of the (output only)
+ unsigned encoded data.
+ character
+ arrays
+
+`row_height` array of Representation of the (output only)
+ floats height of a row.
+
+`errtxt` character Error message in the event (output only)
+ string that an error occurred,
+ with a terminating `NUL`.
+
+`bitmap` pointer to Pointer to stored bitmap (output only)
+ unsigned image.
+ character
+ array
+
+`bitmap_width` integer Width of stored bitmap (output only)
+ image (in pixels).
+
+`bitmap_height` integer Height of stored bitmap (output only)
+ image (in pixels).
+
+`alphamap` pointer to Pointer to array (output only)
+ unsigned representing alpha channel
+ character (or `NULL` if no alpha
+ array channel needed)
+
+`bitmap_byte_length` integer Size of BMP bitmap data. (output only)
+
+`vector` pointer to Pointer to vector header (output only)
+ vector containing pointers to
+ structure vector elements.
+--------------------------------------------------------------------------------
+
+Table: API Structure `zint_symbol` {#tbl:api_structure_zint_symbol tag="$ $"}
+
+[^5]: This 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).
+
+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.
+
+```c
+#include
+#include
+int main(int argc, char **argv)
+{
+ struct zint_symbol *my_symbol;
+ my_symbol = ZBarcode_Create();
+ strcpy(my_symbol->fgcolour, "00ff00");
+ my_symbol->height = 400.0f;
+ ZBarcode_Encode_and_Print(my_symbol, argv[1], 0, 0);
+ ZBarcode_Delete(my_symbol);
+ return 0;
+}
+```
+
+Background removal for EMF, EPS, GIF, PNG, SVG and TIF files can be achieved by
+setting the background alpha to `"00"` where the values for R, G and B will be
+ignored:
+
+```c
+strcpy(my_symbol->bgcolour, "55555500");
+```
+
+## 5.7 Handling Errors
+
+If errors occur during encoding a non-zero integer value is passed back to the
+calling application. In addition the `errtxt` variable is used to give a message
+detailing the nature of the error. The errors generated by Zint are given in the
+table below:
+
+--------------------------------------------------------------------------------
+Return Value Meaning
+----------------------------- -------------------------------------------------
+`ZINT_WARN_INVALID_OPTION` One of the values in `zint_struct` was set
+ incorrectly but Zint has made a guess at what it
+ should have been and generated a barcode
+ accordingly.
+
+`ZINT_WARN_USES_ECI` Zint has automatically inserted an ECI character.
+ The symbol may not be readable with some readers.
+
+`ZINT_WARN_NONCOMPLIANT` The symbol was created but is not compliant with
+ certain standards set in its specification (e.g.
+ height, GS1 AI data lengths).
+
+`ZINT_ERROR` 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.
+
+`ZINT_ERROR_TOO_LONG` The input data is too long or too short for the
+ selected symbology. No symbol has been generated.
+
+`ZINT_ERROR_INVALID_DATA` 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.
+
+`ZINT_ERROR_INVALID_CHECK` Data with an incorrect check digit has been
+ entered. No symbol has been generated.
+
+`ZINT_ERROR_INVALID_OPTION` One of the values in `zint_struct` was set
+ incorrectly and Zint was unable to guess what it
+ should have been. No symbol has been generated.
+
+`ZINT_ERROR_ENCODING_PROBLEM` A problem has occurred during encoding of the
+ data. This should never happen. Please contact
+ the developer if you encounter this error.
+
+`ZINT_ERROR_FILE_ACCESS` Zint was unable to open the requested output
+ file. This is usually a file permissions problem.
+
+`ZINT_ERROR_MEMORY` Zint ran out of memory. This should only be a
+ problem with legacy systems.
+
+`ZINT_ERROR_FILE_WRITE` Zint failed to write all contents to the
+ requested output file. This should only occur if
+ the output device becomes full.
+
+`ZINT_ERROR_USES_ECI` Returned if `warn_level` set to `WARN_FAIL_ALL`
+ and `ZINT_WARN_USES_ECI` occurs.
+
+`ZINT_ERROR_NONCOMPLIANT` Returned if `warn_level` set to `WARN_FAIL_ALL`
+ and `ZINT_WARN_NONCOMPLIANT` occurs.
+--------------------------------------------------------------------------------
+
+Table: {#tbl:api_warnings_errors tag=": API Warning and Error Return Values"}
+
+To catch errors use an integer variable as shown in the code below:
+
+```c
+#include
+#include
+#include
+int main(int argc, char **argv)
+{
+ struct zint_symbol *my_symbol;
+ int error;
+ my_symbol = ZBarcode_Create();
+ strcpy(my_symbol->fgcolour, "nonsense");
+ error = ZBarcode_Encode_and_Print(my_symbol, argv[1], 0, 0);
+ if (error != 0) {
+ /* some warning or error occurred */
+ printf("%s\n", my_symbol->errtxt);
+ }
+ if (error >= ZINT_ERROR) {
+ /* stop now */
+ ZBarcode_Delete(my_symbol);
+ return 1;
+ }
+ /* otherwise carry on with the rest of the application */
+ ZBarcode_Delete(my_symbol);
+ return 0;
+}
+```
+
+This code will exit with the appropriate message:
+
+```
+Error 653: Malformed foreground colour 'NONSENSE' (hexadecimal only)
+```
+
+To treat all warnings as errors, set `symbol->warn_level` to `WARN_FAIL_ALL`.
+
+## 5.8 Specifying a Symbology
+
+Symbologies can be specified by number or by name as shown in the Table :
+{@tbl:barcode_types}. For example
+
+```c
+symbol->symbology = BARCODE_LOGMARS;
+```
+
+means the same as
+
+```c
+symbol->symbology = 50;
+```
+
+## 5.9 Adjusting Other Output Options
+
+The `output_options` variable can be used to adjust various aspects of the
+output file. To select more than one option from the table below simply `OR`
+them together when adjusting this value:
+
+```c
+my_symbol->output_options |= BARCODE_BIND | READER_INIT;
+```
+
+--------------------------------------------------------------------------------
+Value Effect
+------------------------- -----------------------------------------------------
+ 0 No options selected.
+
+`BARCODE_BIND` Boundary bars above and below the symbol and between
+ rows if stacking multiple symbols.[^6]
+
+`BARCODE_BOX` Add a box surrounding the symbol and whitespace.
+
+`BARCODE_STDOUT` Output the file to stdout.
+
+`READER_INIT` Add a reader initialisation symbol to the data
+ before encoding.
+
+`SMALL_TEXT` Use a smaller font for the Human Readable Text.
+
+`BOLD_TEXT` Embolden the Human Readable Text.
+
+`CMYK_COLOUR` Select the CMYK colour space option for Encapsulated
+ PostScript and TIF files.
+
+`BARCODE_DOTTY_MODE` Plot a matrix symbol using dots rather than squares.
+
+`GS1_GS_SEPARATOR` Use GS instead of FNC1 as GS1 separator (Data Matrix
+ only).
+
+`OUT_BUFFER_INTERMEDIATE` Return the bitmap buffer as ASCII values instead of
+ separate colour channels (`OUT_BUFFER` only).
+
+`BARCODE_QUIET_ZONES` Add compliant quiet zones (additional to any
+ specified whitespace).[^7]
+
+`BARCODE_NO_QUIET_ZONES` Disable quiet zones, notably those with defaults.
+
+`COMPLIANT_HEIGHT` Warn if height not compliant and use standard height
+ (if any) as default.
+--------------------------------------------------------------------------------
+
+Table: API `output_options` Values {#tbl:api_output_options tag="$ $"}
+
+[^6]: This flag is always set for Codablock-F, Code 16K and Code 49. Special
+considerations apply to ITF-14 - see [6.1.2.6 ITF-14].
+
+[^7]: 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.
+
+\clearpage
+
+## 5.10 Setting the Input Mode
+
+The way in which the input data is encoded can be set using the `input_mode`
+property. Valid values are shown in the table below.
+
+--------------------------------------------------------------------------------
+Value Effect
+------------------ ------------------------------------------------------------
+`DATA_MODE` Uses full 8-bit range interpreted as binary data.
+
+`UNICODE_MODE` Uses UTF-8 input.
+
+`GS1_MODE` Encodes GS1 data using FNC1 characters.
+
+ _The above are exclusive, the following optional and OR-ed._
+
+`ESCAPE_MODE` Process input data for escape sequences.
+
+`GS1PARENS_MODE` Parentheses (round brackets) used in GS1 data instead of
+ square brackets to delimit Application Identifiers
+ (parentheses must not otherwise occur in the data).
+
+`GS1NOCHECK_MODE` 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.
+
+`HEIGHTPERROW_MODE` Interpret the `height` variable as per-row rather than as
+ overall height.
+
+`FAST_MODE` Use faster if less optimal encodation for symbologies that
+ support it (currently `DATAMATRIX` only).
+--------------------------------------------------------------------------------
+
+Table: API `input_mode` Values {#tbl:api_input_mode tag="$ $"}
+
+The default mode is `DATA_MODE`. (Note that this differs from the default for
+the CLI and GUI, which is `UNICODE_MODE`.)
+
+`DATA_MODE`, `UNICODE_MODE` and `GS1_MODE` are mutually exclusive, whereas
+`ESCAPE_MODE`, `GS1PARENS_MODE`, `GS1NOCHECK_MODE`, `HEIGHTPERROW_MODE` and
+`FAST_MODE` are optional. So, for example, you can set
+
+```c
+my_symbol->input_mode = UNICODE_MODE | ESCAPE_MODE;
+```
+
+or
+
+```c
+my_symbol->input_mode = GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE;
+```
+
+whereas
+
+```c
+my_symbol->input_mode = DATA_MODE | GS1_MODE;
+```
+
+is not valid.
+
+Permissible escape sequences are listed in Table {@tbl:escape_sequences}. An
+example of `GS1PARENS_MODE` usage is given in section [6.1.10.3 GS1-128].
+
+`GS1NOCHECK_MODE` 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.).
+
+For `HEIGHTPERROW_MODE`, see `--heightperrow` in section [4.4 Adjusting Height].
+The `height` variable should be set to the desired per-row value on input (it
+will be set to the overall height on output).
+
+## 5.11 Multiple Segments
+
+For input data requiring multiple ECIs, the following functions may be used:
+
+```c
+int ZBarcode_Encode_Segs(struct zint_symbol *symbol,
+ const struct zint_seg segs[], const int seg_count);
+
+int ZBarcode_Encode_Segs_and_Print(struct zint_symbol *symbol,
+ const struct zint_seg segs[], const int seg_count, int rotate_angle);
+
+int ZBarcode_Encode_Segs_and_Buffer(struct zint_symbol *symbol,
+ const struct zint_seg segs[], const int seg_count, int rotate_angle);
+
+int ZBarcode_Encode_Segs_and_Buffer_Vector(struct zint_symbol *symbol,
+ const struct zint_seg segs[], const int seg_count, int rotate_angle);
+```
+
+These are direct analogues of the previously mentioned `ZBarcode_Encode()`,
+`ZBarcode_Encode_and_Print()`, `ZBarcode_Encode_and_Buffer()` and
+`ZBarcode_Encode_and_Buffer_Vector()` respectively, where instead of a pair
+consisting of `"source, length"`, a pair consisting of `"segs, seg_count"` is
+given, with `segs` being an array of `struct zint_seg` segments and `seg_count`
+being the number of elements it contains. The zint_seg structure is of the form:
+
+```c
+struct zint_seg {
+ unsigned char *source; /* Data to encode */
+ int length; /* Length of `source`. If 0, `source` must be
+ NUL-terminated */
+ int eci; /* Extended Channel Interpretation */
+};
+```
+
+The symbology must support ECIs (see Table {@tbl:eci_aware_symbologies}). For
+example:
+
+```c
+#include
+int main(int argc, char **argv)
+{
+ struct zint_seg segs[] = {
+ { "Κείμενο", 0, 9 },
+ { "Текст", 0, 7 },
+ { "文章", 0, 20 }
+ };
+ struct zint_symbol *my_symbol;
+ my_symbol = ZBarcode_Create();
+ my_symbol->symbology = BARCODE_AZTEC;
+ my_symbol->input_mode = UNICODE_MODE;
+ ZBarcode_Encode_Segs(my_symbol, segs, 3);
+ ZBarcode_Print(my_symbol, 0);
+ ZBarcode_Delete(my_symbol);
+ return 0;
+}
+```
+
+A maximum of 256 segments may be specified. Use of multiple segments with GS1
+data is not currently supported.
+
+## 5.12 Verifying Symbology Availability
+
+An additional function available in the API is:
+
+```c
+int ZBarcode_ValidID(int symbol_id);
+```
+
+which allows you to check whether a given symbology is available, returning a
+non-zero value if so. For example:
+
+```c
+if (ZBarcode_ValidID(BARCODE_PDF417) != 0) {
+ printf("PDF417 available\n");
+} else {
+ printf("PDF417 not available\n");
+}
+```
+
+Another function that may be useful is:
+
+```c
+int ZBarcode_BarcodeName(int symbol_id, char name[32]);
+```
+
+which copies the name of a symbology into the supplied `name` buffer, which
+should be 32 characters in length. The name is `NUL`-terminated, and zero is
+returned on success. For instance:
+
+```c
+char name[32];
+if (ZBarcode_BarcodeName(BARCODE_PDF417, name) == 0) {
+ printf("%s\n", name);
+}
+```
+
+will print `BARCODE_PDF417`.
+
+## 5.13 Checking Symbology Capabilities
+
+It can be useful for frontend programs to know the capabilities of a symbology.
+This can be determined using another additional function:
+
+```c
+unsigned int ZBarcode_Cap(int symbol_id, unsigned int cap_flag);
+```
+
+by `OR`-ing the flags below in the `cap_flag` argument and checking the return
+to see which are set.
+
+--------------------------------------------------------------------------------
+Value Meaning
+------------------------- ----------------------------------------------------
+`ZINT_CAP_HRT` Can the symbology print Human Readable Text?
+
+`ZINT_CAP_STACKABLE` Is the symbology stackable?
+
+`ZINT_CAP_EXTENDABLE` Is the symbology extendable with add-on data? (i.e.
+ is it UPC/EAN?)
+
+`ZINT_CAP_COMPOSITE` Does the symbology support composite data? (see [6.3
+ Composite Symbols (ISO 24723)] below)
+
+`ZINT_CAP_ECI` Does the symbology support Extended Channel
+ Interpretations?
+
+`ZINT_CAP_GS1` Does the symbology support GS1 data?
+
+`ZINT_CAP_DOTTY` Can the symbology be outputted as dots?
+
+`ZINT_CAP_QUIET_ZONES` Does the symbology have default quiet zones?
+
+`ZINT_CAP_FIXED_RATIO` Does the symbology have a fixed width-to-height
+ (aspect) ratio?
+
+`ZINT_CAP_READER_INIT` Does the symbology support Reader Initialisation?
+
+`ZINT_CAP_FULL_MULTIBYTE` Is the `ZINT_FULL_MULTIBYTE` option applicable?
+
+`ZINT_CAP_MASK` Is mask selection applicable?
+
+`ZINT_CAP_STRUCTAPP` Does the symbology support Structured Append?
+
+`ZINT_CAP_COMPLIANT_HEIGHT` Does the symbology have a compliant height defined?
+--------------------------------------------------------------------------------
+
+Table: {#tbl:api_cap tag=": API Capability Flags"}
+
+For example:
+
+```c
+unsigned int cap = ZBarcode_Cap(BARCODE_PDF417, ZINT_CAP_HRT | ZINT_CAP_ECI);
+if (cap & ZINT_CAP_HRT) {
+ printf("PDF417 supports HRT\n");
+} else {
+ printf("PDF417 does not support HRT\n");
+}
+if (cap & ZINT_CAP_ECI) {
+ printf("PDF417 supports ECI\n");
+} else {
+ printf("PDF417 does not support ECI\n");
+}
+```
+
+## 5.14 Zint Version
+
+Lastly, the version of the Zint library linked to is returned by:
+
+```c
+int ZBarcode_Version();
+```
+
+The version parts are separated by hundreds. For instance, version `"2.9.1"` is
+returned as `"20901"`.
+
+
+# 6. Types of Symbology
+
+## 6.1 One-Dimensional Symbols
+
+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.
+
+### 6.1.1 Code 11
+
+![`zint -b CODE11 -d "9212320967"`](images/code11.svg)
+
+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 (`-`) up to a maximum of 121 characters.
+Two modulo-11 check digits are added by default. To add just one check digit,
+set `--vers=1` (API `option_2 = 1`). To add no check digits, set `--vers=2`
+(API `option_2 = 2`).
+
+### 6.1.2 Code 2 of 5
+
+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.
+
+#### 6.1.2.1 Standard Code 2 of 5
+
+![`zint -b C25STANDARD -d "9212320967"`](images/c25standard.svg)
+
+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 80 digits. No check digit is added by
+default. To add a check digit, set `--vers=1` (API `option_2 = 1`). To add a
+check digit but not show it in the Human Readable Text, set `--vers=2` (API
+`option_2 = 2`).
+
+#### 6.1.2.2 IATA Code 2 of 5
+
+![`zint -b C25IATA -d "9212320967"`](images/c25iata.svg)
+
+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 45 digits. No check digit is added by default. To add a
+check digit, set `--vers=1` (API `option_2 = 1`). To add a check digit but not
+show it in the Human Readable Text, set `--vers=2` (API `option_2 = 2`).
+
+#### 6.1.2.3 Industrial Code 2 of 5
+
+![`zint -b C25IND -d "9212320967"`](images/c25ind.svg)
+
+Industrial Code 2 of 5 can encode numeric input (digits 0-9) up to a maximum of
+45 digits. No check digit is added by default. To add a check digit, set
+`--vers=1` (API `option_2 = 1`). To add a check digit but not show it in the
+Human Readable Text, set `--vers=2` (API `option_2 = 2`).
+
+#### 6.1.2.4 Interleaved Code 2 of 5 (ISO 16390)
+
+![`zint -b C25INTER --compliantheight -d "9212320967"`](images/c25inter.svg)
+
+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 45 pairs (90 digits) can be encoded. No
+check digit is added by default. To add a check digit, set `--vers=1` (API
+`option_2 = 1`). To add a check digit but not show it in the Human Readable
+Text, set `--vers=2` (API `option_2 = 2`).
+
+#### 6.1.2.5 Code 2 of 5 Data Logic
+
+![`zint -b C25LOGIC -d "9212320967"`](images/c25logic.svg)
+
+Data Logic does not include a check digit by default and can encode numeric
+input (digits 0-9) up to a maximum of 80 digits. To add a check digit, set
+`--vers=1` (API `option_2 = 1`). To add a check digit but not show it in the
+Human Readable Text, set `--vers=2` (API `option_2 = 2`).
+
+#### 6.1.2.6 ITF-14
+
+![`zint -b ITF14 --compliantheight -d "9212320967145"`](images/itf14.svg)
+
+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.
+
+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 `--bind` option
+(API `output_options |= BARCODE_BIND`). Similarly the border width can be
+overridden using `--border` (API `border_width`). If a symbol with no border is
+required this can be achieved by explicitly setting the border type to box (or
+bind) and leaving the border width 0.
+
+![`zint -b ITF14 --box --compliantheight -d
+"9212320967145"`](images/itf14_border0.svg)
+
+#### 6.1.2.7 Deutsche Post Leitcode
+
+![`zint -b DPLEIT -d "9212320967145"`](images/dpleit.svg)
+
+Leitcode is based on Interleaved Code 2 of 5 and is used by Deutsche Post for
+mailing purposes. Leitcode requires a 13-digit numerical input and includes a
+check digit.
+
+#### 6.1.2.8 Deutsche Post Identcode
+
+![`zint -b DPIDENT -d "91232096712"`](images/dpident.svg)
+
+Identcode is based on Interleaved Code 2 of 5 and is used by Deutsche Post for
+mailing purposes. Identcode requires an 11-digit numerical input and includes a
+check digit.
+
+### 6.1.3 Universal Product Code (ISO 15420)
+
+#### 6.1.3.1 UPC Version A
+
+![`zint -b UPCA --compliantheight -d "72527270270"`](images/upca.svg)
+
+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 + 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:
+
+```bash
+zint -b UPCA -d 72527270270+12345
+```
+
+or encode a data string with the + character included:
+
+```c
+my_symbol->symbology = BARCODE_UPCA;
+
+error = ZBarcode_Encode_and_Print(my_symbol, "72527270270+12345", 0, 0);
+```
+
+![`zint -b UPCA --compliantheight -d "72527270270+12345"`](images/upca_5.svg)
+
+If your input data already includes the check digit symbology `BARCODE_UPCA_CHK`
+(35) can be used which takes a 12 digit input and validates the check digit
+before encoding.
+
+You can adjust the gap between the main symbol and an add-on in multiples of
+the X-dimension by setting `--addongap` (API `option_2`) 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 `--guarddescent` (API `guard_descent`)
+to a value between 0 and 20 (default 5).
+
+#### 6.1.3.2 UPC Version E
+
+![`zint -b UPCE --compliantheight -d "1123456"`](images/upce.svg)
+
+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 stating with the digit 1. For
+example:
+
+```bash
+zint -b UPCE -d 1123456
+```
+
+or
+
+```c
+my_symbol->symbology = BARCODE_UPCE;
+
+error = ZBarcode_Encode_and_Print(my_symbol, "1123456", 0, 0);
+```
+
+If your input data already includes the check digit symbology `BARCODE_UPCE_CHK`
+(38) can be used which takes a 7 or 8 digit input and validates the check digit
+before encoding.
+
+You can adjust the gap between the main symbol and an add-on in multiples of
+the X-dimension by setting `--addongap` (API `option_2`) 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 `--guarddescent` (API `guard_descent`)
+to a value between 0 and 20 (default 5).
+
+### 6.1.4 European Article Number (ISO 15420)
+
+#### 6.1.4.1 EAN-2, EAN-5, EAN-8 and EAN-13
+
+![`zint -b EANX --compliantheight -d "4512345678906"`](images/eanx13.svg)
+
+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 + character as with UPC symbols. For example:
+
+```bash
+zint -b EANX -d 54321
+```
+
+![`zint -b EANX --compliantheight -d "54321"`](images/eanx5.svg)
+
+will encode a stand-alone EAN-5, whereas
+
+```bash
+zint -b EANX -d 7432365+54321
+```
+
+will encode an EAN-8 symbol with an EAN-5 add-on. As before these results can
+be achieved using the API:
+
+```c
+my_symbol->symbology = BARCODE_EANX;
+
+error = ZBarcode_Encode_and_Print(my_symbol, "54321", 0, 0);
+
+error = ZBarcode_Encode_and_Print(my_symbol, "7432365+54321", 0, 0);
+```
+
+![`zint -b EANX --compliantheight -d "7432365+54321"`](images/eanx8_5.svg)
+
+All of the EAN symbols include check digits which are added by Zint.
+
+If you are encoding an EAN-8 or EAN-13 symbol and your data already includes
+the check digit then you can use symbology `BARCODE_EANX_CHK` (14) which takes
+an 8 or 13 digit input and validates the check digit before encoding.
+
+You can adjust the gap between the main symbol and an add-on in multiples of
+the X-dimension by setting `--addongap` (API `option_2`) 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 `--guarddescent` (API `guard_descent`)
+to a value between 0 and 20 (default 5).
+
+#### 6.1.4.2 SBN, ISBN and ISBN-13
+
+![`zint -b ISBNX --compliantheight -d "9789295055124"`](images/isbnx.svg)
+
+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. In addition EAN-2 and EAN-5 add-on symbols can be added using the +
+character as with UPC symbols, and the gap set with `--addongap` (API
+`option_2`) to between 7 (default) and 12. The height that the guard bars
+descend can be adjusted by setting `--guarddescent` (API `guard_descent`) to a
+value between 0 and 20 (default 5).
+
+### 6.1.5 Plessey
+
+#### 6.1.5.1 UK Plessey
+
+![`zint -b PLESSEY -d "C64"`](images/plessey.svg)
+
+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 up to a maximum of 65 characters and includes a CRC check digit.
+
+#### 6.1.5.2 MSI Plessey
+
+![`zint -b MSI_PLESSEY -d "6502" --vers=2`](images/msi_plessey.svg)
+
+Based on Plessey and developed by MSE Data Corporation, MSI Plessey has a range
+of check digit options that are selectable by setting `--vers` (API `option_2`).
+Numeric (digits 0-9) input can be encoded, up to a maximum of 65 digits. The
+table below shows the options available:
+
+Value Check Digits
+----- ---------------------------
+0 None
+1 Modulo-10 (Luhn)
+2 Modulo-10 & Modulo-10
+3 Modulo-11 (IBM)
+4 Modulo-11 (IBM) & Modulo-10
+5 Modulo-11 (NCR)
+6 Modulo-11 (NCR) & Modulo-10
+
+Table: {#tbl:msi_plessey_check_digits tag=": MSI Plessey Check Digit Options"}
+
+To not show the check digit or digits in the Human Readable Text, add 10 to the
+`--vers` value. For example `--vers=12` (API `option_2 = 12`) will add two
+hidden modulo-10 check digits.
+
+### 6.1.6 Telepen
+
+#### 6.1.6.1 Telepen Alpha
+
+![`zint -b TELEPEN --compliantheight -d "Z80"`](images/telepen.svg)
+
+Telepen Alpha was developed by SB Electronic Systems Limited and can encode
+ASCII text input, up to a maximum of 30 characters. Telepen includes a
+modulo-127 check digit.
+
+#### 6.1.6.2 Telepen Numeric
+
+![`zint -b TELEPEN_NUM --compliantheight -d "466X33"`](images/telepen_num.svg)
+
+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 `"X3"` is not valid). Up to 60 digits can be
+encoded. Telepen Numeric includes a modulo-127 check digit which is added by
+Zint.
+
+### 6.1.7 Code 39
+
+#### 6.1.7.1 Standard Code 39 (ISO 16388)
+
+![`zint -b CODE39 --compliantheight -d "1A" --vers=1`](images/code39.svg)
+
+Standard Code 39 was developed in 1974 by Intermec. Input data can be up to 85
+characters in length and can include the characters 0-9, A-Z, dash (`-`), full
+stop (`.`), space, asterisk (`*`), dollar (`$`), slash (`/`), plus (`+`) and
+percent (`%`). The standard does not require a check digit but a modulo-43 check
+digit can be added if required by setting `--vers=1` (API `option_2 = 1`).
+
+#### 6.1.7.2 Extended Code 39
+
+![`zint -b EXCODE39 --compliantheight -d "123.45$@fd"`](images/excode39.svg)
+
+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 standard does not
+require a check digit but a modulo-43 check digit can be added if required by
+setting `--vers=1` (API `option_2 = 1`).
+
+#### 6.1.7.3 Code 93
+
+![`zint -b CODE93 --compliantheight -d "C93"`](images/code93.svg)
+
+A variation of Extended Code 39, Code 93 also supports full ASCII text. 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 `--vers=1` (API
+`option_2 = 1`).
+
+#### 6.1.7.4 PZN (Pharmazentralnummer)
+
+![`zint -b PZN --compliantheight -d "2758089"`](images/pzn.svg)
+
+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.
+
+#### 6.1.7.5 LOGMARS
+
+![`zint -b LOGMARS --compliantheight -d "12345/ABCDE"
+--vers=1`](images/logmars.svg)
+
+LOGMARS (Logistics Applications of Automated Marking and Reading Symbols) is a
+variation of the Code 39 symbology used by the US Department of Defense.
+LOGMARS encodes the same character set as Standard Code 39. It does not require
+a check digit but a modulo-43 check digit can be added by setting `--vers=1`
+(API `option_2 = 1`).
+
+#### 6.1.7.6 Code 32
+
+![`zint -b CODE32 --compliantheight -d "14352312"`](images/code32.svg)
+
+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.
+
+#### 6.1.7.7 HIBC Code 39
+
+![`zint -b HIBC_39 --compliantheight -d "14352312"`](images/hibc_39.svg)
+
+This option adds a leading `'+'` character and a trailing modulo-49 check digit
+to a standard Code 39 symbol as required by the Health Industry Barcode
+standards.
+
+#### 6.1.7.8 Vehicle Identification Number (VIN)
+
+![`zint -b VIN -d "2FTPX28L0XCA15511" --vers=1`](images/vin.svg)
+
+A variation of Code 39 that for vehicle identification numbers used in North
+America (first character `'1'` to `'5'`) has a check character verification
+stage. A 17 character input (0-9, and A-Z excluding `'I'`, `'O'` and `'Q'`) is
+required. An invisible Import character prefix `'I'` can be added by setting
+`--vers=1` (API `option_2 = 1`).
+
+### 6.1.8 Codabar (EN 798)
+
+![`zint -b CODABAR --compliantheight -d "A37859B"`](images/codabar.svg)
+
+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 60 characters
+starting and ending with the letters A-D and containing between these letters
+the numbers 0-9, dash (`-`), dollar (`$`), colon (`:`), slash (`/`), full stop
+(`.`) or plus (`+`). No check character is generated by default, but a
+modulo-16 one can be added by setting `--vers=1` (API `option_2 = 1`). To have
+the check character appear in the Human Readable Text, set `--vers=2` (API
+`option_2 = 2`).
+
+### 6.1.9 Pharmacode
+
+![`zint -b PHARMA --compliantheight -d "130170"`](images/pharma.svg)
+
+Developed by Laetus, Pharmacode is used for the identification of
+pharmaceuticals. The symbology is able to encode whole numbers between 3 and
+131070.
+
+### 6.1.10 Code 128
+
+#### 6.1.10.1 Standard Code 128 (ISO 15417)
+
+![`zint -b CODE128 --bind -d "130170X178"`](images/code128.svg)
+
+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-mode system to compress the data into a smaller symbol. Zint
+automatically switches between modes and adds a modulo-103 check digit. 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 Appendix [A.2 Latin Alphabet No. 1
+(ISO/IEC 8859-1)].
+
+#### 6.1.10.2 Code 128 Subset B
+
+![`zint -b CODE128B -d "130170X178"`](images/code128b.svg)
+
+It is sometimes advantageous to stop Code 128 from using subset mode C which
+compresses numerical data. The `BARCODE_CODE128B` option (symbology 60)
+suppresses mode C in favour of mode B.
+
+#### 6.1.10.3 GS1-128
+
+![`zint -b GS1_128 --compliantheight -d
+"[01]98898765432106[3202]012345[15]991231"`](images/gs1_128.svg)
+
+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.
+
+For compatibility with data entry in other systems, if the data does not include
+round brackets, the option `--gs1parens` (API `input_mode |= GS1PARENS_MODE`)
+may be used to signal that AIs are encased in round brackets instead of square
+ones.
+
+Fixed length data should be entered at the appropriate length for correct
+encoding. GS1-128 does not support extended ASCII 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:
+
+```bash
+zint -b 16 -d "[01]98898765432106[3202]012345[15]991231"
+```
+
+or using the `--gs1parens` option:
+
+```bash
+zint -b 16 --gs1parens -d "(01)98898765432106(3202)012345(15)991231"
+```
+
+#### 6.1.10.4 EAN-14
+
+![`zint -b EAN14 --compliantheight -d "9889876543210"`](images/ean14.svg)
+
+A shorter version of GS1-128 which encodes GTIN data only. A 13 digit number is
+required. The GTIN check digit and AI (01) are added by Zint.
+
+#### 6.1.10.5 NVE-18 (SSCC-18)
+
+![`zint -b NVE18 --compliantheight -d "37612345000001003"`](images/nve18.svg)
+
+A variation of Code 128 the 'Nummer der Versandeinheit' standard, also known
+as SSCC-18 (Serial Shipping Container Code), includes both modulo-10 and
+modulo-103 check digits. NVE-18 requires a 17 digit numerical input. Check
+digits and AI (00) are added by Zint.
+
+#### 6.1.10.6 HIBC Code 128
+
+![`zint -b HIBC_128 -d "A123BJC5D6E71"`](images/hibc_128.svg)
+
+This option adds a leading `'+'` character and a trailing modulo-49 check digit
+to a standard Code 128 symbol as required by the Health Industry Barcode
+standards.
+
+#### 6.1.10.7 DPD Code
+
+![`zint -b DPD --compliantheight -d
+"%000393206219912345678101040"`](images/dpd.svg)
+
+Another variation of Code 128 as used by DPD (Deutsher Paket Dienst). Requires
+a 28 character alphanumeric input. Zint formats Human Readable Text as
+specified by DPD and adds a modulo-36 check character.
+
+### 6.1.11 GS1 DataBar (ISO 24724)
+
+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 `--mode=2` (API `option_1 = 2`). See [6.3 Composite Symbols (ISO
+24723)] to find out how to generate DataBar symbols with 2D components.
+
+#### 6.1.11.1 GS1 DataBar Omnidirectional and GS1 DataBar Truncated
+
+![`zint -b DBAR_OMN --compliantheight -d "0950110153001"`](images/dbar_omn.svg)
+
+Previously known as RSS-14 this standard encodes a 13 digit item code. A check
+digit and Application Identifier of (01) 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.) To produce a truncated symbol set the symbol height to a value
+between 13 and 32. Truncated symbols may not be scannable by omnidirectional
+scanners. Normal DataBar Omnidirectional symbols should have a height of 33 or
+greater.
+
+![`zint -b DBAR_OMN -d "0950110153001" --height=13`](images/dbar_truncated.svg)
+
+#### 6.1.11.2 GS1 DataBar Limited
+
+![`zint -b DBAR_LTD --compliantheight -d "0950110153001"`](images/dbar_ltd.svg)
+
+Previously known as RSS Limited this standard encodes a 13 digit item code and
+can be used in the same way as DataBar Omnidirectional above. DataBar Limited,
+however, is limited to data starting with digits 0 and 1 (i.e. numbers in the
+range 0 to 1999999999999). As with DataBar Omnidirectional a check digit and
+Application Identifier of (01) are added by Zint, and a 14 digit code may be
+given in which case the check digit will be verified.
+
+#### 6.1.11.3 GS1 DataBar Expanded
+
+![`zint -b DBAR_EXP --compliantheight -d
+"[01]98898765432106[3202]012345[15]991231"`](images/dbar_exp.svg)
+
+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. This will be converted to parentheses
+(round brackets) before it is 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 `--gs1parens` switch. See [6.1.10.3
+GS1-128].
+
+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 DataBar Expanded input:
+
+```bash
+zint -b 31 -d "[01]98898765432106[3202]012345[15]991231"
+```
+
+### 6.1.12 Korea Post Barcode
+
+![`zint -b KOREAPOST -d "923457"`](images/koreapost.svg)
+
+The Korean Postal Barcode is used to encode a six-digit number and includes one
+check digit.
+
+### 6.1.13 Channel Code
+
+![`zint -b CHANNEL -d "453678" --compliantheight`](images/channel.svg)
+
+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 `--vers` option (API `option_2`). 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.
+
+The maximum values permitted depend on the number of channels used as shown in
+the table below:
+
+| Channels | Minimum Value | Maximum Value
+|:---------|:--------------|:-------------
+| 3 | 00 | 26
+| 4 | 000 | 292
+| 5 | 0000 | 3493
+| 6 | 00000 | 44072
+| 7 | 000000 | 576688
+| 8 | 0000000 | 7742862
+
+Table: {#tbl:channel_maxima tag=": Channel Maximum Values"}
+
+\clearpage
+
+## 6.2 Stacked Symbologies
+
+### 6.2.1 Basic Symbol Stacking
+
+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
+
+```bash
+zint -d "This" -d "That"
+```
+
+will draw two Code 128 symbols, one on top of the other. The same result can be
+achieved using the API by executing the `ZBarcode_Encode()` function more than
+once on a symbol. For example:
+
+```c
+my_symbol->symbology = BARCODE_CODE128;
+
+error = ZBarcode_Encode(my_symbol, "This", 0);
+
+error = ZBarcode_Encode(my_symbol, "That", 0);
+
+error = ZBarcode_Print(my_symbol);
+```
+
+![`zint -d "This" -d "That"`](images/code128_stacked.svg)
+
+Note that the Human Readable Text will be that of the last data, so it's best to
+use the option `--notext` (API `show_hrt = 0`).
+
+The stacked barcode rows can be separated by row separator bars by specifying
+`--bind` (API `output_options |= BARCODE_BIND`). The height of the row separator
+bars in multiples of the X-dimension (minimum and default 1, maximum 4) can be
+set by `--separator` (API `option_3`):
+
+```bash
+zint --bind --notext --separator=2 -d "This" -d "That"
+```
+
+![`zint --notext --bind --separator=2 -d "This" -d
+"That"`](images/code128_stacked_sep2.svg)
+
+A more sophisticated method is to use some type of line indexing which indicates
+to the barcode reader which order the symbols should be read. This is
+demonstrated by the symbologies below.
+
+### 6.2.2 Codablock-F
+
+![`zint -b CODABLOCKF -d "CODABLOCK F Symbology"
+--rows=3`](images/codablockf.svg)
+
+This is a stacked symbology based on Code 128 which can encode extended ASCII
+code set data up to a maximum length of 2725 characters. The width of the
+Codablock-F symbol can be set using the `--cols` option (API `option_2`). The
+height (number of rows) can be set using the `--rows` option (API `option_1`).
+Zint does not currently support encoding of GS1 data in Codablock-F symbols.
+
+A separate symbology ID (`BARCODE_HIBC_BLOCKF`) can be used to encode Health
+Industry Barcode (HIBC) data which adds a leading `'+'` character and a
+modulo-49 check digit to the encoded data.
+
+### 6.2.3 Code 16K (EN 12323)
+
+![`zint -b CODE16K --compliantheight -d "ab0123456789"`](images/code16k.svg)
+
+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 extended ASCII
+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 `--rows`
+option (API `option_1`), with values from 2 to 16.
+
+### 6.2.4 PDF417 (ISO 15438)
+
+![`zint -b PDF417 -d "PDF417"`](images/pdf417.svg)
+
+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.
+
+The width of the generated PDF417 symbol can be specified at the command line
+using the `--cols` switch (API `option_2`) followed by a number between 1 and
+30, the number of rows using the `--rows` switch (API `option_3`) followed by a
+number between 3 and 90, and the amount of error correction information can be
+specified by using the `--secure` switch (API `option_1`) followed by a number
+between 0 and 8 where the number of codewords used for error correction is
+determined by `2^(value + 1)`. The default level of error correction is
+determined by the amount of data being encoded.
+
+This symbology uses Latin-1 character encoding by default but also supports the
+ECI encoding mechanism. A separate symbology ID (`BARCODE_HIBC_PDF`) can be used
+to encode Health Industry Barcode (HIBC) data.
+
+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 `--structapp`
+option (see [4.16 Structured Append]) (API `structapp`). The ID consists of up
+to 10 triplets, each ranging from `"000"` to `"899"`. For instance `"123456789"`
+would be a valid ID of 3 triplets. However `"123456900"` would not, as the last
+triplet `"900"` exceeds `"899"`. The triplets are 0-filled, for instance
+`"1234"` becomes `"123004"`. If an ID is not given, no ID is encoded.
+
+### 6.2.5 Compact PDF417 (ISO 15438)
+
+![`zint -b PDF417COMP -d "PDF417"`](images/pdf417comp.svg)
+
+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.
+
+### 6.2.6 MicroPDF417 (ISO 24728)
+
+![`zint -b MICROPDF417 -d "12345678"`](images/micropdf417.svg)
+
+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 size 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 `--cols` switch (API `option_2`) as with PDF417.
+
+This symbology uses Latin-1 character encoding by default but also supports the
+ECI encoding mechanism. A separate symbology ID (`BARCODE_HIBC_MICPDF`) can be
+used to encode Health Industry Barcode (HIBC) data. MicroPDF417 supports
+Structured Append the same as PDF417, for which see details.
+
+### 6.2.7 GS1 DataBar Stacked (ISO 24724)
+
+#### 6.2.7.1 GS1 DataBar Stacked
+
+![`zint -b DBAR_STK --compliantheight -d "9889876543210"`](images/dbar_stk.svg)
+
+A stacked variation of the GS1 DataBar Truncated symbol requiring the same input
+(see [6.1.11.1 GS1 DataBar Omnidirectional and GS1 DataBar Truncated]), this
+symbol is the same as the following DataBar Stacked Omnidirectional symbol
+except that its height is reduced, 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.
+
+#### 6.2.7.2 GS1 DataBar Stacked Omnidirectional
+
+![`zint -b DBAR_OMNSTK --compliantheight -d
+"9889876543210"`](images/dbar_omnstk.svg)
+
+A stacked variation of the GS1 DataBar Omnidirectional symbol requiring the same
+input (see [6.1.11.1 GS1 DataBar Omnidirectional and GS1 DataBar Truncated]).
+The data is encoded in two rows of bars with a central finder pattern. This
+symbol can be generated with a two-dimensional component to make a composite
+symbol.
+
+#### 6.2.7.3 GS1 DataBar Expanded Stacked
+
+![`zint -b DBAR_EXPSTK --compliantheight
+-d "[01]98898765432106[3202]012345[15]991231"`](images/dbar_expstk.svg)
+
+A stacked variation of the GS1 DataBar Expanded symbol for smaller packages.
+Input is the same as for GS1 DataBar Expanded (see [6.1.11.3 GS1 DataBar
+Expanded]). In addition the width of the symbol can be altered using the
+`--cols` switch (API `option_2`). 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 `--rows` switch (API `option_3`) 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.
+
+### 6.2.8 Code 49
+
+![`zint -b CODE49 --compliantheight -d
+"MULTIPLE ROWS IN CODE 49"`](images/code49.svg)
+
+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 `--rows` option (API
+`option_1`), with values from 2 to 8.
+
+\clearpage
+
+## 6.3 Composite Symbols (ISO 24723)
+
+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 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 `-b` or
+`--barcode` switch (API `symbology`) as with other encoding methods. Valid
+values are shown below.
+
+--------------------------------------------------------------------------------
+Numeric Name Barcode Name
+Value
+------- ------------------------ ---------------------------------------------
+130 `BARCODE_EANX_CC` Composite Symbol with EAN linear component
+
+131 `BARCODE_GS1_128_CC` Composite Symbol with GS1-128 linear
+ component
+
+132 `BARCODE_DBAR_OMN_CC` Composite Symbol with GS1 DataBar
+ Omnidirectional linear component
+
+133 `BARCODE_DBAR_LTD_CC` Composite Symbol with GS1 DataBar Limited
+ linear component
+
+134 `BARCODE_DBAR_EXP_CC` Composite Symbol with GS1 DataBar Expanded
+ linear component
+
+135 `BARCODE_UPCA_CC` Composite Symbol with UPC-A linear component
+
+136 `BARCODE_UPCE_CC` Composite Symbol with UPC-E linear component
+
+137 `BARCODE_DBAR_STK_CC` Composite Symbol with GS1 DataBar Stacked
+ component
+
+138 `BARCODE_DBAR_OMNSTK_CC` Composite Symbol with GS1 DataBar Stacked
+ Omnidirectional component
+
+139 `BARCODE_DBAR_EXPSTK_CC` Composite Symbol with GS1 DataBar Expanded
+ Stacked component
+--------------------------------------------------------------------------------
+
+Table: {#tbl:composite_symbologies tag=": Composite Symbology Values"}
+
+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 `--primary` switch
+(API `primary`). For example:
+
+```bash
+zint -b EANX_CC --mode=1 --primary=331234567890 -d "[99]1234-abcd"
+```
+
+This creates an EAN-13 linear component with the data `"331234567890"` and a 2D
+CC-A (see [below][6.3.1 CC-A]) component with the data `"(99)1234-abcd"`. The
+same results can be achieved using the API as shown below:
+
+```c
+my_symbol->symbology = BARCODE_EANX_CC;
+
+my_symbol->option_1 = 1;
+
+strcpy(my_symbol->primary, "331234567890");
+
+ZBarcode_Encode_and_Print(my_symbol, "[99]1234-abcd", 0, 0);
+```
+
+EAN-2 and EAN-5 add-on data can be used with EAN and UPC symbols using the +
+symbol as described in sections [6.1.3 Universal Product Code (ISO 15420)] and
+[6.1.4 European Article Number (ISO 15420)].
+
+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 `--mode` prompt (API
+`option_1`) followed by 1, 2 or 3 for CC-A, CC-B or CC-C respectively.
+
+### 6.3.1 CC-A
+
+![`zint -b EANX_CC --compliantheight -d "[99]1234-abcd" --mode=1
+--primary=331234567890`](images/eanx_cc_a.svg)
+
+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 `--mode=1` (API `option_1 = 1`).
+
+### 6.3.2 CC-B
+
+![`zint -b EANX_CC --compliantheight -d "[99]1234-abcd" --mode=2
+--primary=331234567890`](images/eanx_cc_b.svg)
+
+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 `--mode=2` (API `option_1 = 2`).
+
+### 6.3.3 CC-C
+
+![`zint -b GS1_128_CC --compliantheight -d "[99]1234-abcd" --mode=3
+--primary="[01]03312345678903"`](images/gs1_128_cc_c.svg)
+
+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 `--mode=3` (API `option_1 = 3`).
+
+\clearpage
+
+## 6.4 Two-Track Symbols
+
+### 6.4.1 Two-Track Pharmacode
+
+![`zint -b PHARMA_TWO --compliantheight -d "29876543"`](images/pharma_two.svg)
+
+Developed by Laetus, Pharmacode Two-Track is an alternative system to
+Pharmacode One-Track (see [6.1.9 Pharmacode]) used for the identification of
+pharmaceuticals. The symbology is able to encode whole numbers between 4 and
+64570080.
+
+### 6.4.2 POSTNET
+
+![`zint -b POSTNET --compliantheight -d "12345678901"`](images/postnet.svg)
+
+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 `PostNet6` (5
+digit ZIP input), `PostNet10` (5 digit ZIP + 4 digit user data) and `PostNet12`
+(5 digit ZIP + 6 digit user data).
+
+### 6.4.3 PLANET
+
+![`zint -b PLANET --compliantheight -d "4012345235636"`](images/planet.svg)
+
+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 `Planet12` (11 digit input) and `Planet14` (13 digit
+input).
+
+\clearpage
+
+## 6.5 4-State Postal Codes
+
+### 6.5.1 Australia Post 4-State Symbols
+
+#### 6.5.1.1 Customer Barcodes
+
+![`zint -b AUSPOST --compliantheight -d "96184209"`](images/auspost.svg)
+
+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:
+
+----------------------------------------------------------
+Input Required Input Format Symbol FCC Encoding
+Length Length Table
+------ ----------------------- ------ --- --------
+8 99999999 37-bar 11 None
+
+13 99999999AAAAA 52-bar 59 C
+
+16 9999999999999999 52-bar 59 N
+
+18 99999999AAAAAAAAAA 67-bar 62 C
+
+23 99999999999999999999999 67-bar 62 N
+----------------------------------------------------------
+
+Table: {#tbl:auspost_input_formats tag=": Australia Post Input Formats"}
+
+#### 6.5.1.2 Reply Paid Barcode
+
+![`zint -b AUSREPLY --compliantheight -d "12345678"`](images/ausreply.svg)
+
+A Reply Paid version of the Australia Post 4-State Barcode (FCC 45) which
+requires an 8-digit DPID input.
+
+#### 6.5.1.3 Routing Barcode
+
+![`zint -b AUSROUTE --compliantheight -d "34567890"`](images/ausroute.svg)
+
+A Routing version of the Australia Post 4-State Barcode (FCC 87) which requires
+an 8-digit DPID input.
+
+#### 6.5.1.4 Redirect Barcode
+
+![`zint -b AUSREDIRECT --compliantheight -d "98765432"`](images/ausredirect.svg)
+
+A Redirection version of the Australia Post 4-State Barcode (FCC 92) which
+requires an 8-digit DPID input.
+
+### 6.5.2 Dutch Post KIX Code
+
+![`zint -b KIX --compliantheight -d "2500GG30250"`](images/kix.svg)
+
+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.
+
+### 6.5.3 Royal Mail 4-State Customer Code (RM4SCC)
+
+![`zint -b RM4SCC --compliantheight -d "W1J0TR01"`](images/rm4scc.svg)
+
+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 `"W1J0TR01"` for 1 Piccadilly Circus in London. Check digit data is
+generated by Zint.
+
+### 6.5.4 Royal Mail 4-State Mailmark
+
+![`zint -b MAILMARK --compliantheight -d
+"1100000000000XY11"`](images/mailmark.svg)
+
+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. Some of the permitted inputs include a number of
+trailing space characters - these will be appended by Zint if not included in
+the input data.
+
+### 6.5.5 USPS Intelligent Mail
+
+![`zint -b USPS_IMAIL --compliantheight -d
+"01234567094987654321-01234"`](images/usps_imail.svg)
+
+Also known as the OneCode barcode and used in the US 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 (`-`), 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:
+
+```
+"01234567094987654321"
+
+"01234567094987654321-01234"
+
+"01234567094987654321-012345678"
+
+"01234567094987654321-01234567891"
+```
+
+### 6.5.6 Japanese Postal Code
+
+![`zint -b JAPANPOST --compliantheight -d
+"15400233-16-4-205"`](images/japanpost.svg)
+
+Used for address data on mail items for Japan Post. Accepted values are 0-9,
+A-Z and dash (`-`). A modulo 19 check digit is added by Zint.
+
+\clearpage
+
+## 6.6 Two-Dimensional Matrix Symbols
+
+### 6.6.1 Data Matrix (ISO 16022)
+
+![`zint -b HIBC_DM -d "/ACMRN123456/V200912190833" --fast
+--square`](images/hibc_dm.svg)
+
+Also known as Semacode this symbology was developed in 1989 by Acuity CiMatrix
+in partnership with the US 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
+also be adjusted using the `--vers` option (API `option_2`) as shown in the
+table below. A separate symbology ID (`BARCODE_HIBC_DM`) can be used to encode
+Health Industry Barcode (HIBC) data. Note that only ECC200 encoding is
+supported, the older standards have now been removed from Zint.
+
+Input Symbol Size Input Symbol Size Input Symbol Size
+----- ----------- -- ----- ----------- -- ----- -----------
+1 10 x 10 11 36 x 36 21 104 x 104
+2 12 x 12 12 40 x 40 22 120 x 120
+3 14 x 14 13 44 x 44 23 132 x 132
+4 16 x 16 14 48 x 48 24 144 x 144
+5 18 x 18 15 52 x 52 25 8 x 18
+6 20 x 20 16 64 x 64 26 8 x 32
+7 22 x 22 17 72 x 72 28 12 x 26
+8 24 x 24 18 80 x 80 28 12 x 36
+9 26 x 26 19 88 x 88 29 16 x 36
+10 32 x 32 20 96 x 96 30 16 x 48
+
+Table: {#tbl:datamatrix_sizes tag=": Data Matrix Sizes"}
+
+When using automatic symbol sizes you can force Zint to use square symbols
+(versions 1-24) at the command line by using the option `--square` (API
+`option_3 = DM_SQUARE`).
+
+Data Matrix Rectangular Extension (ISO/IEC 21471) codes may be generated with
+the following values as before:
+
+Input Symbol Size Input Symbol Size
+----- ----------- -- ----- -----------
+31 8 x 48 40 20 x 36
+32 8 x 64 41 20 x 44
+33 8 x 80 42 20 x 64
+34 8 x 96 43 22 x 48
+35 8 x 120 44 24 x 48
+36 8 x 144 45 24 x 64
+37 12 x 64 46 26 x 40
+38 12 x 88 47 26 x 48
+39 16 x 64 48 26 x 64
+
+Table: {#tbl:dmre_sizes tag=": DMRE Sizes"}
+
+DMRE symbol sizes may be activated in automatic size mode using the option
+`--dmre` (API `option_3 = DM_DMRE`).
+
+GS1 data may be encoded using FNC1 (default) or GS as separator. Use the option
+`--gssep` to change to GS (API `output_options |= GS1_GS_SEPARATOR`).
+
+For a faster but less optimal encoding, the `--fast` option (API `input_mode |=
+FAST_MODE`) may be used.
+
+Data Matrix supports Structured Append of up to 16 symbols and a numeric ID
+(file identifications), which can be set by using the `--structapp` option (see
+[4.16 Structured Append]) (API `structapp`). The ID consists of 2 numbers `ID1`
+and `ID2`, each of which can range from 1 to 254, and is specified as the single
+number `ID1 * 1000 + ID2`, so for instance `ID1` `"123"` and `ID2` `"234"` would
+be given as `"123234"`. Note that both `ID1` and `ID2` must be non-zero, so e.g.
+`"123000"` or `"000123"` would be invalid IDs. If an ID is not given it defaults
+to `"001001"`.
+
+### 6.6.2 QR Code (ISO 18004)
+
+![`zint -b QRCODE -d "QR Code Symbol" --mask=5`](images/qrcode.svg)
+
+Also known as Quick Response Code this symbology was developed by Denso. Four
+levels of error correction are available using the `--secure` option (API
+`option_1`) as shown in the following table.
+
+Input ECC Level Error Correction Capacity Recovery Capacity
+----- --------- ------------------------- -----------------
+1 L Approx 20% of symbol Approx 7%
+2 M Approx 37% of symbol Approx 15%
+3 Q Approx 55% of symbol Approx 25%
+4 H Approx 65% of symbol Approx 30%
+
+Table: {#tbl:qrcode_eccs tag=": QR Code ECC Levels"}
+
+The size of the symbol can be specified by setting the `--vers` option (API
+`option_2`) to the QR Code version required (1-40). The size of symbol generated
+is shown in the table below.
+
+Input Symbol Size Input Symbol Size Input Symbol Size
+----- ----------- -- ----- ----------- -- ----- -----------
+1 21 x 21 15 77 x 77 29 133 x 133
+2 25 x 25 16 81 x 81 30 137 x 137
+3 29 x 29 17 85 x 85 31 141 x 141
+4 33 x 33 18 89 x 89 32 145 x 145
+5 37 x 37 19 93 x 93 33 149 x 149
+6 41 x 41 20 97 x 97 34 153 x 153
+7 45 x 45 21 101 x 101 35 157 x 157
+8 49 x 49 22 105 x 105 36 161 x 161
+9 53 x 53 23 109 x 109 37 165 x 165
+10 57 x 57 24 113 x 113 38 169 x 169
+11 61 x 61 25 117 x 117 39 173 x 173
+12 65 x 65 26 121 x 121 40 177 x 177
+13 69 x 69 27 125 x 125
+14 73 x 73 28 129 x 129
+
+Table: {#tbl:qrcode_sizes tag=": QR Code Sizes"}
+
+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 (`BARCODE_HIBC_QR`) can be used to encode Health Industry Barcode
+(HIBC) data.
+
+Non-ASCII data density may be maximized by using the `--fullmultibyte` switch
+(API `option_3 = ZINT_FULL_MULTIBYTE`), but check that your barcode reader
+supports this before using.
+
+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 `--mask` switch with values 0-7, or in the API by setting
+`option_3 = (N + 1) << 8` where N is 0-7. To use with `ZINT_FULL_MULTIBYTE` set
+```c
+option_3 = ZINT_FULL_MULTIBYTE | (N + 1) << 8
+```
+
+QR Code supports Structured Append of up to 16 symbols and a numeric ID
+(parity), which can be set by using the `--structapp` option (see [4.16
+Structured Append]) (API `structapp`). The parity ID ranges from 0 (default) to
+255, and for full compliance should be set to the value obtained by `XOR`-ing
+together each byte of the complete data forming the sequence. Currently this
+calculation must be done outside of Zint.
+
+### 6.6.3 Micro QR Code (ISO 18004)
+
+![`zint -b MICROQR -d "01234567"`](images/microqr.svg)
+
+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 `--vers` option (API `option_2`), as shown in the table below. Note
+that versions M1 and M2 have restrictions on what characters can be encoded.
+
+------------------------------------------------------------------
+Input Version Symbol Size Allowed Characters
+----- ------- ----------- ----------------------------------
+1 M1 11 x 11 Numeric only
+
+2 M2 13 x 13 Numeric, uppercase letters, space,
+ and the characters `"$%*+-./:"`
+
+3 M3 15 x 15 Latin-1 and Shift JIS
+
+4 M4 17 x 17 Latin-1 and Shift JIS
+------------------------------------------------------------------
+
+Table: {#tbl:micrqr_sizes tag=": Micro QR Code Sizes"}
+
+Except for version M1, which is always ECC level L, the amount of ECC codewords
+can be adjusted using the `--secure` option (API `option_1`); however ECC level
+H is not available for any version, and ECC level Q is only available for
+version M4:
+
+----------------------------------------------------------------------
+Input ECC Error Correction Recovery Available for
+ Level Capacity Capacity Versions
+----- ----- -------------------- ---------- --------------
+1 L Approx 20% of symbol Approx 7% M1, M2, M3, M4
+
+2 M Approx 37% of symbol Approx 15% M2, M3, M4
+
+3 Q Approx 55% of symbol Approx 25% M4
+----------------------------------------------------------------------
+
+The defaults for symbol size and ECC level depend on the input and whether
+either of them is specified.
+
+For barcode readers that support it, non-ASCII data density may be maximized by
+using the `--fullmultibyte` switch (API `option_3 = ZINT_FULL_MULTIBYTE`).
+
+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 `--mask` switch with values 0-3, or in the API by setting
+`option_3 = (N + 1) << 8` where N is 0-3. To use with `ZINT_FULL_MULTIBYTE` set
+```c
+option_3 = ZINT_FULL_MULTIBYTE | (N + 1) << 8
+```
+
+### 6.6.4 Rectangular Micro QR Code (rMQR)
+
+![`zint -b RMQR -d "0123456"`](images/rmqr.svg)
+
+A rectangular version of QR Code, it is still under development, so it is
+recommended it should not yet be used for a production environment. Like 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 `--secure` option
+(API `option_1`), however only ECC levels M and H are valid for this type of
+symbol.
+
+Input ECC Level Error Correction Capacity Recovery Capacity
+----- --------- ------------------------- -----------------
+2 M Approx 37% of symbol Approx 15%
+4 H Approx 65% of symbol Approx 30%
+
+Table: {#tbl:rmqr_eccs tag=": rMQR ECC Levels"}
+
+The preferred symbol sizes can be selected using the `--vers` option (API
+`option_2`) 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.
+
+Input Version Symbol Size (HxW) Input Version Symbol Size (HxW)
+----- ------- ----------------- -- ----- ------- --------------------
+1 R7x43 7 x 73 20 R13x77 13 x 77
+2 R7x59 7 x 59 21 R13x99 13 x 99
+3 R7x77 7 x 77 22 R13x139 13 x 139
+4 R7x99 7 x 99 23 R15x43 15 x 43
+5 R7x139 7 x 139 24 R15x59 15 x 59
+6 R9x43 9 x 43 25 R15x77 15 x 77
+7 R9x59 9 x 59 26 R15x99 15 x 99
+8 R9x77 9 x 77 27 R15x139 15 x 139
+9 R9x99 9 x 99 28 R17x43 17 x 43
+10 R9x139 9 x 139 29 R17x59 17 x 59
+11 R11x27 11 x 27 30 R17x77 17 x 77
+12 R11x43 11 x 43 31 R17x99 17 x 99
+13 R11x59 11 x 59 32 R17x139 17 x 139
+14 R11x77 11 x 77 33 R7xW 7 x automatic width
+15 R11x99 11 x 99 34 R9xW 9 x automatic width
+16 R11x139 11 x 139 35 R11xW 11 x automatic width
+17 R13x27 13 x 27 36 R13xW 13 x automatic width
+18 R13x43 13 x 43 37 R15xW 15 x automatic width
+19 R13x59 13 x 59 38 R17xW 17 x automatic width
+
+Table: {#tbl:rmqr_sizes tag=": rMQR Sizes"}
+
+For barcode readers that support it, non-ASCII data density may be maximized by
+using the `--fullmultibyte` switch or in the API by setting
+`option_3 = ZINT_FULL_MULTIBYTE`.
+
+### 6.6.5 UPNQR (Univerzalnega Plačilnega Naloga QR)
+
+![`zint -b UPNQR -i upn_utf8.txt --quietzones`](images/upnqr.svg)
+
+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 `--binary` switch
+(API `input_mode = DATA MODE`).
+
+The following example creates a symbol from data saved as a Latin-2 file:
+
+```bash
+zint -o upnqr.png -b 143 --scale=3 --binary -i upn.txt
+```
+
+### 6.6.6 MaxiCode (ISO 16023)
+
+![`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`](images/maxicode.svg)
+
+Developed by UPS the MaxiCode symbology employs a grid of hexagons surrounding
+a bulls-eye 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:
+
+Characters Meaning
+---------- ---------------------------------------------------------------
+1 - 9 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 can be filled with the SPACE character
+ (ASCII 32) or omitted (if omitted adjust the following
+ character positions).
+10 - 12 Three digit country code according to ISO 3166-1.
+13 - 15 Three digit service code. This depends on your parcel courier.
+
+Table: {#tbl:maxicode_scm tag=": MaxiCode Structured Carrier Message Format"}
+
+The primary message can be set at the command prompt using the `--primary`
+switch (API `primary`). The secondary message uses the normal data entry method.
+For example:
+
+```bash
+zint -o test.eps -b 57 --primary="999999999840012" \
+ -d "Secondary Message Here"
+```
+
+When using the API the primary message must be placed in the `primary` string.
+The secondary is entered in the same way as described in [5.2 Encoding and
+Saving to File]. When either of these modes is selected Zint will analyse the
+primary message and select either mode 2 or mode 3 as appropriate.
+
+As a convenience the secondary message for modes 2 and 3 can be set to be
+prefixed by the ISO/IEC 15434 Format `"01"` (transportation) sequence
+`"[)>\R01\Gvv"`, where `vv` is a 2-digit version, by using the `--scmvv` switch
+(API `option_2 = vv + 1`). For example to use the common version `"96"` (ASC
+MH10/SC 8):
+
+```bash
+zint -b 57 --primary="152382802840001" --scmvv=96 --esc -d \
+ "1Z00004951\GUPSN\G06X610\G159\G1234567\G1/1\G\GY\G1 MAIN ST\GNY\GNY\R\E"
+```
+
+will prefix `"[)>\R01\G96"` to the secondary message. (`\R`, `\G` and `\E` are
+the escape sequences for Record Separator, Group Separator and End of
+Transmission respectively - see Table {@tbl:escape_sequences}.)
+
+Modes 4 to 6 can be accessed using the `--mode` switch (API `option_1`). Modes 4
+to 6 do not have a primary message. For example:
+
+```bash
+zint -o test.eps -b 57 --mode=4 -d "A MaxiCode Message in Mode 4"
+```
+
+Mode 6 is reserved for the maintenance of scanner hardware and should not be
+used to encode user data.
+
+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.
+
+Example maximum data lengths are given in the table below:
+
+-----------------------------------------------------------------------
+Mode Maximum Data Length Maximum Data Length Number of Error
+ for Capital Letters for Numeric Digits Correction Codewords
+---- ------------------- ------------------- --------------------
+2`*` 84 126 50
+
+3`*` 84 126 50
+
+4 93 138 50
+
+5 77 113 66
+
+6 93 138 50
+-----------------------------------------------------------------------
+
+Table: {#tbl:maxicode_data_length_maxima tag=": MaxiCode Data Length Maxima"}
+
+`*` - secondary only
+
+MaxiCode supports Structured Append of up to 8 symbols, which can be set by
+using the `--structapp` option (see [4.16 Structured Append]) (API `structapp`).
+It does not support specifying an ID.
+
+MaxiCode uses a different scaling than other symbols for raster output, see
+[4.9.2 MaxiCode Raster Scaling], and also for EMF vector output, when the scale
+is multiplied by 20 instead of 2.
+
+### 6.6.7 Aztec Code (ISO 24778)
+
+![`zint -b AZTEC -d "123456789012"`](images/aztec.svg)
+
+Invented by Andrew Longacre at Welch Allyn Inc in 1995 the Aztec Code symbol is
+a matrix symbol with a distinctive bulls-eye 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:
+
+The size of the symbol can be specified using the `--vers` option (API
+`option_2`) to a value between 1 and 36 according to the following table. The
+symbols marked with an asterisk (`*`) in the table below are 'compact' symbols,
+meaning they have a smaller bulls-eye pattern at the centre of the symbol.
+
+Input Symbol Size Input Symbol Size Input Symbol Size
+----- ----------- -- ----- ----------- -- ----- -----------
+1 15 x 15`*` 13 53 x 53 25 105 x 105
+2 19 x 19`*` 14 57 x 57 26 109 x 109
+3 23 x 23`*` 15 61 x 61 27 113 x 113
+4 27 x 27`*` 16 67 x 67 28 117 x 117
+5 19 x 19 17 71 x 71 29 121 x 121
+6 23 x 23 18 75 x 75 30 125 x 125
+7 27 x 27 19 79 x 79 31 131 x 131
+8 31 x 31 20 83 x 83 32 135 x 135
+9 37 x 37 21 87 x 87 33 139 x 139
+10 41 x 41 22 91 x 91 34 143 x 143
+11 45 x 45 23 95 x 95 35 147 x 147
+12 49 x 49 24 101 x 101 36 151 x 151
+
+Table: {#tbl:aztec_sizes tag=": Aztec Code Sizes"}
+
+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.
+
+Alternatively the amount of error correction data can be specified by setting
+the `--secure` option (API `option_1`) to a value from the following table:
+
+Mode Error Correction Capacity
+---- -------------------------
+1 >10% + 3 codewords
+2 >23% + 3 codewords
+3 >36% + 3 codewords
+4 >50% + 3 codewords
+
+Table: {#tbl:aztec_eccs tag=": Aztec Code Error Correction Modes"}
+
+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.
+
+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 (`BARCODE_HIBC_AZTEC`) can be used to encode Health
+Industry Barcode (HIBC) data.
+
+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
+`--structapp` option (see [4.16 Structured Append]) (API `structapp`). The ID
+cannot contain spaces. If an ID is not given, no ID is encoded.
+
+### 6.6.8 Aztec Runes (ISO 24778)
+
+![`zint -b AZRUNE -d "125"`](images/azrune.svg)
+
+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.
+
+### 6.6.9 Code One
+
+![`zint -b CODEONE -d "1234567890123456789012"`](images/codeone.svg)
+
+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 (version S and T). These can be
+selected by using `--vers` (API `option_2`) as shown in the table below:
+
+------------------------------------------------------------
+Input Version Size Numeric Alphanumeric
+ (W x H) Data Capacity Data Capacity
+----- ------- ---------- ------------- -------------
+1 A 16 x 18 22 13
+
+2 B 22 x 22 44 27
+
+3 C 28 x 28 104 64
+
+4 D 40 x 42 217 135
+
+5 E 52 x 54 435 271
+
+6 F 70 x 76 886 553
+
+7 G 104 x 98 1755 1096
+
+8 H 148 x 134 3550 2218
+
+9 S width x 8 18 N/A
+
+10 T width x 16 90 55
+------------------------------------------------------------
+
+Table: {#tbl:codeone_sizes tag=": Code One Sizes"}
+
+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.
+
+Code One supports Structured Append of up to 128 symbols, which can be set by
+using the `--structapp` option (see [4.16 Structured Append]) (API `structapp`).
+It does not support specifying an ID. Structured Append is not supported with
+GS1 data nor for Version S symbols.
+
+### 6.6.10 Grid Matrix
+
+![`zint -b GRIDMATRIX --eci=29 -d "AAT2556 电池充电器+降压转换器
+ 200mA至2A tel:86 019 82512738"`](images/gridmatrix.svg)
+
+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. The symbology also supports the
+ECI mechanism. Support for GS1 data has not yet been implemented.
+
+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 `--vers`
+option (API `option_2`), and the error correction capacity can be specified by
+using the `--secure` option (API `option_1`), according to the following tables:
+
+Input Symbol Size Input Symbol Size
+----- ----------- - ----- -----------
+1 18 x 18 8 102 x 102
+2 30 x 30 9 114 x 114
+3 42 x 42 10 126 x 126
+4 54 x 54 11 138 x 138
+5 66 x 66 12 150 x 150
+6 78 x 78 13 162 x 162
+7 90 x 90
+
+Table: {#tbl:gridmatrix_sizes tag=": Grid Matrix Sizes"}
+
+Mode Error Correction Capacity
+---- -------------------------
+1 Approximately 10%
+2 Approximately 20%
+3 Approximately 30%
+4 Approximately 40%
+5 Approximately 50%
+
+Table: {#tbl:gridmatrix_eccs tag=": Grid Matrix Error Correction Modes"}
+
+Non-ASCII data density may be maximized by using the `--fullmultibyte` switch
+(API `option_3 = ZINT_FULL_MULTIBYTE`), but check that your barcode reader
+supports this before using.
+
+Grid Matrix supports Structured Append of up to 16 symbols and a numeric ID
+(file signature), which can be set by using the `--structapp` option (see [4.16
+Structured Append]) (API `structapp`). The ID ranges from 0 (default) to 255.
+
+### 6.6.11 DotCode
+
+![`zint -b DOTCODE -d "[01]00012345678905[17]201231[10]ABC123456"
+--gs1`](images/dotcode.svg)
+
+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 `--cols` option (API `option_2`) (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.
+
+DotCode has two sets of 4 masks, designated 0-3 and 0'-3', the second `"prime"`
+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
+`--mask` switch with values 0-7, where 4-7 denote 0'-3', or in the API by
+setting `option_3 = (N + 1) << 8` where N is 0-7.
+
+DotCode supports Structured Append of up to 35 symbols, which can be set by
+using the `--structapp` option (see [4.16 Structured Append]) (API `structapp`).
+It does not support specifying an ID.
+
+### 6.6.12 Han Xin Code (ISO 20830)
+
+![`zint -b HANXIN -d "Hanxin Code symbol"`](images/hanxin.svg)
+
+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.
+
+The size of the symbol can be specified using the `--vers` option (API
+`option_2`) to a value between 1 and 84 according to the following table.
+
+Input Symbol Size Input Symbol Size Input Symbol Size
+----- ----------- -- ----- ----------- -- ----- -----------
+1 23 x 23 29 79 x 79 57 135 x 135
+2 25 x 25 30 81 x 81 58 137 x 137
+3 27 x 27 31 83 x 83 59 139 x 139
+4 29 x 29 32 85 x 85 60 141 x 141
+5 31 x 31 33 87 x 87 61 143 x 143
+6 33 x 33 34 89 x 89 62 145 x 145
+7 35 x 35 35 91 x 91 63 147 x 147
+8 37 x 37 36 93 x 93 64 149 x 149
+9 39 x 39 37 95 x 95 65 151 x 151
+10 41 x 41 38 97 x 97 66 153 x 153
+11 43 x 43 39 99 x 99 67 155 x 155
+12 45 x 45 40 101 x 101 68 157 x 157
+13 47 x 47 41 103 x 103 69 159 x 159
+14 49 x 49 42 105 x 105 70 161 x 161
+15 51 x 51 43 107 x 107 71 163 x 163
+16 53 x 53 44 109 x 109 72 165 x 165
+17 55 x 55 45 111 x 111 73 167 x 167
+18 57 x 57 46 113 x 113 74 169 x 169
+19 59 x 59 47 115 x 115 75 171 x 171
+20 61 x 61 48 117 x 117 76 173 x 173
+21 63 x 63 49 119 x 119 77 175 x 175
+22 65 x 65 50 121 x 121 78 177 x 177
+23 67 x 67 51 123 x 123 79 179 x 179
+24 69 x 69 52 125 x 125 80 181 x 181
+25 71 x 71 53 127 x 127 81 183 x 183
+26 73 x 73 54 129 x 129 82 185 x 185
+27 75 x 75 55 131 x 131 83 187 x 187
+28 77 x 77 56 133 x 133 84 189 x 189
+
+Table: {#tbl:hanxin_sizes tag=": Han Xin Sizes"}
+
+There are four levels of error correction capacity available for Han Xin Code
+which can be set by using the `--secure` option (API `option_1`) to a value from
+the following table:
+
+Mode Recovery Capacity
+---- -----------------
+1 Approx 8%
+2 Approx 15%
+3 Approx 23%
+4 Approx 30%
+
+Table: {#tbl:hanxin_eccs tag=": Han Xin Error Correction Modes"}
+
+Non-ASCII data density may be maximized by using the `--fullmultibyte` switch
+(API `option_3 = ZINT_FULL_MULTIBYTE`), but check that your barcode reader
+supports this before using.
+
+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 `--mask` switch with values 0-3, or in the API by setting
+`option_3 = (N + 1) << 8` where N is 0-3. To use with `ZINT_FULL_MULTIBYTE` set
+```c
+option_3 = ZINT_FULL_MULTIBYTE | (N + 1) << 8
+```
+
+### 6.6.13 Ultracode
+
+![`zint -b ULTRA -d "HEIMASÍÐA KENNARAHÁSKÓLA ÍSLANDS"`](images/ultra.svg)
+
+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
+`--secure` option (API `option_1`) to a value as shown in the following table:
+
+Value EC Level Amount of symbol holding error correction data
+----- -------- ----------------------------------------------
+1 EC0 0% - Error detection only
+2 EC1 Approx 5%
+3 EC2 Approx 9% - Default value
+4 EC3 Approx 17%
+5 EC4 Approx 25%
+6 EC5 Approx 33%
+
+Table: {#tbl:ultra_eccs tag=": Ultracode Error Correction Values"}
+
+Zint does not currently implement data compression by default, but this can
+be initiated through the API by setting
+
+```c
+symbol->option_3 = ULTRA_COMPRESSION;
+```
+
+WARNING: Ultracode data compression is experimental and should not be used
+in a production environment.
+
+Revision 2 of Ultracode (2021) which swops and inverts the DCCU and DCCL tiles
+may be specified using `--vers=2` (API `option_2 = 2`).
+
+Ultracode supports Structured Append of up to 8 symbols and an optional numeric
+ID (File Number), which can be set by using the `--structapp` option (see
+[4.16 Structured Append]) (API `structapp`). The ID ranges from 1 to 80088. If
+an ID is not given, no ID is encoded.
+
+\clearpage
+
+## 6.7 Other Barcode-Like Markings
+
+### 6.7.1 Facing Identification Mark (FIM)
+
+![`zint -b FIM --compliantheight -d "C"`](images/fim.svg)
+
+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.
+
+Code Letter Usage
+----------- --------------------------------------------------------------
+A Used for courtesy reply mail and metered reply mail with a
+ pre-printed POSTNET symbol.
+B Used for business reply mail without a pre-printed zip code.
+C Used for business reply mail with a pre-printed zip code.
+D Used for Information Based Indicia (IBI) postage.
+E Used for customized mail with a USPS Intelligent Mail barcode.
+
+Table: {#tbl:fim_characters tag=": Valid FIM Characters"}
+
+### 6.7.2 Flattermarken
+
+![`zint -b FLAT -d "1304056"`](images/flat.svg)
+
+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 90 digits and does not include a check digit.
+
+### 6.7.3 DAFT Code
+
+![`zint -b DAFT -d "AAFDTTDAFADTFTTFFFDATFTADTTFFTDAFAFDTF" --height=8.494
+--vers=256`](images/daft_rm4scc.svg)
+
+
+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 `'D'`, `'A'`,
+`'F'` and `'T'` 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 `--vers` option (API `option_2`). The
+default value is 250 (25%).
+
+For example the following
+
+```bash
+zint -b DAFT -d AAFDTTDAFADTFTTFFFDATFTADTTFFTDAFAFDTF --height=8.494 --vers=256
+```
+
+produces the same barcode (see [6.5.3 Royal Mail 4-State Customer Code
+(RM4SCC)]) as
+
+```bash
+zint -b RM4SCC --compliantheight -d "W1J0TR01"
+```
+
+
+# 7. Legal and Version Information
+
+## 7.1 License
+
+Zint, libzint and Zint Barcode Studio are Copyright © 2022 Robin Stuart. All
+historical versions are distributed under the GNU General Public License
+version 3 or later. Version 2.5 (and later) is released under a dual license:
+the encoding library is released under the BSD license whereas the GUI, Zint
+Barcode Studio, is released under the GNU General Public License version 3 or
+later.
+
+Telepen is a trademark of SB Electronic Systems Ltd.
+
+QR Code is a registered trademark of Denso Wave Incorporated.
+
+Microsoft, Windows and the Windows logo are either registered trademarks or
+trademarks of Microsoft Corporation in the United States and/or other countries.
+
+Linux is the registered trademark of Linus Torvalds in the U.S. and other
+countries.
+
+Mac and macOS are trademarks of Apple Inc., registered in the U.S. and other
+countries.
+
+Zint.org.uk website design and hosting provided by Robert Elliott.
+
+## 7.2 Patent Issues
+
+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.
+
+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.
+
+## 7.3 Version Information
+
+The current stable version of Zint is 2.10.0, released on 14th August 2021.
+
+See `"ChangeLog"` in the project root directory for information on all releases.
+
+## 7.4 Sources of Information
+
+Below is a list of some of the sources used in rough chronological order:
+
+- Nick Johnson's Barcode Specifications
+- Bar Code 1 Specification Source Page
+- SB Electronic Systems Telepen website
+- Pharmacode specifications from Laetus
+- Morovia RM4SCC specification
+- Australia Post's 'A Guide to Printing the 4-State Barcode' and bcsample source
+ code
+- Plessey algorithm from GNU-Barcode v0.98 by Leonid A. Broukhis
+- GS1 General Specifications v 8.0 Issue 2
+- PNG: The Definitive Guide and wpng source code by Greg Reolofs
+- PDF417 specification and pdf417 source code by Grand Zebu
+- Barcode Reference, TBarCode/X User Documentation and TBarCode/X demonstration
+ program from Tec-It
+- IEC16022 source code by Stefan Schmidt et al
+- United States Postal Service Specification USPS-B-3200
+- Adobe Systems Incorporated Encapsulated PostScript File Format Specification
+- BSI Online Library
+- Libdmtx Data Matrix ECC200 decoding library
+
+## 7.5 Standards Compliance
+
+Zint was developed to provide compliance with the following British and
+international standards:
+
+- BS EN 798:1996 Bar coding - Symbology specifications - 'Codabar'
+- BS EN 12323:2005 AIDC technologies - Symbology specifications - Code 16K
+- ISO/IEC 15420:2009 Information technology - Automatic identification and data
+ capture techniques - EAN/UPC bar code symbology specification
+- ISO/IEC 15417:2007 Information technology - Automatic identification and data
+ capture techniques - Code 128 bar code symbology specification
+- ISO/IEC 15438:2015 Information technology - Automatic identification and data
+ capture techniques - PDF417 bar code symbology specification
+- ISO/IEC 16022:2006 Information technology - Automatic identification and data
+ capture techniques - Data Matrix ECC200 bar code symbology specification
+- ISO/IEC 16023:2000 Information technology - International symbology
+ specification - MaxiCode
+- ISO/IEC 16388:2007 Information technology - Automatic identification and data
+ capture techniques - Code 39 bar code symbology specification
+- ISO/IEC 18004:2015 Information technology - Automatic identification and data
+ capture techniques - QR Code bar code symbology specification
+- ISO/IEC 20830:2021 Information technology - Automatic identification and data
+ capture techniques - Han Xin Code bar code symbology specification
+- ISO/IEC 24723:2010 Information technology - Automatic identification and data
+ capture techniques - GS1 Composite bar code symbology specification
+- ISO/IEC 24724:2011 Information technology - Automatic identification and data
+ capture techniques - GS1 DataBar bar code symbology specification
+- ISO/IEC 24728:2006 Information technology - Automatic identification and data
+ capture techniques - MicroPDF417 bar code symbology specification
+- ISO/IEC 24778:2008 Information technology - Automatic identification and data
+ capture techniques - Aztec Code bar code symbology specification
+- ISO/IEC JTC1/SC31N000 (Draft 2019-6-24) Information technology - Automatic
+ identification and data capture techniques - Rectangular Micro QR Code
+ (rMQR) bar code symbology specification
+- ISO/IEC 16390:2007 Information technology - Automatic identification and data
+ capture techniques - Interleaved 2 of 5 bar code symbology specification
+- ISO/IEC 21471:2020 Information technology - Automatic identification and data
+ capture techniques - Extended rectangular data matrix (DMRE) bar code
+ symbology specification
+- Uniform Symbology Specification Code One (AIM Inc., 1994)
+- ANSI/AIM BC12-1998 - Uniform Symbology Specification Channel Code
+- ANSI/AIM BC6-2000 - Uniform Symbology Specification Code 49
+- ANSI/AIM BC5-1995 - Uniform Symbology Specification Code 93
+- ANSI/HIBC 2.6-2016 - The Health Industry Bar Code (HIBC) Supplier Labeling
+ Standard
+- AIM ISS-X-24 - Uniform Symbology Specification Codablock-F
+- 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)
+- AIMD014 (v 1.63) - Information technology, Automatic identification and data
+ capture techniques - Bar code symbology specification - Grid Matrix
+ (Released 9th Dec 2008)
+- AIMD/TSC15032-43 (v 0.99c) - International Technical Specification -
+ Ultracode Symbology (Draft) (Released 4th Nov 2015)
+- GS1 General Specifications Release 22.0 (Jan 2022)
+- AIM ITS/04-001 International Technical Standard - Extended Channel
+ Interpretations Part 1: Identification Schemes and Protocol (Released 24th
+ May 2004)
+- AIM ITS/04-023 International Technical Standard - Extended Channel
+ Interpretations Part 3: Register (Version 2, February 2022)
+
+
+# A. Character Encoding
+
+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 [A.2 Latin Alphabet
+No. 1 (ISO/IEC 8859-1)].
+
+## A.1 ASCII Standard
+
+The ubiquitous ASCII standard is well known to most computer users. It's
+reproduced here for reference.
+
+Hex 0 1 2 3 4 5 6 7
+--- ------ ------ ------ ------ ------ ------ ------ ------
+0 `NUL` `DLE` `SPACE` `0` `@` `P` `` ` `` `p`
+1 `SOH` `DC1` `!` `1` `A` `Q` `a` `q`
+2 `STX` `DC2` `"` `2` `B` `R` `b` `r`
+3 `ETX` `DC3` `#` `3` `C` `S` `c` `s`
+4 `EOT` `DC4` `$` `4` `D` `T` `d` `t`
+5 `ENQ` `NAK` `%` `5` `E` `U` `e` `u`
+6 `ACK` `SYN` `&` `6` `F` `V` `f` `v`
+7 `BEL` `ETB` `'` `7` `G` `W` `g` `w`
+8 `BS` `CAN` `(` `8` `H` `X` `h` `x`
+9 `TAB` `EM` `)` `9` `I` `Y` `i` `y`
+A `LF` `SUB` `*` `:` `J` `Z` `j` `z`
+B `VT` `ESC` `+` `;` `K` `[` `k` `{`
+C `FF` `FS` `,` `<` `L` `\` `l` `|`
+D `CR` `GS` `-` `=` `M` `]` `m` `}`
+E `SO` `RS` `.` `>` `N` `^` `n` `~`
+F `SI` `US` `/` `?` `O` `_` `o` `DEL`
+
+Table: {#tbl:ascii tag=": ASCII"}
+
+## A.2 Latin Alphabet No. 1 (ISO/IEC 8859-1)
+
+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 @tbl:default_character_sets) when a
+codepoint above hex 9F is encoded. Note that codepoints hex 80 to 9F are not
+defined.
+
+Hex 8 9 A B C D E F
+--- ------ ------ ------ ------ ------ ------ ------ ------
+0 `NBSP` `°` `À` `Ð` `à` `ð`
+1 `¡` `±` `Á` `Ñ` `á` `ñ`
+2 `¢` `²` `Â` `Ò` `â` `ò`
+3 `£` `³` `Ã` `Ó` `ã` `ó`
+4 `¤` `´` `Ä` `Ô` `ä` `ô`
+5 `¥` `μ` `Å` `Õ` `å` `õ`
+6 `¦` `¶` `Æ` `Ö` `æ` `ö`
+7 `§` `·` `Ç` `×` `ç` `÷`
+8 `¨` `¸` `È` `Ø` `è` `ø`
+9 `©` `¹` `É` `Ù` `é` `ù`
+A `ª` `º` `Ê` `Ú` `ê` `ú`
+B `«` `»` `Ë` `Û` `ë` `û`
+C `¬` `¼` `Ì` `Ü` `ì` `ü`
+D `SHY` `½` `Í` `Ý` `í` `ý`
+E `®` `¾` `Î` `Þ` `î` `þ`
+F `¯` `¿` `Ï` `ß` `ï` `ÿ`
+
+Table: {#tbl:iso_iec_8869_1 tag=": ISO/IEC 8859-1"}
+
+# B. CLI Help
+
+```
+Zint version 2.10.0.9
+Encode input data in a barcode and save as BMP/EMF/EPS/GIF/PCX/PNG/SVG/TIF/TXT
+
+ -b, --barcode=TYPE Number or name of barcode type. Default is 20 (CODE128)
+ --addongap=NUMBER Set add-on gap in multiples of X-dimension for UPC/EAN
+ --batch Treat each line of input file as a separate data set
+ --bg=COLOUR Specify a background colour (in hex RGB/RGBA)
+ --binary Treat input as raw binary data
+ --bind Add boundary bars
+ --bold Use bold text
+ --border=NUMBER Set width of border in multiples of X-dimension
+ --box Add a box around the symbol
+ --cmyk Use CMYK colour space in EPS/TIF symbols
+ --cols=NUMBER Set the number of data columns in symbol
+ --compliantheight Warn if height not compliant, and use standard default
+ -d, --data=DATA Set the symbol data content (segment 0)
+ --direct Send output to stdout
+ --dmre Allow Data Matrix Rectangular Extended
+ --dotsize=NUMBER Set radius of dots in dotty mode
+ --dotty Use dots instead of squares for matrix symbols
+ --dump Dump hexadecimal representation to stdout
+ -e, --ecinos Display ECI (Extended Channel Interpretation) table
+ --eci=NUMBER Set the ECI code for the data (segment 0)
+ --esc Process escape characters in input data
+ --fast Use faster encodation (Data Matrix)
+ --fg=COLOUR Specify a foreground colour (in hex RGB/RGBA)
+ --filetype=TYPE Set output file type BMP/EMF/EPS/GIF/PCX/PNG/SVG/TIF/TXT
+ --fullmultibyte Use multibyte for binary/Latin (QR/Han Xin/Grid Matrix)
+ --gs1 Treat input as GS1 compatible data
+ --gs1nocheck Do not check validity of GS1 data
+ --gs1parens Process parentheses "()" as GS1 AI delimiters, not "[]"
+ --gssep Use separator GS for GS1 (Data Matrix)
+ --guarddescent=NUMBER Set height of guard bar descent in X-dims (UPC/EAN)
+ -h, --help Display help message
+ --height=NUMBER Set height of symbol in multiples of X-dimension
+ --heightperrow Treat height as per-row
+ -i, --input=FILE Read input data from FILE
+ --init Create reader initialisation/programming symbol
+ --mask=NUMBER Set masking pattern to use (QR/Han Xin/DotCode)
+ --mirror Use batch data to determine filename
+ --mode=NUMBER Set encoding mode (MaxiCode/Composite)
+ --nobackground Remove background (EMF/EPS/GIF/PNG/SVG/TIF only)
+ --noquietzones Disable default quiet zones
+ --notext Remove human readable text
+ -o, --output=FILE Send output to FILE. Default is out.png
+ --primary=STRING Set primary message (MaxiCode/Composite)
+ --quietzones Add compliant quiet zones
+ -r, --reverse Reverse colours (white on black)
+ --rotate=NUMBER Rotate symbol by NUMBER degrees
+ --rows=NUMBER Set number of rows (Codablock-F/PDF417)
+ --scale=NUMBER Adjust size of X-dimension
+ --scmvv=NUMBER Prefix SCM with "[)>\R01\Gvv" (vv is NUMBER) (MaxiCode)
+ --secure=NUMBER Set error correction level (ECC)
+ --segN=ECI,DATA Set the ECI & data content for segment N, where N 1 to 9
+ --separator=NUMBER Set height of row separator bars (stacked symbologies)
+ --small Use small text
+ --square Force Data Matrix symbols to be square
+ --structapp=I,C[,ID] Set Structured Append info (I index, C count)
+ -t, --types Display table of barcode types
+ --vers=NUMBER Set symbol version (size, check digits, other options)
+ -v, --version Display Zint version
+ --vwhitesp=NUMBER Set height of vertical whitespace in multiples of X-dim
+ -w, --whitesp=NUMBER Set width of horizontal whitespace in multiples of X-dim
+ --werror Convert all warnings into errors
+```
diff --git a/docs/manual.txt b/docs/manual.txt
index 5f7b4927..848d0173 100644
--- a/docs/manual.txt
+++ b/docs/manual.txt
@@ -1,14 +1,184 @@
-*******************************************************************************
-* For reference the following is a text-only version of the Zint manual. *
-* The HTML version can be accessed at http://zint.org.uk/Manual.aspx *
+Zint Barcode Generator and Zint Barcode Studio User Manual
+Version 2.10.0.9
+May 2022
+
+*******************************************************************************
+* For reference the following is a text-only version of the Zint manual, *
+* generated from "docs/manual.pmd" by pandoc. *
+* A HTML version can be accessed at http://zint.org.uk/Manual.aspx *
* however this text file is more likely to be up-to-date. *
*******************************************************************************
-Zint Barcode Generator and Zint Barcode Studio User Manual
-==========================================================
+- 1. Introduction
+ - 1.1 Glossary
+- 2. Installing Zint
+ - 2.1 Linux
+ - 2.2 Microsoft Windows
+ - 2.3 Apple macOS
+ - 2.4 Zint Tcl Backend
+- 3. Using Zint Barcode Studio
+ - 3.1 Main Window and Data Tab
+ - 3.2 Composite Groupbox
+ - 3.3 Additional ECI/Data Segments Groupbox
+ - 3.4 Symbology-specific Tab
+ - 3.5 Appearance Tab
+ - 3.6 Colour Dialog
+ - 3.7 Data Dialog
+ - 3.8 Sequence Dialog
+ - 3.9 Export Dialog
+ - 3.10 CLI Equivalent Dialog
+- 4. Using the Command Line
+ - 4.1 Inputting Data
+ - 4.2 Directing Output
+ - 4.3 Selecting Barcode Type
+ - 4.4 Adjusting Height
+ - 4.5 Adjusting Whitespace
+ - 4.6 Adding Boundary Bars and Boxes
+ - 4.7 Using Colour
+ - 4.8 Rotating the Symbol
+ - 4.9 Adjusting Image Size
+ - 4.9.1 Scaling Example
+ - 4.9.2 MaxiCode Raster Scaling
+ - 4.10 Input Modes
+ - 4.10.1 Unicode, Data, and GS1 Modes
+ - 4.10.2 Input Modes and ECI
+ - 4.10.2.1 Input Modes and ECI Example 1
+ - 4.10.2.2 Input Modes and ECI Example 2
+ - 4.10.2.3 Input Modes and ECI Example 3
+ - 4.11 Batch Processing
+ - 4.12 Direct Output
+ - 4.13 Automatic Filenames
+ - 4.14 Working with Dots
+ - 4.15 Multiple Segments
+ - 4.16 Structured Append
+ - 4.17 Help Options
+ - 4.18 Other Output Options
+- 5. Using the API
+ - 5.1 Creating and Deleting Symbols
+ - 5.2 Encoding and Saving to File
+ - 5.3 Encoding and Printing Functions in Depth
+ - 5.4 Buffering Symbols in Memory (raster)
+ - 5.5 Buffering Symbols in Memory (vector)
+ - 5.6 Setting Options
+ - 5.7 Handling Errors
+ - 5.8 Specifying a Symbology
+ - 5.9 Adjusting Other Output Options
+ - 5.10 Setting the Input Mode
+ - 5.11 Multiple Segments
+ - 5.12 Verifying Symbology Availability
+ - 5.13 Checking Symbology Capabilities
+ - 5.14 Zint Version
+- 6. Types of Symbology
+ - 6.1 One-Dimensional Symbols
+ - 6.1.1 Code 11
+ - 6.1.2 Code 2 of 5
+ - 6.1.2.1 Standard Code 2 of 5
+ - 6.1.2.2 IATA Code 2 of 5
+ - 6.1.2.3 Industrial Code 2 of 5
+ - 6.1.2.4 Interleaved Code 2 of 5 (ISO 16390)
+ - 6.1.2.5 Code 2 of 5 Data Logic
+ - 6.1.2.6 ITF-14
+ - 6.1.2.7 Deutsche Post Leitcode
+ - 6.1.2.8 Deutsche Post Identcode
+ - 6.1.3 Universal Product Code (ISO 15420)
+ - 6.1.3.1 UPC Version A
+ - 6.1.3.2 UPC Version E
+ - 6.1.4 European Article Number (ISO 15420)
+ - 6.1.4.1 EAN-2, EAN-5, EAN-8 and EAN-13
+ - 6.1.4.2 SBN, ISBN and ISBN-13
+ - 6.1.5 Plessey
+ - 6.1.5.1 UK Plessey
+ - 6.1.5.2 MSI Plessey
+ - 6.1.6 Telepen
+ - 6.1.6.1 Telepen Alpha
+ - 6.1.6.2 Telepen Numeric
+ - 6.1.7 Code 39
+ - 6.1.7.1 Standard Code 39 (ISO 16388)
+ - 6.1.7.2 Extended Code 39
+ - 6.1.7.3 Code 93
+ - 6.1.7.4 PZN (Pharmazentralnummer)
+ - 6.1.7.5 LOGMARS
+ - 6.1.7.6 Code 32
+ - 6.1.7.7 HIBC Code 39
+ - 6.1.7.8 Vehicle Identification Number (VIN)
+ - 6.1.8 Codabar (EN 798)
+ - 6.1.9 Pharmacode
+ - 6.1.10 Code 128
+ - 6.1.10.1 Standard Code 128 (ISO 15417)
+ - 6.1.10.2 Code 128 Subset B
+ - 6.1.10.3 GS1-128
+ - 6.1.10.4 EAN-14
+ - 6.1.10.5 NVE-18 (SSCC-18)
+ - 6.1.10.6 HIBC Code 128
+ - 6.1.10.7 DPD Code
+ - 6.1.11 GS1 DataBar (ISO 24724)
+ - 6.1.11.1 GS1 DataBar Omnidirectional and GS1 DataBar Truncated
+ - 6.1.11.2 GS1 DataBar Limited
+ - 6.1.11.3 GS1 DataBar Expanded
+ - 6.1.12 Korea Post Barcode
+ - 6.1.13 Channel Code
+ - 6.2 Stacked Symbologies
+ - 6.2.1 Basic Symbol Stacking
+ - 6.2.2 Codablock-F
+ - 6.2.3 Code 16K (EN 12323)
+ - 6.2.4 PDF417 (ISO 15438)
+ - 6.2.5 Compact PDF417 (ISO 15438)
+ - 6.2.6 MicroPDF417 (ISO 24728)
+ - 6.2.7 GS1 DataBar Stacked (ISO 24724)
+ - 6.2.7.1 GS1 DataBar Stacked
+ - 6.2.7.2 GS1 DataBar Stacked Omnidirectional
+ - 6.2.7.3 GS1 DataBar Expanded Stacked
+ - 6.2.8 Code 49
+ - 6.3 Composite Symbols (ISO 24723)
+ - 6.3.1 CC-A
+ - 6.3.2 CC-B
+ - 6.3.3 CC-C
+ - 6.4 Two-Track Symbols
+ - 6.4.1 Two-Track Pharmacode
+ - 6.4.2 POSTNET
+ - 6.4.3 PLANET
+ - 6.5 4-State Postal Codes
+ - 6.5.1 Australia Post 4-State Symbols
+ - 6.5.1.1 Customer Barcodes
+ - 6.5.1.2 Reply Paid Barcode
+ - 6.5.1.3 Routing Barcode
+ - 6.5.1.4 Redirect Barcode
+ - 6.5.2 Dutch Post KIX Code
+ - 6.5.3 Royal Mail 4-State Customer Code (RM4SCC)
+ - 6.5.4 Royal Mail 4-State Mailmark
+ - 6.5.5 USPS Intelligent Mail
+ - 6.5.6 Japanese Postal Code
+ - 6.6 Two-Dimensional Matrix Symbols
+ - 6.6.1 Data Matrix (ISO 16022)
+ - 6.6.2 QR Code (ISO 18004)
+ - 6.6.3 Micro QR Code (ISO 18004)
+ - 6.6.4 Rectangular Micro QR Code (rMQR)
+ - 6.6.5 UPNQR (Univerzalnega Plačilnega Naloga QR)
+ - 6.6.6 MaxiCode (ISO 16023)
+ - 6.6.7 Aztec Code (ISO 24778)
+ - 6.6.8 Aztec Runes (ISO 24778)
+ - 6.6.9 Code One
+ - 6.6.10 Grid Matrix
+ - 6.6.11 DotCode
+ - 6.6.12 Han Xin Code (ISO 20830)
+ - 6.6.13 Ultracode
+ - 6.7 Other Barcode-Like Markings
+ - 6.7.1 Facing Identification Mark (FIM)
+ - 6.7.2 Flattermarken
+ - 6.7.3 DAFT Code
+- 7. Legal and Version Information
+ - 7.1 License
+ - 7.2 Patent Issues
+ - 7.3 Version Information
+ - 7.4 Sources of Information
+ - 7.5 Standards Compliance
+- A. Character Encoding
+ - A.1 ASCII Standard
+ - A.2 Latin Alphabet No. 1 (ISO/IEC 8859-1)
+- B. CLI Help
1. Introduction
-===============
+
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
@@ -17,10 +187,10 @@ 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.
-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 either a Portable Network
+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 either a Portable Network
Graphic (PNG) image, Windows Bitmap (BMP), Graphics Interchange Format (GIF),
ZSoft Paintbrush image (PCX), Tagged Image File Format (TIF), Enhanced Metafile
Format (EMF), as Encapsulated PostScript (EPS), or as a Scalable Vector Graphic
@@ -28,173 +198,324 @@ Format (EMF), as Encapsulated PostScript (EPS), or as a Scalable Vector Graphic
image including the size and colour of the image, the amount of error correction
used in the symbol and the orientation of the image.
-1.1 Terms of Reference
-----------------------
+1.1 Glossary
+
Some of the words and phrases used in this document are specific to barcoding,
and so a brief explanation is given to help understanding:
-symbol: 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.
+symbol:
+ 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.
-symbology: A method of encoding data to create a certain type of symbol.
+symbology:
+ A method of encoding data to create a certain type of symbol.
-linear: A linear symbol is one which consists of bars and spaces, and is what
- most people associate with the term 'barcode'. Examples include EAN.
+linear:
+ 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.
-stacked: 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.
+stacked:
+ 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.
-matrix: A matrix symbol is one based on a (usually square) grid of elements.
- Examples include Data Matrix, but MaxiCode and DotCode are also
- considered matrix symbologies.
+matrix:
+ A matrix or two-dimensional 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.
-X-dimension: 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. The default size of the X-dimension in a raster image
- is 2 pixels. Many symbologies have a fixed width-to-height ratio where
- the height is expressed as a multiple of the X-dimension.
+composite:
+ 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.
-composite: 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.
+X-dimension:
+ 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 multiples of the
+ X-dimension. 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.
-GS1 data: This is a structured way of representing information which consists
- of 'chunks' of data, each of which starts with an Application
- Identifier. The AI identifies what type of information is being
- encoded.
+GS1 data:
+ 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.
-Reader Initialisation: 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.
+Reader Initialisation:
+ 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.
-ECI: The ECI mechanism allows for multi-language data to be encoded in
- symbols which would usually support only Latin-1 (ISO/IEC 8859-1)
- 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.
+ECI:
+ 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.
-Two other concepts that are important are raster and vector. Raster is a low
-level bitmap representation of an image. BMP, GIF, PCX, PNG and TIF are raster
-file formats. Vector is 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.
+Two other concepts that are important are raster and vector.
+raster:
+ A low level bitmap representation of an image. BMP, GIF, PCX, PNG and TIF
+ are raster file formats.
+
+vector:
+ 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.
2. Installing Zint
-==================
2.1 Linux
----------
+
The easiest way to configure compilation is to take advantage of the CMake
-utilities. You will need to install CMake and libpng first. Note that you will
-need both libpng and libpng-devel packages. If you want to take advantage of
-Zint Barcode Studio you will also need the Qt libraries pre-installed.
+utilities. You will need to install CMake and libpng-dev first. For instance on
+apt systems:
+
+ sudo apt install git cmake build-essential libpng-dev
+
+If you want to take advantage of Zint Barcode Studio you will also need to have
+Qt and its component "Desktop gcc 64-bit" installed, as well as mesa. For
+details see "README.linux" in the project root directory.
Once you have fulfilled these requirements unzip the source code tarball or
clone the latest source
-git clone https://git.code.sf.net/p/zint/code zint
+ git clone https://git.code.sf.net/p/zint/code zint
and follow these steps in the top directory:
-mkdir build
-cd build
-cmake ..
-make
-sudo make install
+ mkdir build
+ cd build
+ cmake ..
+ make
+ sudo make install
The CLI command line program can be accessed by typing
-zint [options]
+ zint [options]
The GUI can be accessed by typing
-zint-qt
+ zint-qt
To test that the installation has been successful a shell script is included in
-the frontend sub-directory. To run the test type
+the "frontend" sub-directory. To run the test type
-./test.sh
+ ./test.sh
-This should create numerous files showing the many modes of operation which are
-available from Zint.
+This should create numerous files in the sub-directory "frontend/test_sh_out"
+showing the many modes of operation which are available from Zint.
2.2 Microsoft Windows
----------------------
-For Microsoft Windows, Zint is distributed as a binary executable. Simply
-download the ZIP file, then right-click on the ZIP file and "Extract All". A
-new folder will be created within which are two binary files:
-qtZint.exe - Zint Barcode Studio
-zint.exe - Command Line Interface
+For Microsoft Windows, Zint is distributed as a binary executable. Simply
+download the ZIP file, then right-click on the ZIP file and "Extract All". A new
+folder will be created within which are two binary files:
+
+- qtZint.exe - Zint Barcode Studio
+- zint.exe - Command Line Interface
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.
+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.
To build Zint on Windows from source, see "win32/README".
2.3 Apple macOS
----------------
+
Zint can be installed using Homebrew. To install Homebrew input the following
line into the macOS terminal
-/usr/bin/ruby -e "$(curl -fsSL
- https://raw.githubusercontent.com/Homebrew/install/master/install)"
+ /usr/bin/ruby -e "$(curl -fsSL
+ https://raw.githubusercontent.com/Homebrew/install/master/install)"
Once Homebrew is installed use the following command to install Zint.
-brew install zint
+ brew install zint
2.4 Zint Tcl Backend
---------------------
-The Tcl backend in the backend_tcl sub-directory may be built using the
+
+The Tcl backend in the "backend_tcl" sub-directory may be built using the
provided TEA (Tcl Extension Architecture) build on Linux, Windows, macOS and
Android. For Windows, an MSVC6 makefile is also available.
-
3. Using Zint Barcode Studio
-============================
+
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
-zint-qt
+ zint-qt
-or in Windows
+or on Windows
-qtZint.exe
+ qtZint.exe
-See the note in section 2.2 about Microsoft Defender SmartScreen.
+See the note in section 2.2 Microsoft Windows about Microsoft Defender
+SmartScreen.
-(The rest of this section of the manual involves use of the GUI, so has been
-removed from this text-only version)
+Below is a brief guide to Zint Barcode Studio.
+3.1 Main Window and Data Tab
+
+[Zint Barcode Studio on startup - main window with Data tab]
+
+This is the main window of Zint Barcode Studio. The top of the window shows a
+preview of the barcode which the current settings would create. These settings
+can be changed using the controls below. The text box in the "Data to Encode"
+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 "Save As" button to save the
+resulting image to a file.
+
+The "Symbology" 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 "mail" will
+only show barcodes in the drop-down whose names contain the word "mail". Each
+word entered will match. So typing "mail post" will show barcodes whose names
+contain "mail" or "post" (or both).
+
+The "BMP" and "SVG" 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 "Menu" button, along with "CLI Equivalent", "Save As",
+"Help", "About" and "Quit" options. Most of the options are also available in a
+context menu by right-clicking the preview.
+
+[Zint Barcode Studio main menu (left) and context menu (right)]
+
+3.2 Composite Groupbox
+
+[Zint Barcode Studio encoding GS1 composite data]
+
+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
+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 6.3 Composite Symbols (ISO 24723).
+
+3.3 Additional ECI/Data Segments Groupbox
+
+[Zint Barcode Studio encoding multiple segments]
+
+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 "Data to Encode" as segment 0) may be
+specified. See 4.15 Multiple Segments for details.
+
+3.4 Symbology-specific Tab
+
+[Zint Barcode Studio showing Aztec Code options]
+
+For a number of symbologies extra options are available to fine-tune the format,
+appearance and content of the symbol generated. These are given in a second tab.
+
+Here the method is shown for adjusting the size or error correction level of an
+Aztec Code symbol, selecting how its data is to be treated, and setting it as
+part of a Structured Append sequence of symbols.
+
+3.5 Appearance Tab
+
+[Zint Barcode Studio showing Appearance tab options]
+
+The Appearance tab can be used to adjust the dimensions and other properties of
+the symbol. The "Height" value affects the height of symbologies which do not
+have a fixed width-to-height ratio, i.e. those other than matrix symbologies.
+Boundary bars ("Border Type") can be added and adjusted and the size of the
+saved image ("Printing Scale") can be determined.
+
+3.6 Colour Dialog
+
+[The colour picker tool]
+
+A colour dialog is used to adjust the colour of the foreground and background of
+the generated image. In the Appearance tab click on the "Foreground" or
+"Background" button respectively. The colours can be reset to black-on-white
+using the "Reset" button.
+
+3.7 Data Dialog
+
+[Entering longer text input]
+
+Clicking on the ellipsis "..." button next to the "Data to Encode" 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.
+
+The dialog is also available for additional ECI/Data segments by clicking the
+ellipsis button to the right of their data text boxes.
+
+Note that if your data contains line feeds (LF) 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 '\n' and the "Parse Escapes"
+checkbox will be set. This only affects line feeds, not carriage returns (CR) or
+CR+LF pairs, and behaves the same on both Windows and Unix. (For details on
+escape sequences, see 4.1 Inputting Data.)
+
+3.8 Sequence Dialog
+
+[Creating a sequence of barcode symbols]
+
+Clicking on the sequence button (labelled "1234..") 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:
+
+ Character Effect
+ --------------------- --------------------------
+ # Insert leading spaces
+ $ Insert leading zeroes
+ * Insert leading asterisks
+ Any other character Interpreted literally
+
+ : {#tbl:sequence_format_characters tag=“: Sequence Format Characters”}
+
+3.9 Export Dialog
+
+[Setting filenames for an exported sequence of barcode symbols]
+
+The Export Dialog invoked by pressing the "Export" button in the Sequence Dialog
+sets the parameters for exporting a sequence of barcode images. Here you can set
+the filename and the output image format. Note that the symbology, colour and
+other formatting information are taken from the main window.
+
+3.10 CLI Equivalent Dialog
+
+[CLI Equivalent Dialog]
+
+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 "Copy" button to copy the command to the
+clipboard, which can then be pasted into the command line.
4. Using the Command Line
-=========================
-This section describes how to encode data using the command line frontend
-program. The examples given are for the Linux platform, but the same options
-are available for Windows - just remember to include the executable file
-extension if ".EXE" is not in your PATHEXT environment variable, i.e.:
-zint.exe -d "This Text"
+This section describes how to encode data using the command line frontend
+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 ".EXE" is not in your PATHEXT environment variable, i.e.:
+
+ zint.exe -d "This Text"
For compatibility with Windows the examples use double quotes to delimit data,
-though on Linux single quotes are generally preferable as they stop the shell
+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:
-zint -d 'Text containing a single quote '\'' in the middle'
+ zint -d 'Text containing a single quote '\'' in the middle'
Some examples use backslash (\) to continue commands onto the next line. For
Windows, use caret (^) instead.
@@ -204,209 +525,323 @@ Certain options that take values have short names as well as long ones, namely
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:
-zint -d "This Text"
-zint --data="This Text"
-zint --data "This Text"
+ zint -d "This Text"
+ zint --data="This Text"
+ zint --data "This Text"
The examples use a space separator for short option names, and an equals sign
for long option names.
4.1 Inputting Data
-------------------
+
The data to encode can be entered at the command line using the -d or --data
option, for example
-zint -d "This Text"
+ zint -d "This Text"
-This will encode the text "This Text". Zint will use the default symbology,
-Code 128, and output to the default file out.png in the current directory.
-Alternatively, if libpng was not present when Zint was built, the default
-output file will be out.gif.
+This will encode the text "This Text". Zint will use the default symbology, Code
+128, and output to the default file "out.png" in the current directory.
+Alternatively, if libpng was not present when Zint was built, the default output
+file will be "out.gif".
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 section 4.10 below.
+will need to set the appropriate input options as shown in 4.10 Input Modes
+below.
Non-printing characters can be entered on the command line using backslash (\)
as an escape character in combination with the --esc switch. Permissible
sequences are shown in the table below.
-------------------------------------------------------------------------------
-Escape Sequence | ASCII Equivalent | Name | Interpretation
-------------------------------------------------------------------------------
-\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
-\xNN | 0xNN | | Any 8-bit character where NN
- | | | is hexadecimal
-\uNNNN | | | Any 16-bit Unicode Basic
- | | | Multilingual Plane (BMP)
- | | | character where NNNN is
- | | | hexadecimal
-------------------------------------------------------------------------------
+ ---------------------------------------------------------------------------
+ Escape ASCII Name Interpretation
+ Sequence Equivalent
+ ---------- ------------ ------- -------------------------------------------
+ \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
+
+ \xNN 0xNN Any 8-bit character where NN is hexadecimal
+
+ \uNNNN Any 16-bit Unicode BMP[1] character where
+ NNNN is hexadecimal
+ ---------------------------------------------------------------------------
+
+ : {#tbl:escape_sequences tag=“: Escape Sequences”}
Input data can be read directly from file using the -i or --input switch as
-shown below. The input file is assumed to be UTF-8 (Unicode) formatted unless an
+shown below. The input file is assumed to be UTF-8 formatted unless an
alternative mode is selected. This command replaces the use of the -d switch.
-zint -i somefile.txt
+ zint -i somefile.txt
-Note that except when batch processing (section 4.11 below), the file should not
-end with a newline (LF on Unix, CR+LF on Windows) unless you want the newline to
-be encoded in the symbol.
+Note that except when batch processing (see 4.11 Batch Processing below), the
+file should not end with a newline (LF on Unix, CR+LF on Windows) unless you
+want the newline to be encoded in the symbol.
4.2 Directing Output
---------------------
+
Output can be directed to a file other than the default using the -o or --output
switch. For example:
-zint -o here.png -d "This Text"
+ zint -o here.png -d "This Text"
-This draws a Code 128 barcode in the file here.png. If an Encapsulated
-PostScript file is needed simply append the filename with .eps, and so on for
+This draws a Code 128 barcode in the file "here.png". If an Encapsulated
+PostScript file is needed simply append the filename with ".eps", and so on for
the other supported file types:
-zint -o there.eps -d "This Text"
+ zint -o there.eps -d "This Text"
4.3 Selecting Barcode Type
---------------------------
-Selecting which type of barcode you wish to produce (i.e. which symbology to
-use) can be done at the command line using the -b or --barcode= switch followed
+
+Selecting which type of barcode you wish to produce (i.e. which symbology to
+use) can be done at the command line using the -b or --barcode switch followed
by the appropriate integer value or name in the following table. For example to
create a Data Matrix symbol you could use:
-zint -b 71 -o datamatrix.png -d "Data to encode"
+ zint -b 71 -o datamatrix.png -d "Data to encode"
or
-zint -b DATAMATRIX -o datamatrix.png -d "Data to encode"
+ zint -b DATAMATRIX -o datamatrix.png -d "Data to encode"
---------------------------------------------------------------------------------
-Numeric | Name (case- | Barcode Name
-Value | insensitive) |
---------------------------------------------------------------------------------
-1 | CODE11 | Code 11
-2 | C25STANDARD | Standard Code 2 of 5
-3 | C25INTER | Interleaved 2 of 5
-4 | C25IATA | Code 2 of 5 IATA
-6 | C25LOGIC | Code 2 of 5 Data Logic
-7 | C25IND | Code 2 of 5 Industrial
-8 | CODE39 | Code 3 of 9 (Code 39)
-9 | EXCODE39 | Extended Code 3 of 9 (Code 39+)
-13 | EANX | EAN (including EAN-8 and EAN-13)
-14 | EANX_CHK | EAN + Check Digit
-16 | GS1_128 | GS1-128 (UCC.EAN-128)
-18 | CODABAR | Codabar
-20 | CODE128 | Code 128 (automatic subset switching)
-21 | DPLEIT | Deutshe Post Leitcode
-22 | DPIDENT | Deutshe Post Identcode
-23 | CODE16K | Code 16K
-24 | CODE49 | Code 49
-25 | CODE93 | Code 93
-28 | FLAT | Flattermarken
-29 | DBAR_OMN | GS1 DataBar Omnidirectional (including GS1
- | | DataBar Truncated)
-30 | DBAR_LTD | GS1 DataBar Limited
-31 | DBAR_EXP | GS1 DataBar Expanded
-32 | TELEPEN | Telepen Alpha
-34 | UPCA | UPC-A
-35 | UPCA_CHK | UPC-A + Check Digit
-37 | UPCE | UPC-E
-38 | UPCE_CHK | UPC-E + Check Digit
-40 | POSTNET | POSTNET
-47 | MSI_PLESSEY | MSI Plessey
-49 | FIM | FIM
-50 | LOGMARS | LOGMARS
-51 | PHARMA | Pharmacode One-Track
-52 | PZN | PZN
-53 | PHARMA_TWO | Pharmacode Two-Track
-55 | PDF417 | PDF417
-56 | PDF417COMP | Compact PDF417 (Truncated PDF417)
-57 | MAXICODE | MaxiCode
-58 | QRCODE | QR Code
-60 | CODE128B | Code 128 (Subset B)
-63 | AUSPOST | Australia Post Standard Customer
-66 | AUSREPLY | Australia Post Reply Paid
-67 | AUSROUTE | Australia Post Routing
-68 | AUSREDIRECT | Australia Post Redirection
-69 | ISBNX | ISBN (EAN-13 with verification stage)
-70 | RM4SCC | Royal Mail 4 State (RM4SCC)
-71 | DATAMATRIX | Data Matrix (ECC200)
-72 | EAN14 | EAN-14
-73 | VIN | Vehicle Identification Number
-74 | CODABLOCKF | Codablock-F
-75 | NVE18 | NVE-18 (SSCC-18)
-76 | JAPANPOST | Japanese Postal Code
-77 | KOREAPOST | Korea Post
-79 | DBAR_STK | GS1 DataBar Stacked (stacked version of GS1
- | | DataBar Truncated)
-80 | DBAR_OMNSTK | GS1 DataBar Stacked Omnidirectional
-81 | DBAR_EXPSTK | GS1 DataBar Expanded Stacked
-82 | PLANET | PLANET
-84 | MICROPDF417 | MicroPDF417
-85 | USPS_IMAIL | USPS Intelligent Mail (OneCode)
-86 | PLESSEY | Plessey Code
-87 | TELEPEN_NUM | Telepen Numeric
-89 | ITF14 | ITF-14
-90 | KIX | Dutch Post KIX Code
-92 | AZTEC | Aztec Code
-93 | DAFT | DAFT Code
-96 | DPD | DPD Code
-97 | MICROQR | Micro QR Code
-98 | HIBC_128 | HIBC (Health Industry Barcode) Code 128
-99 | HIBC_39 | HIBC Code 39
-102 | HIBC_DM | HIBC Data Matrix ECC200
-104 | HIBC_QR | HIBC QR Code
-106 | HIBC_PDF | HIBC PDF417
-108 | HIBC_MICPDF | HIBC MicroPDF417
-110 | HIBC_BLOCKF | HIBC Codablock-F
-112 | HIBC_AZTEC | HIBC Aztec Code
-115 | DOTCODE | DotCode
-116 | HANXIN | Han Xin (Chinese Sensible) Code
-121 | MAILMARK | Royal Mail 4-state Mailmark
-128 | AZRUNE | Aztec Runes
-129 | CODE32 | Code 32
-130 | EANX_CC | Composite Symbol with EAN linear component
-131 | GS1_128_CC | Composite Symbol with GS1-128 linear component
-132 | DBAR_OMN_CC | Composite Symbol with GS1 DataBar Omnidirectional
- | | linear component
-133 | DBAR_LTD_CC | Composite Symbol with GS1 DataBar Limited linear
- | | component
-134 | DBAR_EXP_CC | Composite Symbol with GS1 DataBar Expanded linear
- | | component
-135 | UPCA_CC | Composite Symbol with UPC-A linear component
-136 | UPCE_CC | Composite Symbol with UPC-E linear component
-137 | DBAR_STK_CC | Composite Symbol with GS1 DataBar Stacked
- | | component
-138 | DBAR_OMNSTK_CC | Composite Symbol with GS1 DataBar Stacked
- | | Omnidirectional component
-139 | DBAR_EXPSTK_CC | Composite Symbol with GS1 DataBar Expanded
- | | Stacked component
-140 | CHANNEL | Channel Code
-141 | CODEONE | Code One
-142 | GRIDMATRIX | Grid Matrix
-143 | UPNQR | UPNQR (Univerzalnega Plačilnega Naloga QR)
-144 | ULTRA | Ultracode
-145 | RMQR | Rectangular Micro QR Code (rMQR)
---------------------------------------------------------------------------------
+Names are treated case-insensitively by the CLI, and the BARCODE_ prefix and any
+underscores are optional.
+
+ --------------------------------------------------------------------------------
+ Numeric Name[2] Barcode Name
+ Value
+ --------- ------------------------- --------------------------------------------
+ 1 BARCODE_CODE11 Code 11
+
+ 2* BARCODE_C25STANDARD Standard Code 2 of 5
+
+ 3 BARCODE_C25INTER Interleaved 2 of 5
+
+ 4 BARCODE_C25IATA Code 2 of 5 IATA
+
+ 6 BARCODE_C25LOGIC Code 2 of 5 Data Logic
+
+ 7 BARCODE_C25IND Code 2 of 5 Industrial
+
+ 8 BARCODE_CODE39 Code 3 of 9 (Code 39)
+
+ 9 BARCODE_EXCODE39 Extended Code 3 of 9 (Code 39+)
+
+ 13 BARCODE_EANX EAN (including EAN-8 and EAN-13)
+
+ 14 BARCODE_EANX_CHK EAN + Check Digit
+
+ 16* BARCODE_GS1_128 GS1-128 (UCC.EAN-128)
+
+ 18 BARCODE_CODABAR Codabar
+
+ 20 BARCODE_CODE128 Code 128 (automatic subset switching)
+
+ 21 BARCODE_DPLEIT Deutshe Post Leitcode
+
+ 22 BARCODE_DPIDENT Deutshe Post Identcode
+
+ 23 BARCODE_CODE16K Code 16K
+
+ 24 BARCODE_CODE49 Code 49
+
+ 25 BARCODE_CODE93 Code 93
+
+ 28 BARCODE_FLAT Flattermarken
+
+ 29* BARCODE_DBAR_OMN GS1 DataBar Omnidirectional (including GS1
+ DataBar Truncated)
+
+ 30* BARCODE_DBAR_LTD GS1 DataBar Limited
+
+ 31* BARCODE_DBAR_EXP GS1 DataBar Expanded
+
+ 32 BARCODE_TELEPEN Telepen Alpha
+
+ 34 BARCODE_UPCA UPC-A
+
+ 35 BARCODE_UPCA_CHK UPC-A + Check Digit
+
+ 37 BARCODE_UPCE UPC-E
+
+ 38 BARCODE_UPCE_CHK UPC-E + Check Digit
+
+ 40 BARCODE_POSTNET POSTNET
+
+ 47 BARCODE_MSI_PLESSEY MSI Plessey
+
+ 49 BARCODE_FIM FIM
+
+ 50 BARCODE_LOGMARS LOGMARS
+
+ 51 BARCODE_PHARMA Pharmacode One-Track
+
+ 52 BARCODE_PZN PZN
+
+ 53 BARCODE_PHARMA_TWO Pharmacode Two-Track
+
+ 55 BARCODE_PDF417 PDF417
+
+ 56* BARCODE_PDF417COMP Compact PDF417 (Truncated PDF417)
+
+ 57 BARCODE_MAXICODE MaxiCode
+
+ 58 BARCODE_QRCODE QR Code
+
+ 60 BARCODE_CODE128B Code 128 (Subset B)
+
+ 63 BARCODE_AUSPOST Australia Post Standard Customer
+
+ 66 BARCODE_AUSREPLY Australia Post Reply Paid
+
+ 67 BARCODE_AUSROUTE Australia Post Routing
+
+ 68 BARCODE_AUSDIRECT Australia Post Redirection
+
+ 69 BARCODE_ISBNX ISBN (EAN-13 with verification stage)
+
+ 70 BARCODE_RM4SCC Royal Mail 4-State (RM4SCC)
+
+ 71 BARCODE_DATAMATRIX Data Matrix (ECC200)
+
+ 72 BARCODE_EAN14 EAN-14
+
+ 73 BARCODE_VIN Vehicle Identification Number
+
+ 74 BARCODE_CODABLOCKF Codablock-F
+
+ 75 BARCODE_NVE18 NVE-18 (SSCC-18)
+
+ 76 BARCODE_JAPANPOST Japanese Postal Code
+
+ 77 BARCODE_KOREAPOST Korea Post
+
+ 79* BARCODE_DBAR_STK GS1 DataBar Stacked
+
+ 80* BARCODE_DBAR_OMNSTK GS1 DataBar Stacked Omnidirectional
+
+ 81* BARCODE_DBAR_EXPSTK GS1 DataBar Expanded Stacked
+
+ 82 BARCODE_PLANET PLANET
+
+ 84 BARCODE_MICROPDF417 MicroPDF417
+
+ 85* BARCODE_USPS_IMAIL USPS Intelligent Mail (OneCode)
+
+ 86 BARCODE_PLESSEY UK Plessey
+
+ 87 BARCODE_TELEPEN_NUM Telepen Numeric
+
+ 89 BARCODE_ITF14 ITF-14
+
+ 90 BARCODE_KIX Dutch Post KIX Code
+
+ 92 BARCODE_AZTEC Aztec Code
+
+ 93 BARCODE_DAFT DAFT Code
+
+ 96 BARCODE_DPD DPD Code
+
+ 97 BARCODE_MICROQR Micro QR Code
+
+ 98 BARCODE_HIBC_128 HIBC Code 128
+
+ 99 BARCODE_HIBC_39 HIBC Code 39
+
+ 102 BARCODE_HIBC_DM HIBC Data Matrix ECC200
+
+ 104 BARCODE_HIBC_QR HIBC QR Code
+
+ 106 BARCODE_HIBC_PDF HIBC PDF417
+
+ 108 BARCODE_HIBC_MICPDF HIBC MicroPDF417
+
+ 110 BARCODE_HIBC_BLOCKF HIBC Codablock-F
+
+ 112 BARCODE_HIBC_AZTEC HIBC Aztec Code
+
+ 115 BARCODE_DOTCODE DotCode
+
+ 116 BARCODE_HANXIN Han Xin (Chinese Sensible) Code
+
+ 121 BARCODE_MAILMARK Royal Mail 4-state Mailmark
+
+ 128 BARCODE_AZRUNE Aztec Runes
+
+ 129 BARCODE_CODE32 Code 32
+
+ 130 BARCODE_EANX_CC Composite Symbol with EAN linear component
+
+ 131* BARCODE_GS1_128_CC Composite Symbol with GS1-128 linear
+ component
+
+ 132* BARCODE_DBAR_OMN_CC Composite Symbol with GS1 DataBar
+ Omnidirectional linear component
+
+ 133* BARCODE_DBAR_LTD_CC Composite Symbol with GS1 DataBar Limited
+ linear component
+
+ 134* BARCODE_DBAR_EXP_CC Composite Symbol with GS1 DataBar Expanded
+ linear component
+
+ 135 BARCODE_UPCA_CC Composite Symbol with UPC-A linear component
+
+ 136 BARCODE_UPCE_CC Composite Symbol with UPC-E linear component
+
+ 137* BARCODE_DBAR_STK_CC Composite Symbol with GS1 DataBar Stacked
+ component
+
+ 138* BARCODE_DBAR_OMNSTK_CC Composite Symbol with GS1 DataBar Stacked
+ Omnidirectional component
+
+ 139* BARCODE_DBAR_EXPSTK_CC Composite Symbol with GS1 DataBar Expanded
+ Stacked component
+
+ 140 BARCODE_CHANNEL Channel Code
+
+ 141 BARCODE_CODEONE Code One
+
+ 142 BARCODE_GRIDMATRIX Grid Matrix
+
+ 143 BARCODE_UPNQR UPNQR (Univerzalnega Plačilnega Naloga QR)
+
+ 144 BARCODE_ULTRA Ultracode
+
+ 145 BARCODE_RMQR Rectangular Micro QR Code (rMQR)
+ --------------------------------------------------------------------------------
+
+ : {#tbl:barcode_types tag=“: Barcode Types (Symbologies)”}
4.4 Adjusting Height
---------------------
+
The height of a symbol (except those with a fixed width-to-height ratio) can be
adjusted using the --height switch. For example:
-zint --height=100 -d "This Text"
+ zint --height=100 -d "This Text"
This specifies a symbol height of 100 times the X-dimension of the symbol.
@@ -414,49 +849,51 @@ The default height of most linear barcodes is 50X, but this can be changed for
barcodes whose specifications give a standard height by using the switch
--compliantheight. For instance
-zint -b LOGMARS -d "This Text" --compliantheight
+ zint -b LOGMARS -d "This Text" --compliantheight
will produce a barcode of height 45.455X instead of the normal default of 50X.
The flag also causes Zint to return a warning if a non-compliant height is
given:
-zint -b LOGMARS -d "This Text" --compliantheight --height=6.2
-Warning 247: Height not compliant with standards
+ zint -b LOGMARS -d "This Text" --compliantheight --height=6.2
+ Warning 247: Height not compliant with standards
Another switch is --heightperrow, which can be useful for symbologies that have
-a variable number of linear rows, namely PDF417, MicroPDF417, Codablock-F,
-Code16K, Code 49 and DataBar Expanded Stacked, as it changes the treatment of
+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
-zint -b PDF417 -d "This Text" --height=4 --heightperrow
+ zint -b PDF417 -d "This Text" --height=4 --heightperrow
+
+[zint -b PDF417 -d "This Text" --height=4 --heightperrow]
will produce a barcode of height 32X, with each of the 8 rows 4X high.
4.5 Adjusting Whitespace
-------------------------
+
The amount of horizontal whitespace to the left and right of the generated
barcode can be altered using the -w or --whitesp switch. For example:
-zint -w 10 -d "This Text"
+ zint -w 10 -d "This Text"
-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.
+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.
The amount of vertical whitespace above and below the barcode can be altered
using the --vwhitesp switch. For example for 3 times the X-dimension:
-zint --vwhitesp=3 -d "This Text"
+ zint --vwhitesp=3 -d "This Text"
Note that the whitespace at the bottom appears below the text, if any.
Horizontal and vertical whitespace can of course be used together:
-zint -b DATAMATRIX --whitesp=1 --vwhitesp=1 -d "This Text"
+ zint -b DATAMATRIX --whitesp=1 --vwhitesp=1 -d "This Text"
A --quietzones option is also available which adds quiet zones compliant with
-the symbology's specification. This is in addition to any whitespace specified
+the symbology’s specification. This is in addition to any whitespace specified
with the --whitesp or --vwhitesp switches.
Note that Codablock-F, Code 16K, Code 49, ITF-14, EAN-13, EAN-8, EAN-5, EAN-2,
@@ -464,9 +901,9 @@ ISBN, UPC-A and UPC-E have compliant quiet zones added by default. This can be
disabled with the option --noquietzones.
4.6 Adding Boundary Bars and Boxes
-----------------------------------
-Zint allows the symbol to be bound with 'boundary bars' (also known as 'bearer
-bars') using the option --bind. These bars help to prevent misreading of the
+
+Zint allows the symbol to be bound with ‘boundary bars’ (also known as ‘bearer
+bars’) using the option --bind. 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 --box option.
@@ -474,7 +911,9 @@ horizontal whitespace with the --box option.
The width of the boundary or box must be specified using the --border switch.
For example:
-zint --box --border=10 -w 10 -d "This"
+ zint --box --border=10 -w 10 -d "This Text"
+
+[zint --border=10 --box -d "This Text" -w 10]
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
@@ -485,107 +924,116 @@ inside any vertical whitespace (or text). For matrix symbols, however, where
they are decorative rather than functional, boundary bars appear outside any
whitespace.
+[zint -b QRCODE --border=1 --box -d "This Text" --quietzones]
+
Codablock-F, Code 16K and Code 49 always have boundary bars, and default to
-particular horizontal whitespace values. Special considerations apply to ITF-14
-- see the specific section 6.1.2.6 for that symbology.
+particular horizontal whitespace values. Special considerations apply to
+ITF-14 - see 6.1.2.6 ITF-14 for that symbology.
4.7 Using Colour
-----------------
+
The default colours of a symbol are a black symbol on a white background. Zint
allows you to change this. The -r or --reverse switch allows the default colours
to be inverted so that a white symbol is shown on a black background (known as
reflectance reversal). For example the command
-zint -r -d "This"
+ zint -r -d "This Text"
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, Han Xin Code, Grid
Matrix and QR Code symbology specifications.
For more specific needs the foreground (ink) and background (paper) colours can
-be specified using the --fg= and --bg= options followed by a number in RRGGBB
+be specified using the --fg and --bg options followed by a number in RRGGBB
hexadecimal notation (the same system used in HTML). For example the command
-zint --fg=004700 -d "This"
+ zint --fg=00FF00 -d "This Text"
-alters the symbol to a dark green.
+alters the symbol to a bright green.
+
+[zint -d "This Text" --fg=00FF00]
Zint also supports RGBA colour information for some output file formats which
-support alpha channels (currently only PNG, TIF and SVG) in a RRGGBBAA format.
+support alpha channels (currently only PNG, SVG and TIF) in a RRGGBBAA format.
For example:
-zint --fg=00ff0055 -d "This"
+ zint --fg=00ff0055 -d "This Text"
+
+[zint -d "This Text" --fg=00FF0055]
will produce a semi-transparent green foreground with standard (white)
-background. Note that transparency is handled differently for raster and
-vector files so that...
+background. Note that transparency is handled differently for raster and vector
+files so that…
-zint --bg=ff0000 --fg=ffffff00 ...
+ zint --bg=ff0000 --fg=ffffff00 ...
will give different results for PNG and SVG. Experimentation is advised!
In addition the --nobackground option will simply remove the background from
-PNG, GIF, TIF, SVG, EMF and EPS files.
+EMF, EPS, GIF, PNG, SVG and TIF files.
4.8 Rotating the Symbol
------------------------
-The symbol can be rotated through four orientations using the --rotate= option
+
+The symbol can be rotated through four orientations using the --rotate option
followed by the angle of rotation as shown below.
---rotate=0 (default)
---rotate=90
---rotate=180
---rotate=270
+ --rotate=0 (default)
+ --rotate=90
+ --rotate=180
+ --rotate=270
+
+[zint -d "This Text" --rotate=90]
4.9 Adjusting Image Size
-------------------------
-The scale of the image can be altered using the --scale= option followed by a
+
+The scale of the image can be altered using the --scale option followed by a
multiple of the default X-dimension. The scale is multiplied by 2 before being
applied. The default scale is 1.
For raster output, the default X-dimension is 2 pixels (except for MaxiCode, see
-4.9.2 below). For example for PNG images a scale of 5 will increase the
-X-dimension to 10 pixels. Scales 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.
+4.9.2 MaxiCode Raster Scaling below). For example for PNG images a scale of 5
+will increase the X-dimension to 10 pixels. Scales for 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.
The minimum scale for non-dotty raster output is 0.5, giving a minimum
-X-dimension of 1 pixel, and text will not be printed for scales less than 1.
-The minimum scale for raster output in dotty mode is 1 (see 4.14).
+X-dimension of 1 pixel, and text will not be printed for scales less than 1. The
+minimum scale for raster output in dotty mode is 1 (see 4.14 Working with Dots).
The minimum scale for vector output is 0.1, giving a minimum X-dimension of 0.2.
The maximum scale for both raster and vector is 100.
4.9.1 Scaling Example
----------------------
-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 dots per mm (dpmm), the equivalent of 300
-dots per inch (dpi = dpmm * 25.4), specify a scale of 2, since 0.33 * 12 = 3.96
+
+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 dots per mm (dpmm), the equivalent of 300 dots
+per inch (dpi = dpmm * 25.4), specify a scale of 2, since 0.33 * 12 = 3.96
pixels, or 4 pixels rounding to the nearest pixel:
-zint -b EANX -d "501234567890" --compliantheight --scale=2
+ zint -b EANX -d "501234567890" --compliantheight --scale=2
This will result in output of 38.27mm x 26.08mm (WxH) at 300 dpi. The following
table shows the scale to use (in 0.5 increments) depending on the dpmm desired,
for a target X-dimension of 0.33mm:
--------------------
-dpmm | dpi | scale
--------------------
- 6 | 150 | 1
- 8 | 200 | 1.5
- 12 | 300 | 2
- 16 | 400 | 3
- 24 | 600 | 4
- 47 | 1200 | 8
- 95 | 2400 | 15.5
-189 | 4800 | 31
--------------------
+ dpmm dpi scale
+ ------ ------ -------
+ 6 150 1
+ 8 200 1.5
+ 12 300 2
+ 16 400 3
+ 24 600 4
+ 47 1200 8
+ 95 2400 15.5
+ 189 4800 31
+
+ : {#tbl:scaling_xdim_0_33mm tag=“: Scaling for X-dimension 0.33mm”}
4.9.2 MaxiCode Raster Scaling
------------------------------
+
For MaxiCode symbols, which use hexagons, the scale for raster output is
multiplied by 10 before being applied. The minimum scale is 0.2, so the minimum
X-dimension is 2 pixels.
@@ -594,290 +1042,351 @@ 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 following table shows
the scale to use depending on the dpmm desired, with dpi equivalents:
--------------------
-dpmm | dpi | scale
--------------------
- 6 | 150 | 0.5
- 8 | 200 | 0.7
- 12 | 300 | 1
- 16 | 400 | 1.4
- 24 | 600 | 2.1
- 47 | 1200 | 4.1
- 95 | 2400 | 8.2
-189 | 4800 | 16.4
--------------------
+ dpmm dpi scale
+ ------ ------ -------
+ 6 150 0.5
+ 8 200 0.7
+ 12 300 1
+ 16 400 1.4
+ 24 600 2.1
+ 47 1200 4.1
+ 95 2400 8.2
+ 189 4800 16.4
+
+ : {#tbl:maxicode_raster_scaling tag=“: MaxiCode Raster Scaling”}
Note that the 0.5 increment recommended for normal raster output does not apply.
Scales below 0.5 are not recommended and may produce symbols that are not within
the minimum/maximum size ranges.
4.10 Input Modes
-----------------
-By default all CLI input data is assumed to be encoded in UTF-8 (Unicode)
-format. Many barcode symbologies encode data using Latin-1 (ISO/IEC 8859-1)
-character encoding, so input is converted from UTF-8 to Latin-1 before being put
-in the symbol. In addition QR Code, Micro QR Code, Rectangular Micro QR Code,
-Han Xin Code and Grid Matrix can encode Japanese (Kanji) or Chinese (Hanzi)
-characters which are also converted from UTF-8.
+
+4.10.1 Unicode, Data, and GS1 Modes
+
+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.
+
+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).
+
+ Symbology Default character sets Alternate if input not Latin-1
+ --------------- -------------------------- --------------------------------
+ Aztec Code Latin-1 None
+ Codablock-F Latin-1 None
+ Code 128 Latin-1 None
+ Code 16k Latin-1 None
+ Code One Latin-1 None
+ Data Matrix Latin-1 None
+ DotCode Latin-1 None
+ Grid Matrix GB 2312 (includes ASCII) N/A
+ Han Xin Latin-1 GB 18030 (includes ASCII)
+ MaxiCode Latin-1 None
+ MicroPDF417 Latin-1 None
+ Micro QR Code Latin-1 Shift JIS (includes ASCII[3])
+ PDF417 Latin-1 None
+ QR Code Latin-1 Shift JIS (see above)
+ rMQR Latin-1 Shift JIS (see above)
+ Ultracode Latin-1 None
+ UPNQR Latin-2 N/A
+ All others ASCII N/A
+
+ : {#tbl:default_character_sets tag=“: Default Character Sets”}
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. 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
-Latin-1 then you should check that the resulting barcode can be understood by
-your target barcode reader. Zint will generate a warning message when an ECI
-code that has not been explicitly requested has been inserted into a symbol.
+Interpretations) mechanism to encode the data if the symbology supports it - see
+4.10.2 Input Modes and ECI below.
GS1 data can be encoded in a number of symbologies. Application Identifiers
(AIs) should be enclosed in [square brackets] followed by the data to be encoded
-(see 6.1.11.3). To encode GS1 data use the --gs1 option. GS1 mode is assumed
-(and doesn't need to be set) for GS1-128, EAN-14, DataBar and Composite
-symbologies but is also available for Aztec Code, Code 16K, Code 49, Code One,
-Data Matrix, DotCode, QR Code and Ultracode.
+(see 6.1.10.3 GS1-128). To encode GS1 data use the --gs1 option. GS1 mode is
+assumed (and doesn’t need to be set) for GS1-128, EAN-14, GS1 DataBar and
+Composite symbologies but is also available for Aztec Code, Code 16K, Code 49,
+Code One, Data Matrix, DotCode, QR Code and Ultracode.
-Health Industry Barcode (HIBC) data may also be encoded in the symbologies Code
-39, Code 128, Codablock-F, Data Matrix, QR Code, PDF417, MicroPDF417 and Aztec
+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 '+' and the check character are
automatically added, conforming to HIBC Labeler Identification Code (HIBC LIC).
For HIBC Provider Applications Standard (HIBC PAS), preface the data with a
slash '/'.
The --binary 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
+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.
The --fullmultibyte option uses the multibyte modes of QR Code, Micro QR Code,
-Rectangular Micro QR Code (rMQR), Han Xin Code and Grid Matrix for binary and
-Latin 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, typically by applying a
-transformation to UTF-8 and 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.
+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.
-If your data contains non-Latin-1 characters, you may encode it using an
-ECI-aware symbology and an ECI value from the table below. The ECI information
-is added to your code symbol as prefix data. The symbologies that support ECI
-are Aztec Code, Code One, Data Matrix, DotCode, Grid Matrix, Han Xin Code,
-MaxiCode, PDF417 and MicroPDF417, QR Code and rMQR, and Ultracode.
+4.10.2 Input Modes and ECI
+
+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
+{@tbl:eci_codes} below. The ECI information is added to your code symbol as
+prefix data. The symbologies that support ECI are
+
+ ------------- -------------- ------------- -----------
+ Aztec Code DotCode MaxiCode QR Code
+ Code One Grid Matrix MicroPDF417 rMQR
+ Data Matrix Han Xin Code PDF417 Ultracode
+ ------------- -------------- ------------- -----------
+
+ : {#tbl:eci_aware_symbologies tag=“: ECI-Aware Symbologies”}
+
+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.
The ECI value may be specified with the --eci switch, followed by the value in
the column "ECI Code". The input data should be UTF-8 formatted. Zint
automatically translates the data into the target encoding.
+ ECI Code Character Encoding Scheme (ISO/IEC 8859 schemes include ASCII)
+ ---------- ----------------------------------------------------------------
+ 3 ISO/IEC 8859-1 - Latin alphabet No. 1
+ 4 ISO/IEC 8859-2 - Latin alphabet No. 2
+ 5 ISO/IEC 8859-3 - Latin alphabet No. 3
+ 6 ISO/IEC 8859-4 - Latin alphabet No. 4
+ 7 ISO/IEC 8859-5 - Latin/Cyrillic alphabet
+ 8 ISO/IEC 8859-6 - Latin/Arabic alphabet
+ 9 ISO/IEC 8859-7 - Latin/Greek alphabet
+ 10 ISO/IEC 8859-8 - Latin/Hebrew alphabet
+ 11 ISO/IEC 8859-9 - Latin alphabet No. 5 (Turkish)
+ 12 ISO/IEC 8859-10 - Latin alphabet No. 6 (Nordic)
+ 13 ISO/IEC 8859-11 - Latin/Thai alphabet
+ 15 ISO/IEC 8859-13 - Latin alphabet No. 7 (Baltic)
+ 16 ISO/IEC 8859-14 - Latin alphabet No. 8 (Celtic)
+ 17 ISO/IEC 8859-15 - Latin alphabet No. 9
+ 18 ISO/IEC 8859-16 - Latin alphabet No. 10
+ 20 Shift JIS (JIS X 0208 and JIS X 0201)
+ 21 Windows 1250 - Latin 2 (Central Europe)
+ 22 Windows 1251 - Cyrillic
+ 23 Windows 1252 - Latin 1
+ 24 Windows 1256 - Arabic
+ 25 UTF-16BE (High order byte first)
+ 26 UTF-8
+ 27 ASCII (ISO/IEC 646 IRV)
+ 28 Big5 (Taiwan) Chinese Character Set
+ 29 GB 2312 (PRC) Chinese Character Set
+ 30 Korean Character Set EUC-KR (KS X 1001:2002)
+ 31 GBK Chinese Character Set
+ 32 GB 18030 Chinese Character Set
+ 33 UTF-16LE (Low order byte first)
+ 34 UTF-32BE (High order bytes first)
+ 35 UTF-32LE (Low order bytes first)
+ 170 ISO/IEC 646 Invariant[4]
+ 899 8-bit binary data
+
+ : {#tbl:eci_codes tag=“: ECI Codes”}
+
An ECI value of 0 does not encode any ECI information in the code symbol (unless
-the data contains non-Latin-1 characters). In this case, the default encoding
-applies, which is "ISO/IEC 8859-1 - Latin alphabet No. 1".
+the data contains non-default character set characters). In this case, the
+default character set applies (see Table @tbl:default_character_sets above).
If no ECI is specified or a value of 0 is given, and the data does contain
-characters other than Latin-1, then Zint will automatically insert the
-appropriate single-byte ECI if possible (ECIs 4 to 24, excluding ECI 20), or
-failing that ECI 26 (UTF-8). A warning will be generated. This mechanism is not
-applied if the --binary option is given.
+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 --binary option is given.
-Multiple ECIs can be specified using the --segN= options - see section 4.15.
+Multiple ECIs can be specified using the --segN options - see 4.15 Multiple
+Segments.
-Note: the "--eci=3" specification should only be used for special purposes.
-Using this parameter, the ECI information is explicitly added to the code
-symbol. Nevertheless, for ECI Code 3, this is not required, as this is the
-default encoding, which is also active without any ECI information.
+Note: the --eci=3 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.
-------------------------------------------------------------
-ECI Code | Character Encoding Scheme
-------------------------------------------------------------
-3 | ISO/IEC 8859-1 - Latin alphabet No. 1
-4 | ISO/IEC 8859-2 - Latin alphabet No. 2
-5 | ISO/IEC 8859-3 - Latin alphabet No. 3
-6 | ISO/IEC 8859-4 - Latin alphabet No. 4
-7 | ISO/IEC 8859-5 - Latin/Cyrillic alphabet
-8 | ISO/IEC 8859-6 - Latin/Arabic alphabet
-9 | ISO/IEC 8859-7 - Latin/Greek alphabet
-10 | ISO/IEC 8859-8 - Latin/Hebrew alphabet
-11 | ISO/IEC 8859-9 - Latin alphabet No. 5 (Turkish)
-12 | ISO/IEC 8859-10 - Latin alphabet No. 6 (Nordic)
-13 | ISO/IEC 8859-11 - Latin/Thai alphabet
-15 | ISO/IEC 8859-13 - Latin alphabet No. 7 (Baltic)
-16 | ISO/IEC 8859-14 - Latin alphabet No. 8 (Celtic)
-17 | ISO/IEC 8859-15 - Latin alphabet No. 9
-18 | ISO/IEC 8859-16 - Latin alphabet No. 10
-20 | Shift JIS (JIS X 0208 and JIS X 0201)
-21 | Windows 1250 - Latin 2 (Central Europe)
-22 | Windows 1251 - Cyrillic
-23 | Windows 1252 - Latin 1
-24 | Windows 1256 - Arabic
-25 | UTF-16BE (High order byte first)
-26 | UTF-8 (Unicode)
-27 | ISO/IEC 646:1991 7-bit character set (ASCII)
-28 | Big5 (Taiwan) Chinese Character Set
-29 | GB 2312 (PRC) Chinese Character Set
-30 | Korean Character Set EUC-KR (KS X 1001:2002)
-31 | GBK Chinese Character Set
-32 | GB 18030 Chinese Character Set
-33 | UTF-16LE (Low order byte first)
-34 | UTF-32BE (High order bytes first)
-35 | UTF-32LE (Low order bytes first)
-170 | ISO/IEC 646:1991 7-bit character set (Invariant)
-899 | 8-bit binary data
-------------------------------------------------------------
+4.10.2.1 Input Modes and ECI Example 1
-Three examples:
-Ex1: The Euro sign U+20AC can be encoded in ISO/IEC 8859-15. The Euro sign has
-the ISO/IEC 8859-15 codepoint hex A4. It is encoded in UTF-8 as the hex
-sequence: E2 82 AC. Those 3 bytes are contained in the file "utf8euro.txt". This
-command will generate the corresponding code:
+The Euro sign U+20AC can be encoded in ISO/IEC 8859-15. The Euro sign has the
+ISO/IEC 8859-15 codepoint hex "A4". It is encoded in UTF-8 as the hex sequence:
+"E2 82 AC". Those 3 bytes are contained in the file "utf8euro.txt". This command
+will generate the corresponding code:
-zint -b 71 --square --scale=10 --eci=17 -i utf8euro.txt
+ zint -b 71 --scale=10 --eci=17 -i utf8euro.txt
This is equivalent to the commands (using the --esc switch):
-zint -b 71 --square --scale=10 --eci=17 --esc -d "\xE2\x82\xAC"
+ zint -b 71 --scale=10 --eci=17 --esc -d "\xE2\x82\xAC"
-zint -b 71 --square --scale=10 --eci=17 --esc -d "\u20AC"
+ zint -b 71 --scale=10 --eci=17 --esc -d "\u20AC"
and to the command:
-zint -b 71 --square --scale=10 --eci=17 -d "€"
+ zint -b 71 --scale=10 --eci=17 -d "€"
-Ex2: The Chinese character with Unicode codepoint U+5E38 can be encoded in Big5
-encoding. The Big5 representation of this character is the two hex bytes: B1 60
-(contained in the file big5char.txt). The generation command for Data Matrix is:
+[zint -b DATAMATRIX --eci=17 -d "€"]
-zint -b 71 --square --scale=10 --eci=28 --binary -i big5char.txt
+4.10.2.2 Input Modes and ECI Example 2
+
+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:
+"B1 60" (contained in the file "big5char.txt"). The generation command for Data
+Matrix is:
+
+ zint -b 71 --scale=10 --eci=28 --binary -i big5char.txt
This is equivalent to the command (using the --esc switch):
-zint -b 71 --square --scale=10 --eci=28 --binary --esc -d "\xB1\x60"
+ zint -b 71 --scale=10 --eci=28 --binary --esc -d "\xB1\x60"
and to the commands (no --binary switch so conversion occurs):
-zint -b 71 --square --scale=10 --eci=28 --esc -d "\u5E38"
+ zint -b 71 --scale=10 --eci=28 --esc -d "\xE5\xB8\xB8"
-zint -b 71 --square --scale=10 --eci=28 -d "常"
+ zint -b 71 --scale=10 --eci=28 --esc -d "\u5E38"
-Ex3: 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 --binary switch so that the data will be encoded as UTF-8 without
-conversion:
+ zint -b 71 --scale=10 --eci=28 -d "常"
-zint -b 58 --binary -d "UTF-8 data"
+[zint -b DATAMATRIX --eci=28 -d "\u5E38" --esc]
+
+4.10.2.3 Input Modes and ECI Example 3
+
+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
+--binary switch so that the data will be encoded as UTF-8 without conversion:
+
+ zint -b 58 --binary -d "UTF-8 data"
+
+[zint -b QRCODE --binary -d "\xE2\x82\xAC\xE5\xB8\xB8" --esc]
4.11 Batch Processing
----------------------
-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
---batch switch. To select the input file from which to read data use the -i
-option. 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. 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.
+
+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 --batch
+switch. To select the input file from which to read data use the -i option. 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. 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.
By default Zint will output numbered filenames starting with 00001.png,
00002.png etc. To change this behaviour use the -o option in combination with
---batch using special characters in the output file name as shown in the table
+--batch using special characters in the output filename as shown in the table
below:
----------------------------------------------
-Input Character | Interpretation
----------------------------------------------
-~ | Insert a number or '0'
-# | Insert a number or space
-@ | Insert a number or '*'
-Any other | Insert literally
----------------------------------------------
+ Input Character Interpretation
+ ----------------- --------------------------
+ ~ Insert a number or 0
+ # Insert a number or space
+ @ Insert a number or *
+ Any other Insert literally
+
+ : {#tbl:batch_filename_formatting tag=“: Batch Filename Formatting”}
The following table shows some examples to clarify this method:
---------------------------------------------------------------
-Input | Filenames Generated
---------------------------------------------------------------
--o file~~~.svg | file001.svg, file002.svg, file003.svg
--o @@@@bar.png | ***1.png, ***2.png, ***3.png
--o my~~~bar.eps | my001.bar.eps, my002.bar.eps, my003bar.eps
--o t@es~t~.png | t*es0t1.png, t*es0t2.png, t*es0t3.png
---------------------------------------------------------------
+ Input Filenames Generated
+ ----------------- --------------------------------------------
+ -o file~~~.svg file001.svg, file002.svg, file003.svg
+ -o @@@@bar.png ***1.png, ***2.png, ***3.png
+ -o my~~~bar.eps my001.bar.eps, my002.bar.eps, my003bar.eps
+ -o t@es~t~.png t*es0t1.png, t*es0t2.png, t*es0t3.png
+
+ : {#tbl:batch_filename_examples tag=“: Batch Filename Examples”}
4.12 Direct Output
-------------------
+
The finished image files can be output directly to stdout for use as part of a
pipe by using the --direct option. By default --direct will output data as a PNG
image (or GIF image if libpng is not present), but this can be altered by
-supplementing the --direct option with a --filetype= option followed by the
+supplementing the --direct option with a --filetype option followed by the
suffix of the file type required. For example:
-zint -b 84 --direct --filetype=pcx -d "Data to encode"
+ zint -b 84 --direct --filetype=pcx -d "Data to encode"
This command will output the symbol as a PCX file to stdout. The currently
supported output file formats are shown in the following table:
---------------------------------------------------------------
-Abbreviation | File format
---------------------------------------------------------------
-BMP | Windows Bitmap
-EMF | Enhanced Metafile Format
-EPS | Encapsulated PostScript
-GIF | Graphics Interchange Format
-PCX | ZSoft Paintbrush image
-PNG | Portable Network Graphic
-SVG | Scalable Vector Graphic
-TIF | Tagged Image File Format
-TXT | Text file (see 4.17)
---------------------------------------------------------------
+ Abbreviation File format
+ -------------- -------------------------------------------
+ BMP Windows Bitmap
+ EMF Enhanced Metafile Format
+ EPS Encapsulated PostScript
+ GIF Graphics Interchange Format
+ PCX ZSoft Paintbrush image
+ PNG Portable Network Graphic
+ SVG Scalable Vector Graphic
+ TIF Tagged Image File Format
+ TXT Text file (see 4.18 Other Output Options)
-=============================================================================
-CAUTION: Outputting binary files to the command shell without catching that
-data in a pipe can have unpredictable results. Use with care!
-=============================================================================
+ : {#tbl:output_file_formats tag=“: Output File Formats”}
+
+--------------------------------------------------------------------------------
+
+CAUTION: Outputting binary files to the command shell without catching that data
+in a pipe can have unpredictable results. Use with care!
+
+--------------------------------------------------------------------------------
4.13 Automatic Filenames
-------------------------
-The --mirror 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 "1234567" will result in
-a file named 1234567.png.
+
+The --mirror 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 "1234567" will result in a file named
+"1234567.png".
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.
-To set the output file format use the --filetype= option as detailed in
-section 4.12.
+To set the output file format use the --filetype option as detailed above in
+4.12 Direct Output.
4.14 Working with Dots
-----------------------
+
Matrix codes can be rendered as a series of dots or circles rather than the
normal squares by using the --dotty 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 --dotsize= option followed by the diameter
-of the dot, where that diameter is given as a multiple of the X-dimension. The
-minimum dot size is 0.01, the maximum is 20. The default size is 0.8.
+matrix symbologies, and is automatically selected for DotCode. The size of the
+dots can be adjusted using the --dotsize option followed by the diameter of the
+dot, where that diameter is given as a multiple of the X-dimension. The minimum
+dot size is 0.01, the maximum is 20. The default size is 0.8.
The default and minimum scale for raster output in dotty mode is 1.
-4.15 Multiple Segments
-----------------------
-If you need to specify different ECIs for different sections of the input data,
-the --seg1= to --seg9= options can be used. Each option is of the form
---segN=ECI,data where "ECI" is the ECI code (see table in section 4.10) and
-"data" is the data to which this applies. This is in addition to the ECI and
-data specified using the --eci= and -d options which must still be present and
-which in effect constitute segment 0. For instance
+[zint -b CODEONE -d "123456789012345678" --dotty --vers=9]
-zint -b AZTEC_CODE --eci=9 -d "Κείμενο" --seg1=13,"Текст" --seg2=20,"文章"
+4.15 Multiple Segments
+
+If you need to specify different ECIs for different sections of the input data,
+the --seg1 to --seg9 options can be used. Each option is of the form
+--segN=ECI,data where ECI is the ECI code (see Table {@tbl:eci_codes}) and data
+is the data to which this applies. This is in addition to the ECI and data
+specified using the --eci and -d options which must still be present and which
+in effect constitute segment 0. For instance
+
+ zint -b AZTEC_CODE --eci=9 -d "Κείμενο" --seg1=7,"Текст" --seg2=20,"文章"
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.
+The symbology must be ECI-aware (see Table {@tbl:eci_aware_symbologies}).
+
+[zint -b AZTEC --eci=9 -d "Κείμενο" --seg1=7,"Текст" --seg2=20,"文章"]
+
ECIs of zero may be given, in which case Zint will automatically determine an
-ECI if necessary, as described in section 4.10.
+ECI if necessary, as described in section 4.10.2 Input Modes and ECI.
Multiple segments are not currently supported for use with GS1 data.
4.16 Structured Append
-----------------------
+
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,
@@ -886,7 +1395,9 @@ Grid Matrix, MaxiCode, MicroPDF417, PDF417, QR Code and Ultracode.
The --structapp option marks a symbol as part of a Structured Append sequence,
and has the format
---structapp=I,C[,ID]
+ --structapp=I,C[,ID]
+
+[zint -b DATAMATRIX -d "2nd of 3" --structapp="2,3,5006"]
where I is the index (position) of the symbol in the Structured Append sequence,
C is the count or total number of symbols in the sequence, and ID is an optional
@@ -895,28 +1406,31 @@ 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.
-4.16 Help Options
------------------
-There are three help options which give information about how to use the
-command line. The -h or --help option will display a list of all of the valid
-options available, and also gives the exact version of the software.
+4.17 Help Options
-The -t or --types option gives the table of symbologies along with the symbol
-ID numbers and names.
+There are three help options which give information about how to use the command
+line. The -h or --help 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 -v or --version).
+
+The -t or --types option gives the table of symbologies along with the symbol ID
+numbers and names.
The -e or --ecinos option gives a list of the ECI codes.
-4.17 Other Output Options
--------------------------
-For linear barcodes the text present in the output image can be removed by
-using the --notext option.
+4.18 Other Output Options
-The text can be set to bold using the --bold option, or a smaller font
-can be substituted using the --small option. The --bold and --small options
-can be used together if required.
+For linear barcodes the text present in the output image can be removed by using
+the --notext option.
+
+The text can be set to bold using the --bold option, or a smaller font can be
+substituted using the --small option. The --bold and --small options can be used
+together if required, but only for vector output.
+
+[zint --bold -d "This Text" --small]
Zint can output a representation of the symbol data as a set of hexadecimal
-values if asked to output to a text file (*.txt) or if given the option
+values if asked to output to a text file ("*.txt") or if given the option
--filetype=txt. This can be used for test and diagnostic purposes.
The --cmyk option is specific to output in Encapsulated PostScript and TIF, and
@@ -924,636 +1438,579 @@ converts the RGB colours used to the CMYK colour space. Setting custom colours
at the command line will still need to be done in RRGGBB format.
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 6 of this guide.
-
+These may, for example, control the amount of error correction data or the size
+of the symbol. These options are discussed in section 6. Types of Symbology of
+this guide.
5. Using the API
-================
+
Zint has been written using the C language and has an API for use with C/C++
-language programs. A Qt interface is available in the backend_qt sub-directory,
-and a Tcl interface is available in the backend_tcl sub-directory.
+language programs. A Qt interface is available in the "backend_qt"
+sub-directory, and a Tcl interface is available in the "backend_tcl"
+sub-directory.
The libzint 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.
+This allows you to use both packages in your application without conflict if you
+wish.
5.1 Creating and Deleting Symbols
----------------------------------
+
The symbols manipulated by Zint are held in a zint_symbol structure defined in
-zint.h. These symbols are created with the ZBarcode_Create() function and
+"zint.h". These symbols are created with the ZBarcode_Create() function and
deleted using the ZBarcode_Delete() function. For example the following code
creates and then deletes a symbol:
-#include
-#include
-int main()
-{
- struct zint_symbol *my_symbol;
- my_symbol = ZBarcode_Create();
- if (my_symbol != NULL)
+ #include
+ #include
+ int main()
{
- printf("Symbol successfully created!\n");
+ struct zint_symbol *my_symbol;
+ my_symbol = ZBarcode_Create();
+ if (my_symbol != NULL) {
+ printf("Symbol successfully created!\n");
+ }
+ ZBarcode_Delete(my_symbol);
+ return 0;
}
- ZBarcode_Delete(my_symbol);
- return 0;
-}
When compiling this code it will need to be linked with the libzint library
using the -lzint option:
-gcc -o simple simple.c -lzint
+ gcc -o simple simple.c -lzint
5.2 Encoding and Saving to File
--------------------------------
+
To encode data in a barcode use the ZBarcode_Encode() function. To write the
symbol to a file use the ZBarcode_Print() function. For example the following
-code takes a string from the command line and outputs a Code 128 symbol in a
-PNG file named out.png (or a GIF file called out.gif if libpng is not present)
+code takes a string from the command line and outputs a Code 128 symbol in a PNG
+file named "out.png" (or a GIF file called "out.gif" if libpng is not present)
in the current working directory:
-#include
-int main(int argc, char **argv)
-{
- struct zint_symbol *my_symbol;
- my_symbol = ZBarcode_Create();
- ZBarcode_Encode(my_symbol, argv[1], 0);
- ZBarcode_Print(my_symbol, 0);
- ZBarcode_Delete(my_symbol);
- return 0;
-}
+ #include
+ int main(int argc, char **argv)
+ {
+ struct zint_symbol *my_symbol;
+ my_symbol = ZBarcode_Create();
+ ZBarcode_Encode(my_symbol, argv[1], 0);
+ ZBarcode_Print(my_symbol, 0);
+ ZBarcode_Delete(my_symbol);
+ return 0;
+ }
This can also be done in one stage using the ZBarcode_Encode_and_Print()
function as shown in the next example:
-#include
-int main(int argc, char **argv)
-{
- struct zint_symbol *my_symbol;
- my_symbol = ZBarcode_Create();
- ZBarcode_Encode_and_Print(my_symbol, argv[1], 0, 0);
- ZBarcode_Delete(my_symbol);
- return 0;
-}
+ #include
+ int main(int argc, char **argv)
+ {
+ struct zint_symbol *my_symbol;
+ my_symbol = ZBarcode_Create();
+ ZBarcode_Encode_and_Print(my_symbol, argv[1], 0, 0);
+ ZBarcode_Delete(my_symbol);
+ return 0;
+ }
-Note that when using the API, the input data is assumed to be Latin-1 or binary
-unless the input_mode variable in the symbol structure is set - see section 5.10
-for details.
+Note that when using the API, the input data is assumed to be 8-bit binary
+unless the input_mode variable in the zint_symbol structure is set - see 5.10
+Setting the Input Mode for details.
5.3 Encoding and Printing Functions in Depth
---------------------------------------------
+
The functions for encoding and printing barcodes are defined as:
-int ZBarcode_Encode(struct zint_symbol *symbol, const unsigned char *source,
- int length);
+ int ZBarcode_Encode(struct zint_symbol *symbol,
+ const unsigned char *source, int length);
-int ZBarcode_Encode_File(struct zint_symbol *symbol, const char *filename);
+ int ZBarcode_Encode_File(struct zint_symbol *symbol,
+ const char *filename);
-int ZBarcode_Print(struct zint_symbol *symbol, int rotate_angle);
+ int ZBarcode_Print(struct zint_symbol *symbol, int rotate_angle);
-int ZBarcode_Encode_and_Print(struct zint_symbol *symbol,
- const unsigned char *source, int length, int rotate_angle);
+ int ZBarcode_Encode_and_Print(struct zint_symbol *symbol,
+ const unsigned char *source, int length, int rotate_angle);
-int ZBarcode_Encode_File_and_Print(struct zint_symbol *symbol,
- const char *filename, int rotate_angle);
+ int ZBarcode_Encode_File_and_Print(struct zint_symbol *symbol,
+ const char *filename, int rotate_angle);
-In these definitions "length" can be used to set the length of the input
-string. This allows the encoding of NUL (ASCII 0) characters in those
-symbologies which allow this. A value of 0 will disable this usage and Zint
-will encode data up to the first NUL character in the input string, which must
-be present.
+In these definitions length can be used to set the length of the input string.
+This allows the encoding of NUL (ASCII 0) characters in those symbologies which
+allow this. A value of 0 will disable this usage and Zint will encode data up to
+the first NUL character in the input string, which must be present.
-The "rotate_angle" value can be used to rotate the image when outputting. Valid
+The rotate_angle value can be used to rotate the image when outputting. Valid
values are 0, 90, 180 and 270.
-The ZBarcode_Encode_File() and ZBarcode_Encode_File_and_Print() functions can
-be used to encode data read directly from a text file where the filename is
-given in the "filename" string.
+The ZBarcode_Encode_File() and ZBarcode_Encode_File_and_Print() functions can be
+used to encode data read directly from a text file where the filename is given
+in the NUL-terminated filename string.
If printing more than one barcode, the zint_symbol structure may be re-used by
calling the ZBarcode_Clear() function after each barcode to free any output
-buffers allocated. The symbol structure input variables must be reset.
+buffers allocated. The zint_symbol input variables must be reset.
5.4 Buffering Symbols in Memory (raster)
-----------------------------------------
+
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:
-int ZBarcode_Buffer(struct zint_symbol *symbol, int rotate_angle);
+ int ZBarcode_Buffer(struct zint_symbol *symbol, int rotate_angle);
-int ZBarcode_Encode_and_Buffer(struct zint_symbol *symbol,
- const unsigned char *source, int length, int rotate_angle);
+ int ZBarcode_Encode_and_Buffer(struct zint_symbol *symbol,
+ const unsigned char *source, int length, int rotate_angle);
-int ZBarcode_Encode_File_and_Buffer(struct zint_symbol *symbol,
- const char *filename, int rotate_angle);
+ int ZBarcode_Encode_File_and_Buffer(struct zint_symbol *symbol,
+ const char *filename, int rotate_angle);
The arguments here are the same as above. The difference is that instead of
-saving the image to file it is placed in an unsigned character array. The
-"bitmap" pointer is set to the first memory location in the array and the values
-"barcode_width" and "barcode_height" indicate the size of the resulting image
-in pixels. Rotation and colour options can be used at the same time as using
-the buffer functions in the same way as when saving to a file. The pixel data
-can be extracted from the array by the method shown in the example below where
-render_pixel() is assumed to be a function for drawing a pixel on the screen
-implemented by the external application:
+saving the image to a file it is placed in an unsigned character array. The
+bitmap pointer is set to the first memory location in the array and the values
+barcode_width and barcode_height indicate the size of the resulting image in
+pixels. Rotation and colour options can be used with the buffer functions in the
+same way as when saving to a file. The pixel data can be extracted from the
+array by the method shown in the example below where render_pixel() is assumed
+to be a function for drawing a pixel on the screen implemented by the external
+application:
-int row, col, i = 0;
-int red, blue, green;
+ int row, col, i = 0;
+ int red, blue, green;
-for (row = 0; row < my_symbol->bitmap_height; row++) {
- for (col = 0; col < my_symbol->bitmap_width; col++) {
- red = (int) my_symbol->bitmap[i];
- green = (int) my_symbol->bitmap[i + 1];
- blue = (int) my_symbol->bitmap[i + 2];
- render_pixel(row, col, red, green, blue);
- i += 3;
- }
-}
+ for (row = 0; row < my_symbol->bitmap_height; row++) {
+ for (col = 0; col < my_symbol->bitmap_width; col++) {
+ red = (int) my_symbol->bitmap[i];
+ green = (int) my_symbol->bitmap[i + 1];
+ blue = (int) my_symbol->bitmap[i + 2];
+ render_pixel(row, col, red, green, blue);
+ i += 3;
+ }
+ }
Where speed is important, the buffer can be returned instead in a more compact
intermediate form using the output option OUT_BUFFER_INTERMEDIATE. Here each
byte is an ASCII value: '1' for foreground colour and '0' for background colour,
-except for Ultracode, which uses colour codes: 'W' for white, 'C' for cyan, 'B'
-for blue, 'M' for magenta, 'R' for red, 'Y' for yellow, 'G' from green, and 'K'
-for black. The loop for accessing the data is then:
+except for Ultracode, which also uses colour codes: 'W' for white, 'C' for cyan,
+'B' for blue, 'M' for magenta, 'R' for red, 'Y' for yellow, 'G' for green, and
+'K' for black. The loop for accessing the data is then:
-int row, col, i = 0;
+ int row, col, i = 0;
-for (row = 0; row < my_symbol->bitmap_height; row++) {
- for (col = 0; col < my_symbol->bitmap_width; col++) {
- render_pixel(row, col, my_symbol->bitmap[i]);
- i++;
- }
-}
+ for (row = 0; row < my_symbol->bitmap_height; row++) {
+ for (col = 0; col < my_symbol->bitmap_width; col++) {
+ render_pixel(row, col, my_symbol->bitmap[i]);
+ i++;
+ }
+ }
5.5 Buffering Symbols in Memory (vector)
-----------------------------------------
+
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:
-int ZBarcode_Buffer_Vector(struct zint_symbol *symbol, int rotate_angle);
+ int ZBarcode_Buffer_Vector(struct zint_symbol *symbol, int rotate_angle);
-int ZBarcode_Encode_and_Buffer_Vector(struct zint_symbol *symbol,
- const unsigned char *source, int length, int rotate_angle);
+ int ZBarcode_Encode_and_Buffer_Vector(struct zint_symbol *symbol,
+ const unsigned char *source, int length, int rotate_angle);
-int ZBarcode_Encode_File_and_Buffer_Vector(struct zint_symbol *symbol,
- const char *filename, int rotate_angle);
+ int ZBarcode_Encode_File_and_Buffer_Vector(struct zint_symbol *symbol,
+ const char *filename, int rotate_angle);
-Here the "vector" pointer is set to a header which contains pointers to lists
-of structures representing the various elements of the barcode: rectangles,
+Here the vector pointer is set to a header 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
prepare_canvas(), draw_rect(), draw_hexagon(), draw_string(), and draw_circle()
routines available:
-struct zint_vector_rect *rect;
-struct zint_vector_hexagon *hexagon;
-struct zint_vector_string *string;
-struct zint_vector_circle *circle;
+ struct zint_vector_rect *rect;
+ struct zint_vector_hexagon *hexagon;
+ struct zint_vector_string *string;
+ struct zint_vector_circle *circle;
-prepare_canvas(symbol->vector->width, symbol->vector->height, symbol->scale,
- symbol->fgcolour, symbol->bgcolor, rotate_angle);
+ prepare_canvas(my_symbol->vector->width, my_symbol->vector->height,
+ my_symbol->scale, my_symbol->fgcolour, my_symbol->bgcolor,
+ rotate_angle);
-rect = symbol->vector->rectangles;
-while (rect) {
- draw_rect(rect->x, rect->y, rect->width, rect->height, rect->colour);
- rect = rect->next;
-}
-
-hexagon = symbol->vector->hexagons;
-while (hexagon) {
- draw_hexagon(hexagon->x, hexagon->y, hexagon->diameter, hexagon->rotation);
- hexagon = hexagon->next;
-}
-
-string = symbol->vector->strings;
-while (string) {
- draw_string(string->x, string->y, string->fsize, string->rotation,
- string->halign, string->text, string->length);
- string = string->next;
-}
-
-circle = symbol->vector->circles;
-while (circle) {
- draw_circle(circle->x, circle->y, circle->diameter, circle->width,
- circle->colour);
- circle = circle->next;
-}
+ for (rect = my_symbol->vector->rectangles; rect; rect = rect->next) {
+ draw_rect(rect->x, rect->y, rect->width, rect->height,
+ rect->colour);
+ }
+ for (hexagon = my_symbol->vector->hexagons; hexagon; hexagon = hexagon->next) {
+ draw_hexagon(hexagon->x, hexagon->y, hexagon->diameter,
+ hexagon->rotation);
+ }
+ for (string = my_symbol->vector->strings; string; string = string->next) {
+ draw_string(string->x, string->y, string->fsize,
+ string->rotation, string->halign,
+ string->text, string->length);
+ }
+ for (circle = my_symbol->vector->circles; circle; circle = circle->next) {
+ draw_circle(circle->x, circle->y, circle->diameter,
+ circle->width, circle->colour);
+ }
5.6 Setting Options
--------------------
+
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 out.png. As with the CLI
+symbols and we don’t mind that they only save to "out.png". As with the CLI
program, of course, these options can be altered. The way this is done is by
altering the contents of the zint_symbol structure between the creation and
encoding stages. The zint_symbol structure consists of the following variables:
---------------------------------------------------------------------------------
-Variable Name | Type | Meaning | Default Value
---------------------------------------------------------------------------------
-symbology | integer | Symbol to use (see section | BARCODE_CODE128
- | | 5.8). |
-height | float | Symbol height, excluding | Symbol
- | | fixed width-to-height | dependent
- | | symbols. [1] |
-scale | float | Scale factor for adjusting | 1.0
- | | size of image. |
-whitespace_width | integer | Horizontal whitespace width.| 0
-whitespace_height | integer | Vertical whitespace height. | 0
-border_width | integer | Border width. | 0
-output_options | integer | Set various output file | 0 (none)
- | | parameters (see section |
- | | 5.9). |
-fgcolour | character | Foreground (ink) colour as | "000000"
- | string | RGB/RGBA hexadecimal |
- | | string. Must be 6 or 8 |
- | | characters followed by |
- | | terminating \0. |
-bgcolour | character | Background (paper) colour | "ffffff"
- | string | as RGB/RGBA hexadecimal |
- | | string. Must be 6 or 8 |
- | | characters followed by |
- | | terminating \0. |
-fgcolor | pointer | Points to fgcolour allowing |
- | | alternate spelling. |
-bgcolor | pointer | Points to bgcolour allowing |
- | | alternate spelling. |
-outfile | character | Contains the name of the | "out.png"
- | string | file to output a result- |
- | | ing barcode symbol to. |
- | | Must end in .png, .gif, |
- | | .bmp, .emf, .eps, .pcx, |
- | | .svg, .tif or .txt |
- | | followed by a terminat- |
- | | ing \0. |
-primary | character | Primary message data for | "" (empty)
- | string | more complex symbols, |
- | | with a terminating \0. |
-option_1 | integer | Symbol specific options. | -1
-option_2 | integer | Symbol specific options. | 0
-option_3 | integer | Symbol specific options. | 0
-show_hrt | integer | Set to 0 to hide text. | 1
-input_mode | integer | Set encoding of input data | DATA_MODE
- | | (see section 5.10) |
-eci | integer | Extended Channel Interpre- | 0 (none)
- | | tation code. |
-dot_size | float | Size of dots used in dotty | 4.0 / 5.0
- | | mode. |
-guard_descent | float | Height of guard bar descent | 5.0
- | | (UPC/EAN only). |
-structapp | Structured | Mark a symbol as part of a | count 0
- | Append | sequence of symbols. | (disabled)
- | structure | |
-warn_level | integer | Affects error/warning value | WARN_DEFAULT
- | | returned by Zint API. |
-text | unsigned | Human Readable Text, which | "" (empty)
- | character | usually consists of in- | (output only)
- | string | put data plus one more |
- | | check digit. Uses UTF-8 |
- | | formatting, with a |
- | | terminating \0. |
-rows | integer | Number of rows used by the | (output only)
- | | the symbol. |
-width | integer | Width of the generated sym- | (output only)
- | | bol. |
-encoding_data | array of | Representation of the | (output only)
- | unsigned | encoded data. |
- | character | |
- | arrays | |
-row_height | array of | Representation of the | (output only)
- | floats | height of a row. |
-errtxt | character | Error message in the event | (output only)
- | string | that an error occurred, |
- | | with a terminating \0. |
-bitmap | pointer to | Pointer to stored bitmap | (output only)
- | unsigned | image. |
- | character | |
- | array | |
-bitmap_width | integer | Width of stored bitmap | (output only)
- | | image (in pixels). |
-bitmap_height | integer | Height of stored bitmap | (output only)
- | | image (in pixels). |
-alphamap | pointer to | Pointer to array | (output only)
- | unsigned | representing alpha |
- | character | channel (or NULL if no |
- | array | alpha channel needed). |
-bitmap_byte_length| integer | Size of BMP bitmap data. | (output only)
-vector | pointer to | Pointer to vector header | (output only)
- | vector | containing pointers to |
- | structure | vector elements. |
---------------------------------------------------------------------------------
+ ---------------------------------------------------------------------------------
+ Variable Name Type Meaning Default Value
+ --------------------- ------------ ---------------------------- -----------------
+ symbology integer Symbol to use (see 5.8 BARCODE_CODE128
+ Specifying a Symbology).
-[1] This 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).
+ height float Symbol height, excluding Symbol dependent
+ fixed width-to-height
+ symbols.[5]
+
+ scale float Scale factor for adjusting 1.0
+ size of image.
+
+ whitespace_width integer Horizontal whitespace width. 0
+
+ whitespace_height integer Vertical whitespace height. 0
+
+ border_width integer Border width. 0
+
+ output_options integer Set various output file 0 (none)
+ parameters (see 5.9
+ Adjusting Other Output
+ Options).
+
+ fgcolour character Foreground (ink) colour as "000000"
+ string RGB/RGBA hexadecimal string.
+ Must be 6 or 8 characters
+ followed by a terminating
+ NUL.
+
+ bgcolour character Background (paper) colour as "ffffff"
+ string RGB/RGBA hexadecimal string.
+ Must be 6 or 8 characters
+ followed by a terminating
+ NUL.
+
+ fgcolor pointer Points to fgcolour allowing
+ alternate spelling.
+
+ bgcolor pointer Points to bgcolour allowing
+ alternate spelling.
+
+ outfile character Contains the name of the "out.png"
+ string file to output a resulting
+ barcode symbol to. Must end
+ in .png, .gif, .bmp, .emf,
+ .eps, .pcx, .svg, .tif or
+ .txt followed by a
+ terminating NUL.
+
+ primary character Primary message data for "" (empty)
+ string more complex symbols, with a
+ terminating NUL.
+
+ option_1 integer Symbol specific options. -1
+
+ option_2 integer Symbol specific options. 0
+
+ option_3 integer Symbol specific options. 0
+
+ show_hrt integer Set to 0 to hide text 1
+
+ input_mode integer Set encoding of input data DATA_MODE
+ (see 5.10 Setting the Input
+ Mode).
+
+ eci integer Extended Channel 0 (none)
+ Interpretation code.
+
+ dot_size float Diameter of dots used in 4.0 / 5.0
+ dotty mode.
+
+ guard_descent float Height of guard bar descent 5.0
+ (UPC/EAN only)
+
+ structapp Structured Mark a symbol as part of a count 0
+ Append sequence of symbols. (disabled)
+ structure
+
+ warn_level integer Affects error/warning value WARN_DEFAULT
+ returned by Zint API (see
+ 5.7 Handling Errors).
+
+ text unsigned Human Readable Text, which "" (empty)
+ character usually consists of input (output only)
+ string data plus one more check
+ digit. Uses UTF-8
+ formatting, with a
+ terminating NUL.
+
+ rows integer Number of rows used by the (output only)
+ symbol.
+
+ width integer Width of the generated (output only)
+ symbol.
+
+ encoding_data array of Representation of the (output only)
+ unsigned encoded data.
+ character
+ arrays
+
+ row_height array of Representation of the height (output only)
+ floats of a row.
+
+ errtxt character Error message in the event (output only)
+ string that an error occurred, with
+ a terminating NUL.
+
+ bitmap pointer to Pointer to stored bitmap (output only)
+ unsigned image.
+ character
+ array
+
+ bitmap_width integer Width of stored bitmap image (output only)
+ (in pixels).
+
+ bitmap_height integer Height of stored bitmap (output only)
+ image (in pixels).
+
+ alphamap pointer to Pointer to array (output only)
+ unsigned representing alpha channel
+ character (or NULL if no alpha channel
+ array needed)
+
+ bitmap_byte_length integer Size of BMP bitmap data. (output only)
+
+ vector pointer to Pointer to vector header (output only)
+ vector containing pointers to
+ structure vector elements.
+ ---------------------------------------------------------------------------------
+
+ : API Structure zint_symbol {#tbl:api_structure_zint_symbol tag=“$ $”}
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.
-#include
-#include
-int main(int argc, char **argv)
-{
- struct zint_symbol *my_symbol;
- my_symbol = ZBarcode_Create();
- strcpy(my_symbol->fgcolour, "00ff00");
- my_symbol->height = 400.0f;
- ZBarcode_Encode_and_Print(my_symbol, argv[1], 0, 0);
- ZBarcode_Delete(my_symbol);
- return 0;
-}
+ #include
+ #include
+ int main(int argc, char **argv)
+ {
+ struct zint_symbol *my_symbol;
+ my_symbol = ZBarcode_Create();
+ strcpy(my_symbol->fgcolour, "00ff00");
+ my_symbol->height = 400.0f;
+ ZBarcode_Encode_and_Print(my_symbol, argv[1], 0, 0);
+ ZBarcode_Delete(my_symbol);
+ return 0;
+ }
-Background removal for PNG, GIF, TIF, SVG, EMF and EPS files can be achieved by
+Background removal for EMF, EPS, GIF, PNG, SVG and TIF files can be achieved by
setting the background alpha to "00" where the values for R, G and B will be
ignored:
-strcpy(my_symbol->bgcolour, "55555500");
+ strcpy(my_symbol->bgcolour, "55555500");
+
+5.7 Handling Errors
-5.6 Handling Errors
--------------------
If errors occur during encoding a non-zero integer value is passed back to the
-calling application. In addition the errtxt value is used to give a message
+calling application. In addition the errtxt variable is used to give a message
detailing the nature of the error. The errors generated by Zint are given in the
table below:
---------------------------------------------------------------------------------
-Return Value | Meaning
---------------------------------------------------------------------------------
-ZINT_WARN_INVALID_OPTION | One of the values in zint_struct was set
- | incorrectly but Zint has made a guess at
- | what it should have been and generated a
- | barcode accordingly.
-ZINT_WARN_USES_ECI | Zint has automatically inserted an ECI
- | character. The symbol may not be readable
- | with some readers.
-ZINT_WARN_NONCOMPLIANT | The symbol was created but is not compliant with
- | certain standards set in its specification
- | (e.g. height, GS1 AI data lengths).
-ZINT_ERROR | 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.
-ZINT_ERROR_TOO_LONG | The input data is too long or too short for the
- | selected symbology. No symbol has been
- | generated.
-ZINT_ERROR_INVALID_DATA | 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.
-ZINT_ERROR_INVALID_CHECK | Data with an incorrect check digit has been
- | entered. No symbol has been generated.
-ZINT_ERROR_INVALID_OPTION | One of the values in zint_struct was set
- | incorrectly and Zint was unable to guess what
- | it should have been. No symbol has been
- | generated.
-ZINT_ERROR_ENCODING_PROBLEM | A problem has occurred during encoding of the
- | data. This should never happen. Please
- | contact the developer if you encounter this
- | error.
-ZINT_ERROR_FILE_ACCESS | Zint was unable to open the requested output
- | file. This is usually a file permissions
- | problem.
-ZINT_ERROR_MEMORY | Zint ran out of memory. This should only be a
- | problem with legacy systems.
-ZINT_ERROR_FILE_WRITE | Zint failed to write all contents to the
- | requested output file. This should only occur
- | if the output device becomes full.
-ZINT_ERROR_USES_ECI | Returned if warn level set to WARN_FAIL_ALL and
- | ZINT_WARN_USES_ECI occurs.
-ZINT_ERROR_NONCOMPLIANT | Returned if warn level set to WARN_FAIL_ALL and
- | ZINT_WARN_NONCOMPLIANT occurs.
---------------------------------------------------------------------------------
+ -------------------------------------------------------------------------------
+ Return Value Meaning
+ ------------------------------ ------------------------------------------------
+ ZINT_WARN_INVALID_OPTION One of the values in zint_struct was set
+ incorrectly but Zint has made a guess at what it
+ should have been and generated a barcode
+ accordingly.
+
+ ZINT_WARN_USES_ECI Zint has automatically inserted an ECI
+ character. The symbol may not be readable with
+ some readers.
+
+ ZINT_WARN_NONCOMPLIANT The symbol was created but is not compliant with
+ certain standards set in its specification (e.g.
+ height, GS1 AI data lengths).
+
+ ZINT_ERROR 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.
+
+ ZINT_ERROR_TOO_LONG The input data is too long or too short for the
+ selected symbology. No symbol has been
+ generated.
+
+ ZINT_ERROR_INVALID_DATA 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.
+
+ ZINT_ERROR_INVALID_CHECK Data with an incorrect check digit has been
+ entered. No symbol has been generated.
+
+ ZINT_ERROR_INVALID_OPTION One of the values in zint_struct was set
+ incorrectly and Zint was unable to guess what it
+ should have been. No symbol has been generated.
+
+ ZINT_ERROR_ENCODING_PROBLEM A problem has occurred during encoding of the
+ data. This should never happen. Please contact
+ the developer if you encounter this error.
+
+ ZINT_ERROR_FILE_ACCESS Zint was unable to open the requested output
+ file. This is usually a file permissions
+ problem.
+
+ ZINT_ERROR_MEMORY Zint ran out of memory. This should only be a
+ problem with legacy systems.
+
+ ZINT_ERROR_FILE_WRITE Zint failed to write all contents to the
+ requested output file. This should only occur if
+ the output device becomes full.
+
+ ZINT_ERROR_USES_ECI Returned if warn_level set to WARN_FAIL_ALL and
+ ZINT_WARN_USES_ECI occurs.
+
+ ZINT_ERROR_NONCOMPLIANT Returned if warn_level set to WARN_FAIL_ALL and
+ ZINT_WARN_NONCOMPLIANT occurs.
+ -------------------------------------------------------------------------------
+
+ : {#tbl:api_warnings_errors tag=“: API Warning and Error Return Values”}
To catch errors use an integer variable as shown in the code below:
-#include
-#include
-#include
-int main(int argc, char **argv)
-{
- struct zint_symbol *my_symbol;
- int error = 0;
- my_symbol = ZBarcode_Create();
- strcpy(my_symbol->fgcolour, "nonsense");
- error = ZBarcode_Encode_and_Print(my_symbol, argv[1], 0, 0);
- if (error != 0)
+ #include
+ #include
+ #include
+ int main(int argc, char **argv)
{
- /* some warning or error occurred */
- printf("%s\n", my_symbol->errtxt);
- }
- if (error >= ZINT_ERROR)
- {
- /* stop now */
+ struct zint_symbol *my_symbol;
+ int error;
+ my_symbol = ZBarcode_Create();
+ strcpy(my_symbol->fgcolour, "nonsense");
+ error = ZBarcode_Encode_and_Print(my_symbol, argv[1], 0, 0);
+ if (error != 0) {
+ /* some warning or error occurred */
+ printf("%s\n", my_symbol->errtxt);
+ }
+ if (error >= ZINT_ERROR) {
+ /* stop now */
+ ZBarcode_Delete(my_symbol);
+ return 1;
+ }
+ /* otherwise carry on with the rest of the application */
ZBarcode_Delete(my_symbol);
- return 1;
+ return 0;
}
- /* otherwise carry on with the rest of the application */
- ZBarcode_Delete(my_symbol);
- return 0;
-}
This code will exit with the appropriate message:
-Error 653: Malformed foreground colour target
+ Error 653: Malformed foreground colour 'NONSENSE' (hexadecimal only)
To treat all warnings as errors, set symbol->warn_level to WARN_FAIL_ALL.
5.8 Specifying a Symbology
---------------------------
-Symbologies can be specified by number or by name as shown in the following
-table. For example
-symbol->symbology = BARCODE_LOGMARS;
+Symbologies can be specified by number or by name as shown in the Table :
+{@tbl:barcode_types}. For example
+
+ symbol->symbology = BARCODE_LOGMARS;
means the same as
-symbol->symbology = 50;
-
---------------------------------------------------------------------------------
-Numeric | Name | Barcode Name
-Value |
---------------------------------------------------------------------------------
-1 | BARCODE_CODE11 | Code 11
-2* | BARCODE_C25STANDARD | Standard Code 2 of 5
-3 | BARCODE_C25INTER | Interleaved 2 of 5
-4 | BARCODE_C25IATA | Code 2 of 5 IATA
-6 | BARCODE_C25LOGIC | Code 2 of 5 Data Logic
-7 | BARCODE_C25IND | Code 2 of 5 Industrial
-8 | BARCODE_CODE39 | Code 3 of 9 (Code 39)
-9 | BARCODE_EXCODE39 | Extended Code 3 of 9 (Code 39+)
-13 | BARCODE_EANX | EAN (including EAN-8 and EAN-13)
-14 | BARCODE_EANX_CHK | EAN + Check Digit
-16* | BARCODE_GS1_128 | GS1-128 (UCC.EAN-128)
-18 | BARCODE_CODABAR | Codabar
-20 | BARCODE_CODE128 | Code 128 (automatic subset switching)
-21 | BARCODE_DPLEIT | Deutshe Post Leitcode
-22 | BARCODE_DPIDENT | Deutshe Post Identcode
-23 | BARCODE_CODE16K | Code 16K
-24 | BARCODE_CODE49 | Code 49
-25 | BARCODE_CODE93 | Code 93
-28 | BARCODE_FLAT | Flattermarken
-29* | BARCODE_DBAR_OMN | GS1 DataBar Omnidirectional (including
- | | GS1 DataBar Truncated)
-30* | BARCODE_DBAR_LTD | GS1 DataBar Limited
-31* | BARCODE_DBAR_EXP | GS1 DataBar Expanded
-32 | BARCODE_TELEPEN | Telepen Alpha
-34 | BARCODE_UPCA | UPC-A
-35 | BARCODE_UPCA_CHK | UPC-A + Check Digit
-37 | BARCODE_UPCE | UPC-E
-38 | BARCODE_UPCE_CHK | UPC-E + Check Digit
-40 | BARCODE_POSTNET | POSTNET
-47 | BARCODE_MSI_PLESSEY | MSI Plessey
-49 | BARCODE_FIM | FIM
-50 | BARCODE_LOGMARS | LOGMARS
-51 | BARCODE_PHARMA | Pharmacode One-Track
-52 | BARCODE_PZN | PZN
-53 | BARCODE_PHARMA_TWO | Pharmacode Two-Track
-55 | BARCODE_PDF417 | PDF417
-56* | BARCODE_PDF417COMP | Compact PDF417 (Truncated PDF417)
-57 | BARCODE_MAXICODE | MaxiCode
-58 | BARCODE_QRCODE | QR Code
-60 | BARCODE_CODE128B | Code 128 (Subset B)
-63 | BARCODE_AUSPOST | Australia Post Standard Customer
-66 | BARCODE_AUSREPLY | Australia Post Reply Paid
-67 | BARCODE_AUSROUTE | Australia Post Routing
-68 | BARCODE_AUSDIRECT | Australia Post Redirection
-69 | BARCODE_ISBNX | ISBN (EAN-13 with verification stage)
-70 | BARCODE_RM4SCC | Royal Mail 4 State (RM4SCC)
-71 | BARCODE_DATAMATRIX | Data Matrix (ECC200)
-72 | BARCODE_EAN14 | EAN-14
-73 | BARCODE_VIN | Vehicle Identification Number
-74 | BARCODE_CODABLOCKF | Codablock-F
-75 | BARCODE_NVE18 | NVE-18 (SSCC-18)
-76 | BARCODE_JAPANPOST | Japanese Postal Code
-77 | BARCODE_KOREAPOST | Korea Post
-79* | BARCODE_DBAR_STK | GS1 DataBar Stacked
-80* | BARCODE_DBAR_OMNSTK | GS1 DataBar Stacked Omnidirectional
-81* | BARCODE_DBAR_EXPSTK | GS1 DataBar Expanded Stacked
-82 | BARCODE_PLANET | PLANET
-84 | BARCODE_MICROPDF417 | MicroPDF417
-85* | BARCODE_USPS_IMAIL | USPS Intelligent Mail (OneCode)
-86 | BARCODE_PLESSEY | Plessey Code
-87 | BARCODE_TELEPEN_NUM | Telepen Numeric
-89 | BARCODE_ITF14 | ITF-14
-90 | BARCODE_KIX | Dutch Post KIX Code
-92 | BARCODE_AZTEC | Aztec Code
-93 | BARCODE_DAFT | DAFT Code
-96 | BARCODE_DPD | DPD Code
-97 | BARCODE_MICROQR | Micro QR Code
-98 | BARCODE_HIBC_128 | HIBC Code 128
-99 | BARCODE_HIBC_39 | HIBC Code 39
-102 | BARCODE_HIBC_DM | HIBC Data Matrix ECC200
-104 | BARCODE_HIBC_QR | HIBC QR Code
-106 | BARCODE_HIBC_PDF | HIBC PDF417
-108 | BARCODE_HIBC_MICPDF | HIBC MicroPDF417
-110 | BARCODE_HIBC_BLOCKF | HIBC Codablock-F
-112 | BARCODE_HIBC_AZTEC | HIBC Aztec Code
-115 | BARCODE_DOTCODE | DotCode
-116 | BARCODE_HANXIN | Han Xin (Chinese Sensible) Code
-121 | BARCODE_MAILMARK | Royal Mail 4-state Mailmark
-128 | BARCODE_AZRUNE | Aztec Runes
-129 | BARCODE_CODE32 | Code 32
-130 | BARCODE_EANX_CC | Composite Symbol with EAN linear component
-131* | BARCODE_GS1_128_CC | Composite Symbol with GS1-128 linear
- | | component
-132* | BARCODE_DBAR_OMN_CC | Composite Symbol with GS1 DataBar
- | | Omnidirectional linear component
-133* | BARCODE_DBAR_LTD_CC | Composite Symbol with GS1 DataBar Limited
- | | linear component
-134* | BARCODE_DBAR_EXP_CC | Composite Symbol with GS1 DataBar Expanded
- | | linear component
-135 | BARCODE_UPCA_CC | Composite Symbol with UPC-A linear component
-136 | BARCODE_UPCE_CC | Composite Symbol with UPC-E linear component
-137* | BARCODE_DBAR_STK_CC | Composite Symbol with GS1 DataBar Stacked
- | | component
-138* | BARCODE_DBAR_OMNSTK_CC | Composite Symbol with GS1 DataBar Stacked
- | | Omnidirectional component
-139* | BARCODE_DBAR_EXPSTK_CC | Composite Symbol with GS1 DataBar Expanded
- | | Stacked component
-140 | BARCODE_CHANNEL | Channel Code
-141 | BARCODE_CODEONE | Code One
-142 | BARCODE_GRIDMATRIX | Grid Matrix
-143 | BARCODE_UPNQR | UPNQR (Univerzalnega Plačilnega Naloga QR)
-144 | BARCODE_ULTRA | Ultracode
-145 | BARCODE_RMQR | Rectangular Micro QR Code (rMQR)
---------------------------------------------------------------------------------
-
-Note: Symbologies marked with an asterisk (*) in the above table used different
-names in Zint before version 2.9.0. For example, symbology 29 used the name
-"BARCODE_RSS14". These names are now deprecated but are still recognised by Zint
-and will continue to be supported in future versions.
+ symbol->symbology = 50;
5.9 Adjusting Other Output Options
-----------------------------------
+
The output_options variable can be used to adjust various aspects of the output
file. To select more than one option from the table below simply OR them
together when adjusting this value:
-my_symbol->output_options |= BARCODE_BIND | READER_INIT;
+ my_symbol->output_options |= BARCODE_BIND | READER_INIT;
---------------------------------------------------------------------------------
-Value | Effect
---------------------------------------------------------------------------------
-0 | No options selected.
-BARCODE_BIND | Boundary bars above and below the symbol and between
- | rows if stacking multiple symbols. [2]
-BARCODE_BOX | Add a box surrounding the symbol and whitespace.
-BARCODE_STDOUT | Output the file to stdout.
-READER_INIT | Add a reader initialisation symbol to the data before
- | encoding.
-SMALL_TEXT | Use a smaller font for the Human Readable Text.
-BOLD_TEXT | Embolden the Human Readable Text.
-CMYK_COLOUR | Select the CMYK colour space option for Encapsulated
- | PostScript and TIF files.
-BARCODE_DOTTY_MODE | Plot a matrix symbol using dots rather than squares.
-GS1_GS_SEPARATOR | Use GS instead of FNC1 as GS1 separator (Data Matrix)
-OUT_BUFFER_INTERMEDIATE | Return the bitmap buffer as ASCII values instead of
- | separate colour channels (OUT_BUFFER only).
-BARCODE_QUIET_ZONES | Add compliant quiet zones (additional to any
- | specified whitespace). [3]
-BARCODE_NO_QUIET_ZONES | Disable quiet zones, notably those with defaults. [3]
-COMPLIANT_HEIGHT | Warn if height not compliant and use standard height
- | (if any) as default.
---------------------------------------------------------------------------------
+ -------------------------------------------------------------------------------
+ Value Effect
+ -------------------------- ----------------------------------------------------
+ 0 No options selected.
-[2] This flag is always set for Codablock-F, Code 16K and Code 49. Special
-considerations apply to ITF-14 - see the specific section 6.1.2.6 for that
-symbology.
-[3] 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.
+ BARCODE_BIND Boundary bars above and below the symbol and between
+ rows if stacking multiple symbols.[6]
+
+ BARCODE_BOX Add a box surrounding the symbol and whitespace.
+
+ BARCODE_STDOUT Output the file to stdout.
+
+ READER_INIT Add a reader initialisation symbol to the data
+ before encoding.
+
+ SMALL_TEXT Use a smaller font for the Human Readable Text.
+
+ BOLD_TEXT Embolden the Human Readable Text.
+
+ CMYK_COLOUR Select the CMYK colour space option for Encapsulated
+ PostScript and TIF files.
+
+ BARCODE_DOTTY_MODE Plot a matrix symbol using dots rather than squares.
+
+ GS1_GS_SEPARATOR Use GS instead of FNC1 as GS1 separator (Data Matrix
+ only).
+
+ OUT_BUFFER_INTERMEDIATE Return the bitmap buffer as ASCII values instead of
+ separate colour channels (OUT_BUFFER only).
+
+ BARCODE_QUIET_ZONES Add compliant quiet zones (additional to any
+ specified whitespace).[7]
+
+ BARCODE_NO_QUIET_ZONES Disable quiet zones, notably those with defaults.
+
+ COMPLIANT_HEIGHT Warn if height not compliant and use standard height
+ (if any) as default.
+ -------------------------------------------------------------------------------
+
+ : API output_options Values {#tbl:api_output_options tag=“$ $”}
5.10 Setting the Input Mode
----------------------------
+
The way in which the input data is encoded can be set using the input_mode
property. Valid values are shown in the table below.
---------------------------------------------------------------------------------
-Value | Effect
---------------------------------------------------------------------------------
-DATA_MODE | Uses full 8-bit range interpreted as Latin-1 or binary data
-UNICODE_MODE | Uses pre-formatted UTF-8 input.
-GS1_MODE | Encodes GS1 data using FNC1 characters.
-------------------|-------------------------------------------------------------
-ESCAPE_MODE | Process input data for escape sequences.
-GS1PARENS_MODE | Parentheses (round brackets) used in input data instead of
- | square brackets to delimit GS1 Application Identifiers
- | (parentheses must not otherwise occur in the data).
-GS1NOCHECK_MODE | 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.
-HEIGHTPERROW_MODE | Interpret the height variable as per-row rather than as
- | overall height.
-FAST_MODE | Use faster if less optimal encodation for symbologies that
- | support it (currently DATAMATRIX only).
---------------------------------------------------------------------------------
+ -------------------------------------------------------------------------------
+ Value Effect
+ ------------------- -----------------------------------------------------------
+ DATA_MODE Uses full 8-bit range interpreted as binary data.
+
+ UNICODE_MODE Uses UTF-8 input.
+
+ GS1_MODE Encodes GS1 data using FNC1 characters.
+
+ The above are exclusive, the following optional and OR-ed.
+
+ ESCAPE_MODE Process input data for escape sequences.
+
+ GS1PARENS_MODE Parentheses (round brackets) used in GS1 data instead of
+ square brackets to delimit Application Identifiers
+ (parentheses must not otherwise occur in the data).
+
+ GS1NOCHECK_MODE 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.
+
+ HEIGHTPERROW_MODE Interpret the height variable as per-row rather than as
+ overall height.
+
+ FAST_MODE Use faster if less optimal encodation for symbologies that
+ support it (currently DATAMATRIX only).
+ -------------------------------------------------------------------------------
+
+ : API input_mode Values {#tbl:api_input_mode tag=“$ $”}
The default mode is DATA_MODE. (Note that this differs from the default for the
CLI and GUI, which is UNICODE_MODE.)
@@ -1562,401 +2019,459 @@ DATA_MODE, UNICODE_MODE and GS1_MODE are mutually exclusive, whereas
ESCAPE_MODE, GS1PARENS_MODE, GS1NOCHECK_MODE, HEIGHTPERROW_MODE and FAST_MODE
are optional. So, for example, you can set
-my_symbol->input_mode = UNICODE_MODE | ESCAPE_MODE;
+ my_symbol->input_mode = UNICODE_MODE | ESCAPE_MODE;
or
-my_symbol->input_mode = GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE;
+ my_symbol->input_mode = GS1_MODE | GS1PARENS_MODE | GS1NOCHECK_MODE;
whereas
-my_symbol->input_mode = DATA_MODE | GS1_MODE;
+ my_symbol->input_mode = DATA_MODE | GS1_MODE;
is not valid.
-Permissible escape sequences are listed in section 4.1. An example of
-GS1PARENS_MODE usage is given in section 6.1.11.3.
+Permissible escape sequences are listed in Table {@tbl:escape_sequences}. An
+example of GS1PARENS_MODE usage is given in section 6.1.10.3 GS1-128.
GS1NOCHECK_MODE is for use with legacy systems that have data that does not
-conform to the current GS1 standard. Non-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.).
+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.).
-For HEIGHTPERROW_MODE, see --heightperrow in section 4.4. The height variable
-should be set to the desired per-row value on input (it will be set to the
-overall height on output).
+For HEIGHTPERROW_MODE, see --heightperrow in section 4.4 Adjusting Height. The
+height variable should be set to the desired per-row value on input (it will be
+set to the overall height on output).
5.11 Multiple Segments
-----------------------
+
For input data requiring multiple ECIs, the following functions may be used:
-int ZBarcode_Encode_Segs(struct zint_symbol *symbol,
- const struct zint_seg segs[], const int seg_count);
+ int ZBarcode_Encode_Segs(struct zint_symbol *symbol,
+ const struct zint_seg segs[], const int seg_count);
-int ZBarcode_Encode_Segs_and_Print(struct zint_symbol *symbol,
- const struct zint_seg segs[], const int seg_count, int rotate_angle);
+ int ZBarcode_Encode_Segs_and_Print(struct zint_symbol *symbol,
+ const struct zint_seg segs[], const int seg_count, int rotate_angle);
-int ZBarcode_Encode_Segs_and_Buffer(struct zint_symbol *symbol,
- const struct zint_seg segs[], const int seg_count, int rotate_angle);
+ int ZBarcode_Encode_Segs_and_Buffer(struct zint_symbol *symbol,
+ const struct zint_seg segs[], const int seg_count, int rotate_angle);
-int ZBarcode_Encode_Segs_and_Buffer_Vector(struct zint_symbol *symbol,
- const struct zint_seg segs[], const int seg_count, int rotate_angle);
+ int ZBarcode_Encode_Segs_and_Buffer_Vector(struct zint_symbol *symbol,
+ const struct zint_seg segs[], const int seg_count, int rotate_angle);
-These are direct analogues of ZBarcode_Encode(), ZBarcode_Encode_and_Print(),
-ZBarcode_Encode_and_Buffer() and ZBarcode_Encode_and_Buffer_Vector()
-respectively, where in place of a "source, length" pair you have a "segs,
-seg_count" pair, with "segs" being an array of zint_seg structures and
-"seg_count" being the number of elements it contains. The zint_seg structure is
-of the form:
+These are direct analogues of the previously mentioned ZBarcode_Encode(),
+ZBarcode_Encode_and_Print(), ZBarcode_Encode_and_Buffer() and
+ZBarcode_Encode_and_Buffer_Vector() respectively, where instead of a pair
+consisting of "source, length", a pair consisting of "segs, seg_count" is given,
+with segs being an array of struct zint_seg segments and seg_count being the
+number of elements it contains. The zint_seg structure is of the form:
-struct zint_seg {
- unsigned char *source; /* Data to encode */
- int length; /* Length of `source`. If 0, `source` must be
- NUL-terminated */
- int eci; /* Extended Channel Interpretation */
-};
-
-The symbology must of course support ECIs, i.e. be Aztec Code, Code One, Data
-Matrix, DotCode, Grid Matrix, Han Xin Code, MaxiCode, PDF417, MicroPDF417, QR
-Code, rMQR, or Ultracode. For example:
-
-#include
-int main(int argc, char **argv)
-{
- struct zint_seg segs[] = {
- { "Κείμενο", 0, 9 },
- { "Текст", 0, 7 },
- { "文章", 0, 20 }
+ struct zint_seg {
+ unsigned char *source; /* Data to encode */
+ int length; /* Length of `source`. If 0, `source` must be
+ NUL-terminated */
+ int eci; /* Extended Channel Interpretation */
};
- struct zint_symbol *my_symbol;
- my_symbol = ZBarcode_Create();
- my_symbol->symbology = BARCODE_AZTEC;
- my_symbol->input_mode = UNICODE_MODE;
- ZBarcode_Encode_Segs(my_symbol, segs, 3);
- ZBarcode_Print(my_symbol, 0);
- ZBarcode_Delete(my_symbol);
- return 0;
-}
+
+The symbology must support ECIs (see Table {@tbl:eci_aware_symbologies}). For
+example:
+
+ #include
+ int main(int argc, char **argv)
+ {
+ struct zint_seg segs[] = {
+ { "Κείμενο", 0, 9 },
+ { "Текст", 0, 7 },
+ { "文章", 0, 20 }
+ };
+ struct zint_symbol *my_symbol;
+ my_symbol = ZBarcode_Create();
+ my_symbol->symbology = BARCODE_AZTEC;
+ my_symbol->input_mode = UNICODE_MODE;
+ ZBarcode_Encode_Segs(my_symbol, segs, 3);
+ ZBarcode_Print(my_symbol, 0);
+ ZBarcode_Delete(my_symbol);
+ return 0;
+ }
A maximum of 256 segments may be specified. Use of multiple segments with GS1
data is not currently supported.
5.12 Verifying Symbology Availability
--------------------------------------
-An additional function available in the API is defined as:
-int ZBarcode_ValidID(int symbol_id);
+An additional function available in the API is:
-This function allows you to check whether a given symbology is available. A
-non-zero return value indicates that the given symbology is available. For
-example:
+ int ZBarcode_ValidID(int symbol_id);
-if (ZBarcode_ValidID(BARCODE_PDF417) != 0) {
- printf("PDF417 available\n");
-} else {
- printf("PDF417 not available\n");
-}
+which allows you to check whether a given symbology is available, returning a
+non-zero value if so. For example:
+
+ if (ZBarcode_ValidID(BARCODE_PDF417) != 0) {
+ printf("PDF417 available\n");
+ } else {
+ printf("PDF417 not available\n");
+ }
Another function that may be useful is:
-int ZBarcode_BarcodeName(int symbol_id, char name[32]);
+ int ZBarcode_BarcodeName(int symbol_id, char name[32]);
-which copies the name of a symbology into the supplied "name" buffer, which
-should be 32 characters in length. The name is NUL-terminated, and zero is
-returned on success. For instance:
+which copies the name of a symbology into the supplied name buffer, which should
+be 32 characters in length. The name is NUL-terminated, and zero is returned on
+success. For instance:
-char name[32];
-if (ZBarcode_BarcodeName(BARCODE_PDF417, name) == 0) {
- printf("%s\n", name);
-}
+ char name[32];
+ if (ZBarcode_BarcodeName(BARCODE_PDF417, name) == 0) {
+ printf("%s\n", name);
+ }
-will print "BARCODE_PDF417".
+will print BARCODE_PDF417.
5.13 Checking Symbology Capabilities
-------------------------------------
+
It can be useful for frontend programs to know the capabilities of a symbology.
This can be determined using another additional function:
-unsigned int ZBarcode_Cap(int symbol_id, unsigned int cap_flag);
+ unsigned int ZBarcode_Cap(int symbol_id, unsigned int cap_flag);
-by OR-ing the flags below in the "cap_flag" argument and checking the return to
+by OR-ing the flags below in the cap_flag argument and checking the return to
see which are set.
---------------------------------------------------------------------------------
-Value | Meaning
---------------------------------------------------------------------------------
-ZINT_CAP_HRT | Can the symbology print Human Readable Text?
-ZINT_CAP_STACKABLE | Is the symbology stackable?
-ZINT_CAP_EXTENDABLE | Is the symbology extendable with add-on data?
- | (i.e. is it UPC/EAN?)
-ZINT_CAP_COMPOSITE | Does the symbology support composite data?
- | (see 6.3 below)
-ZINT_CAP_ECI | Does the symbology support Extended Channel
- | Interpretations?
-ZINT_CAP_GS1 | Does the symbology support GS1 data?
-ZINT_CAP_DOTTY | Can the symbology be outputted as dots?
-ZINT_CAP_QUIET_ZONES | Does the symbology have default quiet zones?
-ZINT_CAP_FIXED_RATIO | Does the symbology have a fixed width-to-height
- | (aspect) ratio?
-ZINT_CAP_READER_INIT | Does the symbology support Reader Initialisation?
-ZINT_CAP_FULL_MULTIBYTE | Is the ZINT_FULL_MULTIBYTE option applicable?
-ZINT_CAP_MASK | Is mask selection applicable?
-ZINT_CAP_STRUCTAPP | Does the symbology support Structured Append?
-ZINT_CAP_COMPLIANT_HEIGHT | Does the symbology have a compliant height defined?
---------------------------------------------------------------------------------
+ -------------------------------------------------------------------------------
+ Value Meaning
+ --------------------------- ---------------------------------------------------
+ ZINT_CAP_HRT Can the symbology print Human Readable Text?
+
+ ZINT_CAP_STACKABLE Is the symbology stackable?
+
+ ZINT_CAP_EXTENDABLE Is the symbology extendable with add-on data? (i.e.
+ is it UPC/EAN?)
+
+ ZINT_CAP_COMPOSITE Does the symbology support composite data? (see 6.3
+ Composite Symbols (ISO 24723) below)
+
+ ZINT_CAP_ECI Does the symbology support Extended Channel
+ Interpretations?
+
+ ZINT_CAP_GS1 Does the symbology support GS1 data?
+
+ ZINT_CAP_DOTTY Can the symbology be outputted as dots?
+
+ ZINT_CAP_QUIET_ZONES Does the symbology have default quiet zones?
+
+ ZINT_CAP_FIXED_RATIO Does the symbology have a fixed width-to-height
+ (aspect) ratio?
+
+ ZINT_CAP_READER_INIT Does the symbology support Reader Initialisation?
+
+ ZINT_CAP_FULL_MULTIBYTE Is the ZINT_FULL_MULTIBYTE option applicable?
+
+ ZINT_CAP_MASK Is mask selection applicable?
+
+ ZINT_CAP_STRUCTAPP Does the symbology support Structured Append?
+
+ ZINT_CAP_COMPLIANT_HEIGHT Does the symbology have a compliant height defined?
+ -------------------------------------------------------------------------------
+
+ : {#tbl:api_cap tag=“: API Capability Flags”}
For example:
-unsigned int cap = ZBarcode_Cap(BARCODE_PDF417, ZINT_CAP_HRT | ZINT_CAP_ECI);
-if (cap & ZINT_CAP_HRT) {
- printf("PDF417 supports HRT\n");
-} else {
- printf("PDF417 does not support HRT\n");
-}
-if (cap & ZINT_CAP_ECI) {
- printf("PDF417 supports ECI\n");
-} else {
- printf("PDF417 does not support ECI\n");
-}
+ unsigned int cap = ZBarcode_Cap(BARCODE_PDF417, ZINT_CAP_HRT | ZINT_CAP_ECI);
+ if (cap & ZINT_CAP_HRT) {
+ printf("PDF417 supports HRT\n");
+ } else {
+ printf("PDF417 does not support HRT\n");
+ }
+ if (cap & ZINT_CAP_ECI) {
+ printf("PDF417 supports ECI\n");
+ } else {
+ printf("PDF417 does not support ECI\n");
+ }
5.14 Zint Version
------------------
+
Lastly, the version of the Zint library linked to is returned by:
-int ZBarcode_Version(void);
+ int ZBarcode_Version();
The version parts are separated by hundreds. For instance, version "2.9.1" is
returned as "20901".
-
6. Types of Symbology
-=====================
+
6.1 One-Dimensional Symbols
----------------------------
-One-Dimensional 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.
+
+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.
6.1.1 Code 11
--------------
+
+[zint -b CODE11 -d "9212320967"]
+
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 (\-) up to a maximum of 121 characters.
-Two modulo-11 check digits are added by default. To add just one check digit,
-set option_2 = 1 or --vers=1. To add no check digits, set option_2 = 2 or
---vers=2.
+the digits 0-9 and the dash character (-) up to a maximum of 121 characters. Two
+modulo-11 check digits are added by default. To add just one check digit, set
+--vers=1 (API option_2 = 1). To add no check digits, set --vers=2 (API
+option_2 = 2).
6.1.2 Code 2 of 5
------------------
+
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.
6.1.2.1 Standard Code 2 of 5
-----------------------------
+
+[zint -b C25STANDARD -d "9212320967"]
+
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 80 digits. No check digit is added by
-default. To add a check digit, set option_2 = 1 or --vers=1. To add a check
-digit but not show it in the Human Readable Text, set option_2 = 2 or --vers=2.
+default. To add a check digit, set --vers=1 (API option_2 = 1). To add a check
+digit but not show it in the Human Readable Text, set --vers=2 (API
+option_2 = 2).
6.1.2.2 IATA Code 2 of 5
-------------------------
-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 45 digits. No check digit is added by default. To add a
-check digit, set option_2 = 1 or --vers=1. To add a check digit but not show it
-in the Human Readable Text, set option_2 = 2 or --vers=2.
+
+[zint -b C25IATA -d "9212320967"]
+
+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 45 digits. No check digit is added by default. To add a check
+digit, set --vers=1 (API option_2 = 1). To add a check digit but not show it in
+the Human Readable Text, set --vers=2 (API option_2 = 2).
6.1.2.3 Industrial Code 2 of 5
-------------------------------
+
+[zint -b C25IND -d "9212320967"]
+
Industrial Code 2 of 5 can encode numeric input (digits 0-9) up to a maximum of
45 digits. No check digit is added by default. To add a check digit, set
-option_2 = 1 or --vers=1. To add a check digit but not show it in the Human
-Readable Text, set option_2 = 2 or --vers=2.
+--vers=1 (API option_2 = 1). To add a check digit but not show it in the Human
+Readable Text, set --vers=2 (API option_2 = 2).
6.1.2.4 Interleaved Code 2 of 5 (ISO 16390)
--------------------------------------------
-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
+
+[zint -b C25INTER --compliantheight -d "9212320967"]
+
+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 45 pairs (90 digits) can be encoded. No
-check digit is added by default. To add a check digit, set option_2 = 1 or
---vers=1. To add a check digit but not show it in the Human Readable Text, set
-option_2 = 2 or --vers=2.
+check digit is added by default. To add a check digit, set --vers=1 (API
+option_2 = 1). To add a check digit but not show it in the Human Readable Text,
+set --vers=2 (API option_2 = 2).
6.1.2.5 Code 2 of 5 Data Logic
-------------------------------
+
+[zint -b C25LOGIC -d "9212320967"]
+
Data Logic does not include a check digit by default and can encode numeric
input (digits 0-9) up to a maximum of 80 digits. To add a check digit, set
-option_2 = 1 or --vers=1. To add a check digit but not show it in the Human
-Readable Text, set option_2 = 2 or --vers=2.
+--vers=1 (API option_2 = 1). To add a check digit but not show it in the Human
+Readable Text, set --vers=2 (API option_2 = 2).
6.1.2.6 ITF-14
---------------
-ITF-14, also known as UPC Shipping Container Symbol or Case Code is based on
+
+[zint -b ITF14 --compliantheight -d "9212320967145"]
+
+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.
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 --bind option
-(or adding BARCODE_BIND to symbol->output_options). Similarly the border width
-can be overridden using --border= (or by setting symbol->border_width). If a
-symbol with no border is required this can be achieved by explicitly setting
-the border type to box (or bind) and setting the border width to 0.
+(API output_options |= BARCODE_BIND). Similarly the border width can be
+overridden using --border (API border_width). If a symbol with no border is
+required this can be achieved by explicitly setting the border type to box (or
+bind) and leaving the border width 0.
+
+[zint -b ITF14 --box --compliantheight -d "9212320967145"]
6.1.2.7 Deutsche Post Leitcode
-------------------------------
+
+[zint -b DPLEIT -d "9212320967145"]
+
Leitcode is based on Interleaved Code 2 of 5 and is used by Deutsche Post for
mailing purposes. Leitcode requires a 13-digit numerical input and includes a
check digit.
6.1.2.8 Deutsche Post Identcode
--------------------------------
+
+[zint -b DPIDENT -d "91232096712"]
+
Identcode is based on Interleaved Code 2 of 5 and is used by Deutsche Post for
mailing purposes. Identcode requires an 11-digit numerical input and includes a
check digit.
-6.1.3 Universal Product Code (EN 797)
--------------------------------------
+6.1.3 Universal Product Code (ISO 15420)
+
6.1.3.1 UPC Version A
----------------------
+
+[zint -b UPCA --compliantheight -d "72527270270"]
+
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 + 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:
-zint --barcode=UPCA -d 72527270270+12345
+ zint -b UPCA -d 72527270270+12345
or encode a data string with the + character included:
-my_symbol->symbology = BARCODE_UPCA;
+ my_symbol->symbology = BARCODE_UPCA;
-error = ZBarcode_Encode_and_Print(my_symbol, "72527270270+12345", 0, 0);
+ error = ZBarcode_Encode_and_Print(my_symbol, "72527270270+12345", 0, 0);
+
+[zint -b UPCA --compliantheight -d "72527270270+12345"]
If your input data already includes the check digit symbology BARCODE_UPCA_CHK
(35) can be used which takes a 12 digit input and validates the check digit
before encoding.
-You can adjust the gap between the main symbol and an add-on in multiples of
-the X-dimension by setting --addongap= (option_2) to a value between 9 (default)
+You can adjust the gap between the main symbol and an add-on in multiples of the
+X-dimension by setting --addongap (API option_2) 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 --guarddescent= (variable guard_descent in the
-symbol structure) to a value between 0 and 20 (default 5).
+bars can be adjusted by setting --guarddescent (API guard_descent) to a value
+between 0 and 20 (default 5).
6.1.3.2 UPC Version E
----------------------
+
+[zint -b UPCE --compliantheight -d "1123456"]
+
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 stating with the digit 1. For
-example:
+character as with UPC-A. In addition Zint also supports Number System 1 encoding
+by entering a 7-digit article number stating with the digit 1. For example:
-zint --barcode=UPCE -d 1123456
+ zint -b UPCE -d 1123456
or
-my_symbol->symbology = BARCODE_UPCE;
+ my_symbol->symbology = BARCODE_UPCE;
-error = ZBarcode_Encode_and_Print(my_symbol, "1123456", 0, 0);
+ error = ZBarcode_Encode_and_Print(my_symbol, "1123456", 0, 0);
If your input data already includes the check digit symbology BARCODE_UPCE_CHK
(38) can be used which takes a 7 or 8 digit input and validates the check digit
before encoding.
-You can adjust the gap between the main symbol and an add-on in multiples of
-the X-dimension by setting --addongap= (option_2) to a value between 7 (default)
+You can adjust the gap between the main symbol and an add-on in multiples of the
+X-dimension by setting --addongap (API option_2) 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 --guarddescent= (variable guard_descent in the
-symbol structure) to a value between 0 and 20 (default 5).
+bars can be adjusted by setting --guarddescent (API guard_descent) to a value
+between 0 and 20 (default 5).
+
+6.1.4 European Article Number (ISO 15420)
-6.1.4 European Article Number (EN 797)
---------------------------------------
6.1.4.1 EAN-2, EAN-5, EAN-8 and EAN-13
---------------------------------------
-The EAN system is used in retail across Europe and includes standards for EAN-2
-and EAN-5 add-on codes, 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 using the + character as with UPC symbols. For example:
-zint --barcode=EANX -d 54321
+[zint -b EANX --compliantheight -d "4512345678906"]
+
+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 + character as with UPC symbols. For example:
+
+ zint -b EANX -d 54321
+
+[zint -b EANX --compliantheight -d "54321"]
will encode a stand-alone EAN-5, whereas
-zint --barcode=EANX -d 7432365+54321
+ zint -b EANX -d 7432365+54321
-will encode an EAN-8 symbol with an EAN-5 add-on. As before these results can
-be achieved using the API:
+will encode an EAN-8 symbol with an EAN-5 add-on. As before these results can be
+achieved using the API:
-my_symbol->symbology = BARCODE_EANX;
+ my_symbol->symbology = BARCODE_EANX;
-error = ZBarcode_Encode_and_Print(my_symbol, "54321", 0, 0);
+ error = ZBarcode_Encode_and_Print(my_symbol, "54321", 0, 0);
-error = ZBarcode_Encode_and_Print(my_symbol, "7432365+54321", 0, 0);
+ error = ZBarcode_Encode_and_Print(my_symbol, "7432365+54321", 0, 0);
+
+[zint -b EANX --compliantheight -d "7432365+54321"]
All of the EAN symbols include check digits which are added by Zint.
-If you are encoding an EAN-8 or EAN-13 symbol and your data already includes
-the check digit then you can use symbology BARCODE_EANX_CHK (14) which takes an
-8 or 13 digit input and validates the check digit before encoding.
+If you are encoding an EAN-8 or EAN-13 symbol and your data already includes the
+check digit then you can use symbology BARCODE_EANX_CHK (14) which takes an 8 or
+13 digit input and validates the check digit before encoding.
-You can adjust the gap between the main symbol and an add-on in multiples of
-the X-dimension by setting --addongap= (option_2) to a value between 7 (default)
+You can adjust the gap between the main symbol and an add-on in multiples of the
+X-dimension by setting --addongap (API option_2) 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 --guarddescent= (variable guard_descent in the
-symbol structure) to a value between 0 and 20 (default 5).
+bars can be adjusted by setting --guarddescent (API guard_descent) to a value
+between 0 and 20 (default 5).
6.1.4.2 SBN, ISBN and ISBN-13
------------------------------
-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
+
+[zint -b ISBNX --compliantheight -d "9789295055124"]
+
+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. In addition EAN-2 and EAN-5 add-on symbols can be added using the +
-character as with UPC symbols, and the gap set with --addongap= (option_2) to
+character as with UPC symbols, and the gap set with --addongap (API option_2) to
between 7 (default) and 12. The height that the guard bars descend can be
-adjusted by setting --guarddescent= (variable guard_descent in the symbol
-structure) to a value between 0 and 20 (default 5).
+adjusted by setting --guarddescent (API guard_descent) to a value between 0 and
+20 (default 5).
6.1.5 Plessey
--------------
+
+6.1.5.1 UK Plessey
+
+[zint -b PLESSEY -d "C64"]
+
Also known as Plessey Code, this symbology was developed by the Plessey Company
-Ltd. in the UK. The symbol can encode any length data consisting of digits
-(0-9) or letters A-F and includes a CRC check digit.
+Ltd. in the UK. The symbol can encode data consisting of digits (0-9) or letters
+A-F up to a maximum of 65 characters and includes a CRC check digit.
+
+6.1.5.2 MSI Plessey
+
+[zint -b MSI_PLESSEY -d "6502" --vers=2]
-6.1.6 MSI Plessey
------------------
Based on Plessey and developed by MSE Data Corporation, MSI Plessey has a range
-of check digit options that are selectable by setting option_2 or by using the
---vers= switch. Numeric (digits 0-9) input can be encoded, up to a maximum of 65
-digits. The table below shows the options available:
+of check digit options that are selectable by setting --vers (API option_2).
+Numeric (digits 0-9) input can be encoded, up to a maximum of 65 digits. The
+table below shows the options available:
--------------------------------------------
-Value of option_2 | Check Digits
--------------------------------------------
-0 | None
-1 | Modulo-10 (Luhn)
-2 | Modulo-10 & Modulo-10
-3 | Modulo-11 (IBM)
-4 | Modulo-11 (IBM) & Modulo-10
-5 | Modulo-11 (NCR)
-6 | Modulo-11 (NCR) & Modulo-10
--------------------------------------------
+ Value Check Digits
+ ------- -----------------------------
+ 0 None
+ 1 Modulo-10 (Luhn)
+ 2 Modulo-10 & Modulo-10
+ 3 Modulo-11 (IBM)
+ 4 Modulo-11 (IBM) & Modulo-10
+ 5 Modulo-11 (NCR)
+ 6 Modulo-11 (NCR) & Modulo-10
+
+ : {#tbl:msi_plessey_check_digits tag=“: MSI Plessey Check Digit Options”}
To not show the check digit or digits in the Human Readable Text, add 10 to the
-option_2 value.
+--vers value. For example --vers=12 (API option_2 = 12) will add two hidden
+modulo-10 check digits.
+
+6.1.6 Telepen
+
+6.1.6.1 Telepen Alpha
+
+[zint -b TELEPEN --compliantheight -d "Z80"]
-6.1.7 Telepen
--------------
-6.1.7.1 Telepen Alpha
----------------------
Telepen Alpha was developed by SB Electronic Systems Limited and can encode
ASCII text input, up to a maximum of 30 characters. Telepen includes a
modulo-127 check digit.
-6.1.7.2 Telepen Numeric
------------------------
+6.1.6.2 Telepen Numeric
+
+[zint -b TELEPEN_NUM --compliantheight -d "466X33"]
+
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
@@ -1964,101 +2479,128 @@ followed an X character. For example: 466333 and 466X33 are valid codes whereas
encoded. Telepen Numeric includes a modulo-127 check digit which is added by
Zint.
-6.1.8 Code 39
--------------
-6.1.8.1 Standard Code 39 (ISO 16388)
-------------------------------------
+6.1.7 Code 39
+
+6.1.7.1 Standard Code 39 (ISO 16388)
+
+[zint -b CODE39 --compliantheight -d "1A" --vers=1]
+
Standard Code 39 was developed in 1974 by Intermec. Input data can be up to 85
characters in length and can include the characters 0-9, A-Z, dash (-), full
stop (.), space, asterisk (*), dollar ($), slash (/), plus (+) and percent (%).
The standard does not require a check digit but a modulo-43 check digit can be
-added if required by setting option_2 = 1 or using --vers=1.
+added if required by setting --vers=1 (API option_2 = 1).
+
+6.1.7.2 Extended Code 39
+
+[zint -b EXCODE39 --compliantheight -d "123.45$@fd"]
-6.1.8.2 Extended Code 39
-------------------------
Also known as Code 39e and Code39+, this symbology expands on Standard Code 39
-to provide support to the full ASCII character set. The standard does not
+to provide support for the full 7-bit ASCII character set. The standard does not
require a check digit but a modulo-43 check digit can be added if required by
-setting option_2 = 1 or using --vers=1.
+setting --vers=1 (API option_2 = 1).
+
+6.1.7.3 Code 93
+
+[zint -b CODE93 --compliantheight -d "C93"]
-6.1.8.3 Code 93
----------------
A variation of Extended Code 39, Code 93 also supports full ASCII text. 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 option_2 = 1 or
-using --vers=1.
+shown in the Human Readable Text, but may be shown by setting --vers=1 (API
+option_2 = 1).
+
+6.1.7.4 PZN (Pharmazentralnummer)
+
+[zint -b PZN --compliantheight -d "2758089"]
-6.1.8.4 PZN (Pharmazentralnummer)
----------------------------------
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.
-6.1.8.5 LOGMARS
----------------
-LOGMARS (Logistics Applications of Automated Marking and Reading Symbols) is a
-variation of the Code 39 symbology used by the US Department of Defense.
-LOGMARS encodes the same character set as Standard Code 39. It does not require
-a check digit but a modulo-43 check digit can be added by setting option_2 = 1
-or using --vers=1.
+6.1.7.5 LOGMARS
-6.1.8.6 Code 32
----------------
-A variation of Code 39 used by the Italian Ministry of Health ("Ministero della
-Sanità") for encoding identifiers on pharmaceutical products. This symbology
+[zint -b LOGMARS --compliantheight -d "12345/ABCDE" --vers=1]
+
+LOGMARS (Logistics Applications of Automated Marking and Reading Symbols) is a
+variation of the Code 39 symbology used by the US Department of Defense. LOGMARS
+encodes the same character set as Standard Code 39. It does not require a check
+digit but a modulo-43 check digit can be added by setting --vers=1 (API
+option_2 = 1).
+
+6.1.7.6 Code 32
+
+[zint -b CODE32 --compliantheight -d "14352312"]
+
+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.
-6.1.8.7 HIBC Code 39
---------------------
-This option adds a leading '+' character and a trailing modulo-49 check digit
-to a standard Code 39 symbol as required by the Health Industry Barcode
-standards.
+6.1.7.7 HIBC Code 39
+
+[zint -b HIBC_39 --compliantheight -d "14352312"]
+
+This option adds a leading '+' character and a trailing modulo-49 check digit to
+a standard Code 39 symbol as required by the Health Industry Barcode standards.
+
+6.1.7.8 Vehicle Identification Number (VIN)
+
+[zint -b VIN -d "2FTPX28L0XCA15511" --vers=1]
-6.1.8.8 Vehicle Identification Number (VIN)
--------------------------------------------
A variation of Code 39 that for vehicle identification numbers used in North
-America (first character '1' to '5') has a check character verification stage.
-An Import character prefix 'I' can be added by setting option_2 = 1 or using
---vers=1.
+America (first character '1' to '5') has a check character verification stage. A
+17 character input (0-9, and A-Z excluding 'I', 'O' and 'Q') is required. An
+invisible Import character prefix 'I' can be added by setting --vers=1 (API
+option_2 = 1).
+
+6.1.8 Codabar (EN 798)
+
+[zint -b CODABAR --compliantheight -d "A37859B"]
-6.1.9 Codabar (EN 798)
-----------------------
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 60 characters
starting and ending with the letters A-D and containing between these letters
the numbers 0-9, dash (-), dollar ($), colon (:), slash (/), full stop (.) or
-plus (+). No check characater is generated by default, but a modulo-16 one can
-be added by setting option_2 = 1 or using --vers=1. To have the check character
-appear in the Human Readable Text, set option_2 = 2 or --vers=2.
+plus (+). No check character is generated by default, but a modulo-16 one can be
+added by setting --vers=1 (API option_2 = 1). To have the check character appear
+in the Human Readable Text, set --vers=2 (API option_2 = 2).
+
+6.1.9 Pharmacode
+
+[zint -b PHARMA --compliantheight -d "130170"]
-6.1.10 Pharmacode
------------------
Developed by Laetus, Pharmacode is used for the identification of
pharmaceuticals. The symbology is able to encode whole numbers between 3 and
131070.
-6.1.11 Code 128
----------------
-6.1.11.1 Standard Code 128 (ISO 15417)
---------------------------------------
+6.1.10 Code 128
+
+6.1.10.1 Standard Code 128 (ISO 15417)
+
+[zint -b CODE128 --bind -d "130170X178"]
+
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-mode system to compress the data into a smaller symbol. Zint
-automatically switches between modes and adds a modulo-103 check digit. Code
-128 is the default barcode symbology used by Zint. In addition Zint supports
-the encoding of Latin-1 (non-English) characters in Code 128 symbols. The
-Latin-1 character set is shown in Appendix A.
+automatically switches between modes and adds a modulo-103 check digit. 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 Appendix A.2 Latin Alphabet No. 1
+(ISO/IEC 8859-1).
-6.1.11.2 Code 128 Subset B
---------------------------
-It is sometimes advantageous to stop Code 128 from beginning in subset mode C
-which compresses numerical data. The BARCODE_CODE128B option (symbology 60)
-suppresses beginning in mode C in favour of mode B.
+6.1.10.2 Code 128 Subset B
+
+[zint -b CODE128B -d "130170X178"]
+
+It is sometimes advantageous to stop Code 128 from using subset mode C which
+compresses numerical data. The BARCODE_CODE128B option (symbology 60) suppresses
+mode C in favour of mode B.
+
+6.1.10.3 GS1-128
+
+[zint -b GS1_128 --compliantheight -d "[01]98898765432106[3202]012345[15]991231"]
-6.1.11.3 GS1-128
-----------------
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
@@ -2066,358 +2608,429 @@ parentheses (round brackets) for the Human Readable Text. This will allow round
brackets to be used in the data strings to be encoded.
For compatibility with data entry in other systems, if the data does not include
-round brackets, the option --gs1parens (API input_mode |= GS1PARENS_MODE;) may
-be used to signal that AIs are encased in round brackets instead of square ones.
+round brackets, the option --gs1parens (API input_mode |= GS1PARENS_MODE) may be
+used to signal that AIs are encased in round brackets instead of square ones.
Fixed length data should be entered at the appropriate length for correct
encoding. GS1-128 does not support extended ASCII characters. Check digits for
-GTIN data (AI 01) are not generated and need to be included in the input data.
+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:
-zint --barcode=16 -d "[01]98898765432106[3202]012345[15]991231"
+ zint -b 16 -d "[01]98898765432106[3202]012345[15]991231"
or using the --gs1parens option:
-zint --barcode=16 --gs1parens -d "(01)98898765432106(3202)012345(15)991231"
+ zint -b 16 --gs1parens -d "(01)98898765432106(3202)012345(15)991231"
+
+6.1.10.4 EAN-14
+
+[zint -b EAN14 --compliantheight -d "9889876543210"]
-6.1.11.4 EAN-14
----------------
A shorter version of GS1-128 which encodes GTIN data only. A 13 digit number is
required. The GTIN check digit and AI (01) are added by Zint.
-6.1.11.5 NVE-18 (SSCC-18)
--------------------------
-A variation of Code 128 the 'Nummer der Versandeinheit' standard, also known as
+6.1.10.5 NVE-18 (SSCC-18)
+
+[zint -b NVE18 --compliantheight -d "37612345000001003"]
+
+A variation of Code 128 the ‘Nummer der Versandeinheit’ standard, also known as
SSCC-18 (Serial Shipping Container Code), includes both modulo-10 and modulo-103
check digits. NVE-18 requires a 17 digit numerical input. Check digits and AI
(00) are added by Zint.
-6.1.11.6 HIBC Code 128
-----------------------
-This option adds a leading '+' character and a trailing modulo-49 check digit
-to a standard Code 128 symbol as required by the Health Industry Barcode
-standards.
+6.1.10.6 HIBC Code 128
-6.1.11.7 DPD Code
------------------
-Another variation of Code 128 as used by DPD (Deutsher Paket Dienst). Requires
-a 28 character alphanumeric input. Zint formats Human Readable Text as
-specified by DPD and adds a modulo-36 check character.
+[zint -b HIBC_128 -d "A123BJC5D6E71"]
+
+This option adds a leading '+' character and a trailing modulo-49 check digit to
+a standard Code 128 symbol as required by the Health Industry Barcode standards.
+
+6.1.10.7 DPD Code
+
+[zint -b DPD --compliantheight -d "%000393206219912345678101040"]
+
+Another variation of Code 128 as used by DPD (Deutsher Paket Dienst). Requires a
+28 character alphanumeric input. Zint formats Human Readable Text as specified
+by DPD and adds a modulo-36 check character.
+
+6.1.11 GS1 DataBar (ISO 24724)
-6.1.12 GS1 DataBar (ISO 24724)
-------------------------------
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
-24723 set option_1 = 2 or use the option --mode=2 at the command prompt. See
-section 6.3 of this manual to find out how to generate DataBar symbols with 2D
-components.
+GS1 DataBar symbol is to be printed with a 2D component as specified in ISO/IEC
+24723 set --mode=2 (API option_1 = 2). See 6.3 Composite Symbols (ISO 24723) to
+find out how to generate DataBar symbols with 2D components.
+
+6.1.11.1 GS1 DataBar Omnidirectional and GS1 DataBar Truncated
+
+[zint -b DBAR_OMN --compliantheight -d "0950110153001"]
-6.1.12.1 DataBar Omnidirectional and DataBar Truncated
-------------------------------------------------------
Previously known as RSS-14 this standard encodes a 13 digit item code. A check
digit and Application Identifier of (01) 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.) To produce a truncated symbol set the symbol height to a value
-between 32 and 13. Normal DataBar Omnidirectional symbols should have a height
-of 33 or greater.
+between 13 and 32. Truncated symbols may not be scannable by omnidirectional
+scanners. Normal DataBar Omnidirectional symbols should have a height of 33 or
+greater.
+
+[zint -b DBAR_OMN -d "0950110153001" --height=13]
+
+6.1.11.2 GS1 DataBar Limited
+
+[zint -b DBAR_LTD --compliantheight -d "0950110153001"]
-6.1.12.2 DataBar Limited
-------------------------
Previously known as RSS Limited this standard encodes a 13 digit item code and
-can be used in the same way as DataBar above. DataBar Limited, however, is
-limited to data starting with digits 0 and 1 (i.e. numbers in the range 0 to
-1999999999999). As with DataBar Omnidirectional a check digit and Application
-Identifier of (01) are added by Zint, and a 14 digit code may be given in which
-case the check digit will be verified.
+can be used in the same way as DataBar Omnidirectional above. DataBar Limited,
+however, is limited to data starting with digits 0 and 1 (i.e. numbers in the
+range 0 to 1999999999999). As with DataBar Omnidirectional a check digit and
+Application Identifier of (01) are added by Zint, and a 14 digit code may be
+given in which case the check digit will be verified.
+
+6.1.11.3 GS1 DataBar Expanded
+
+[zint -b DBAR_EXP --compliantheight -d "[01]98898765432106[3202]012345[15]991231"]
-6.1.12.3 DataBar Expanded
--------------------------
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. This will be converted to parentheses
(round brackets) before it is 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 --gs1parens switch. See section 6.1.11.3.
+encoded. If the data does not include parentheses, the AIs may alternatively be
+encased in parentheses using the --gs1parens switch. See 6.1.10.3 GS1-128.
-GTIN data (AI 01) should also include the check digit data as this is not
+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 DataBar Expanded input:
-zint --barcode=31 -d "[01]98898765432106[3202]012345[15]991231"
+ zint -b 31 -d "[01]98898765432106[3202]012345[15]991231"
+
+6.1.12 Korea Post Barcode
+
+[zint -b KOREAPOST -d "923457"]
-6.1.13 Korea Post Barcode
--------------------------
The Korean Postal Barcode is used to encode a six-digit number and includes one
check digit.
-6.1.14 Channel Code
--------------------
+6.1.13 Channel Code
+
+[zint -b CHANNEL -d "453678" --compliantheight]
+
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
-option_2 or using the --vers= option. 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. The maximum values permitted depend on the number of channels used as
-shown in the table below:
+the --vers option (API option_2). 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.
---------------------------------------------
-Channels | Minimum Value | Maximum Value
---------------------------------------------
-3 | 00 | 26
-4 | 000 | 292
-5 | 0000 | 3493
-6 | 00000 | 44072
-7 | 000000 | 576688
-8 | 0000000 | 7742862
---------------------------------------------
+The maximum values permitted depend on the number of channels used as shown in
+the table below:
+
+ Channels Minimum Value Maximum Value
+ ---------- --------------- ---------------
+ 3 00 26
+ 4 000 292
+ 5 0000 3493
+ 6 00000 44072
+ 7 000000 576688
+ 8 0000000 7742862
+
+ : {#tbl:channel_maxima tag=“: Channel Maximum Values”}
6.2 Stacked Symbologies
------------------------
-6.2.1 Basic Symbol Stacking
----------------------------
-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
-zint -d "This" -d "That"
+6.2.1 Basic Symbol Stacking
+
+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
+
+ zint -d "This" -d "That"
will draw two Code 128 symbols, one on top of the other. The same result can be
achieved using the API by executing the ZBarcode_Encode() function more than
once on a symbol. For example:
-my_symbol->symbology = BARCODE_CODE128;
+ my_symbol->symbology = BARCODE_CODE128;
-error = ZBarcode_Encode(my_symbol, "This", 0);
+ error = ZBarcode_Encode(my_symbol, "This", 0);
-error = ZBarcode_Encode(my_symbol, "That", 0);
+ error = ZBarcode_Encode(my_symbol, "That", 0);
-error = ZBarcode_Print(my_symbol);
+ error = ZBarcode_Print(my_symbol);
-Note that the Human Readable Text will be that of the last data, so it's best to
+[zint -d "This" -d "That"]
+
+Note that the Human Readable Text will be that of the last data, so it’s best to
use the option --notext (API show_hrt = 0).
The stacked barcode rows can be separated by row separator bars by specifying
---bind (output_options |= BARCODE_BIND). The height of the row separator bars in
-multiples of the X-dimension (minimum and default 1, maximum 4) can be set by
---separator= (option_3):
+--bind (API output_options |= BARCODE_BIND). The height of the row separator
+bars in multiples of the X-dimension (minimum and default 1, maximum 4) can be
+set by --separator (API option_3):
-zind --bind --separator=2 -d "This" -d "That"
+ zint --bind --notext --separator=2 -d "This" -d "That"
+
+[zint --notext --bind --separator=2 -d "This" -d "That"]
A more sophisticated method is to use some type of line indexing which indicates
to the barcode reader which order the symbols should be read. This is
demonstrated by the symbologies below.
6.2.2 Codablock-F
------------------
+
+[zint -b CODABLOCKF -d "CODABLOCK F Symbology" --rows=3]
+
This is a stacked symbology based on Code 128 which can encode extended ASCII
code set data up to a maximum length of 2725 characters. The width of the
-Codablock-F symbol can be set using the --cols= option at the command line or
-option_2. The height (number of rows) can be set using the --rows= option at the
-command line or by setting option_1. Zint does not support encoding of GS1 data
-in Codablock-F symbols.
+Codablock-F symbol can be set using the --cols option (API option_2). The height
+(number of rows) can be set using the --rows option (API option_1). Zint does
+not currently support encoding of GS1 data in Codablock-F symbols.
+
+A separate symbology ID (BARCODE_HIBC_BLOCKF) can be used to encode Health
+Industry Barcode (HIBC) data which adds a leading '+' character and a modulo-49
+check digit to the encoded data.
6.2.3 Code 16K (EN 12323)
--------------------------
+
+[zint -b CODE16K --compliantheight -d "ab0123456789"]
+
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 extended ASCII
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 --rows option
-or by setting option_1, with values from 2 to 16.
+(API option_1), with values from 2 to 16.
6.2.4 PDF417 (ISO 15438)
-------------------------
+
+[zint -b PDF417 -d "PDF417"]
+
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.
+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.
The width of the generated PDF417 symbol can be specified at the command line
-using the --cols switch followed by a number between 1 and 30, the number of
-rows using the --rows switch followed by a number between 3 and 90, and the
-amount of error correction information can be specified by using the --secure
-switch followed by a number between 0 and 8 where the number of codewords used
-for error correction is determined by 2^(value + 1). If using the API these
-values are assigned to option_2, option_3 and option_1 respectively. The default
-level of error correction is determined by the amount of data being encoded.
+using the --cols switch (API option_2) followed by a number between 1 and 30,
+the number of rows using the --rows switch (API option_3) followed by a number
+between 3 and 90, and the amount of error correction information can be
+specified by using the --secure switch (API option_1) followed by a number
+between 0 and 8 where the number of codewords used for error correction is
+determined by 2^(value + 1). The default level of error correction is determined
+by the amount of data being encoded.
This symbology uses Latin-1 character encoding by default but also supports the
-ECI encoding mechanism. A separate symbology ID can be used to encode Health
-Industry Barcode (HIBC) data which adds a leading '+' character and a modulo-49
-check digit to the encoded data.
+ECI encoding mechanism. A separate symbology ID (BARCODE_HIBC_PDF) can be used
+to encode Health Industry Barcode (HIBC) data.
-PDF417 supports Structured Append of up to a 99,999 symbols and an optional
+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 --structapp option
-(see section 4.16) or the API structapp variable. The ID consists of up to 10
+(see 4.16 Structured Append) (API structapp). The ID consists of up to 10
triplets, each ranging from "000" to "899". For instance "123456789" would be a
valid ID of 3 triplets. However "123456900" would not, as the last triplet "900"
exceeds "899". The triplets are 0-filled, for instance "1234" becomes "123004".
If an ID is not given, no ID is encoded.
-6.2.5 Compact PDF417
---------------------
-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.
+6.2.5 Compact PDF417 (ISO 15438)
+
+[zint -b PDF417COMP -d "PDF417"]
+
+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.
6.2.6 MicroPDF417 (ISO 24728)
------------------------------
+
+[zint -b MICROPDF417 -d "12345678"]
+
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 size 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 --cols switch or option_2 as with PDF417.
+can be determined using the --cols switch (API option_2) as with PDF417.
This symbology uses Latin-1 character encoding by default but also supports the
-ECI encoding mechanism. A separate symbology ID can be used to encode Health
-Industry Barcode (HIBC) data which adds a leading '+' character and a modulo-49
-check digit to the encoded data. MicroPDF417 supports Structured Append the same
-as PDF417, for which see details.
+ECI encoding mechanism. A separate symbology ID (BARCODE_HIBC_MICPDF) can be
+used to encode Health Industry Barcode (HIBC) data. MicroPDF417 supports
+Structured Append the same as PDF417, for which see details.
6.2.7 GS1 DataBar Stacked (ISO 24724)
--------------------------------------
+
+6.2.7.1 GS1 DataBar Stacked
+
+[zint -b DBAR_STK --compliantheight -d "9889876543210"]
+
A stacked variation of the GS1 DataBar Truncated symbol requiring the same input
-(see section 6.1.12.1). The data is encoded in two rows of bars with a central
-finder pattern. This symbol can be generated with a two-dimensional component to
-make a composite symbol.
+(see 6.1.11.1 GS1 DataBar Omnidirectional and GS1 DataBar Truncated), this
+symbol is the same as the following DataBar Stacked Omnidirectional symbol
+except that its height is reduced, 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.
+
+6.2.7.2 GS1 DataBar Stacked Omnidirectional
+
+[zint -b DBAR_OMNSTK --compliantheight -d "9889876543210"]
-6.2.8 GS1 DataBar Stacked Omnidirectional (ISO 24724)
------------------------------------------------------
A stacked variation of the GS1 DataBar Omnidirectional symbol requiring the same
-input (see section 6.1.12.1). The data is encoded in two rows of bars with a
-central finder pattern. This symbol can be generated with a two-dimensional
-component to make a composite symbol.
+input (see 6.1.11.1 GS1 DataBar Omnidirectional and GS1 DataBar Truncated). The
+data is encoded in two rows of bars with a central finder pattern. This symbol
+can be generated with a two-dimensional component to make a composite symbol.
+
+6.2.7.3 GS1 DataBar Expanded Stacked
+
+[zint -b DBAR_EXPSTK --compliantheight -d "[01]98898765432106[3202]012345[15]991231"]
-6.2.9 GS1 DataBar Expanded Stacked (ISO 24724)
-----------------------------------------------
A stacked variation of the GS1 DataBar Expanded symbol for smaller packages.
-Input is the same as for GS1 DataBar Expanded (see section 6.1.12.3). In
-addition the width of the symbol can be altered using the --cols switch or
-option_2, with values from 1 to 11. In this case the number of columns relates
-to the number of character pairs on each row of the symbol. Alternatively the
---rows switch or option_3 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.
+Input is the same as for GS1 DataBar Expanded (see 6.1.11.3 GS1 DataBar
+Expanded). In addition the width of the symbol can be altered using the --cols
+switch (API option_2). 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 --rows switch (API option_3) 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.
-6.2.10 Code 49
---------------
-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
+6.2.8 Code 49
+
+[zint -b CODE49 --compliantheight -d "MULTIPLE ROWS IN CODE 49"]
+
+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 --rows option or by setting
-option_1, with values from 2 to 8.
+minimum number of rows to use can be set using the --rows option (API option_1),
+with values from 2 to 8.
6.3 Composite Symbols (ISO 24723)
----------------------------------
+
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 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 -b or
---barcode= switch or by adjusting symbol->symbology as with other encoding
-methods. Valid values are shown below.
+--barcode switch (API symbology) as with other encoding methods. Valid values
+are shown below.
---------------------------------------------------------------------------------
-Numeric | Name | Barcode Name
-Value |
---------------------------------------------------------------------------------
-130 | BARCODE_EANX_CC | Composite Symbol with EAN linear component
-131 | BARCODE_GS1_128_CC | Composite Symbol with GS1-128 linear
- | | component
-132 | BARCODE_DBAR_OMN_CC | Composite Symbol with GS1 DataBar
- | | Omnidirectional linear component
-133 | BARCODE_DBAR_LTD_CC | Composite Symbol with GS1 DataBar Limited
- | | linear component
-134 | BARCODE_DBAR_EXP_CC | Composite Symbol with GS1 DataBar Expanded
- | | linear component
-135 | BARCODE_UPCA_CC | Composite Symbol with UPC-A linear component
-136 | BARCODE_UPCE_CC | Composite Symbol with UPC-E linear component
-137 | BARCODE_DBAR_STK_CC | Composite Symbol with GS1 DataBar Stacked
- | | component
-138 | BARCODE_DBAR_OMNSTK_CC | Composite Symbol with GS1 DataBar Stacked
- | | Omnidirectional component
-139 | BARCODE_DBAR_EXPSTK_CC | Composite Symbol with GS1 DataBar Expanded
- | | Stacked component
---------------------------------------------------------------------------------
+ --------------------------------------------------------------------------------
+ Numeric Name Barcode Name
+ Value
+ --------- ------------------------- --------------------------------------------
+ 130 BARCODE_EANX_CC Composite Symbol with EAN linear component
+
+ 131 BARCODE_GS1_128_CC Composite Symbol with GS1-128 linear
+ component
+
+ 132 BARCODE_DBAR_OMN_CC Composite Symbol with GS1 DataBar
+ Omnidirectional linear component
+
+ 133 BARCODE_DBAR_LTD_CC Composite Symbol with GS1 DataBar Limited
+ linear component
+
+ 134 BARCODE_DBAR_EXP_CC Composite Symbol with GS1 DataBar Expanded
+ linear component
+
+ 135 BARCODE_UPCA_CC Composite Symbol with UPC-A linear component
+
+ 136 BARCODE_UPCE_CC Composite Symbol with UPC-E linear component
+
+ 137 BARCODE_DBAR_STK_CC Composite Symbol with GS1 DataBar Stacked
+ component
+
+ 138 BARCODE_DBAR_OMNSTK_CC Composite Symbol with GS1 DataBar Stacked
+ Omnidirectional component
+
+ 139 BARCODE_DBAR_EXPSTK_CC Composite Symbol with GS1 DataBar Expanded
+ Stacked component
+ --------------------------------------------------------------------------------
+
+ : {#tbl:composite_symbologies tag=“: Composite Symbology Values”}
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 --primary= command.
-For example:
+in the normal way. To do this at the command prompt use the --primary switch
+(API primary). For example:
-zint -b EANX_CC --mode=1 --primary=331234567890 -d "[99]1234-abcd"
+ zint -b EANX_CC --mode=1 --primary=331234567890 -d "[99]1234-abcd"
This creates an EAN-13 linear component with the data "331234567890" and a 2D
CC-A (see below) component with the data "(99)1234-abcd". The same results can
be achieved using the API as shown below:
-my_symbol->symbology = BARCODE_EANX_CC;
+ my_symbol->symbology = BARCODE_EANX_CC;
-my_symbol->option_1 = 1;
+ my_symbol->option_1 = 1;
-strcpy(my_symbol->primary, "331234567890");
+ strcpy(my_symbol->primary, "331234567890");
-ZBarcode_Encode_and_Print(my_symbol, "[99]1234-abcd", 0, 0);
+ ZBarcode_Encode_and_Print(my_symbol, "[99]1234-abcd", 0, 0);
EAN-2 and EAN-5 add-on data can be used with EAN and UPC symbols using the +
-symbol as described in sections 6.1.3 and 6.1.4.
+symbol as described in sections 6.1.3 Universal Product Code (ISO 15420) and
+6.1.4 European Article Number (ISO 15420).
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 --mode= prompt
-followed by 1, 2 or 3 for CC-A, CC-B or CC-C respectively, or by using the
-option_1 variable as shown above.
+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 --mode prompt (API option_1)
+followed by 1, 2 or 3 for CC-A, CC-B or CC-C respectively.
6.3.1 CC-A
-----------
+
+[zint -b EANX_CC --compliantheight -d "[99]1234-abcd" --mode=1 --primary=331234567890]
+
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 --mode=1.
+string of shorter length. To select CC-A use --mode=1 (API option_1 = 1).
6.3.2 CC-B
-----------
+
+[zint -b EANX_CC --compliantheight -d "[99]1234-abcd" --mode=2 --primary=331234567890]
+
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 --mode=2.
+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 --mode=2 (API option_1 = 2).
6.3.3 CC-C
-----------
+
+[zint -b GS1_128_CC --compliantheight -d "[99]1234-abcd" --mode=3 --primary="[01]03312345678903"]
+
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 --mode=3.
+string of shorter length. To select CC-C use --mode=3 (API option_1 = 3).
6.4 Two-Track Symbols
----------------------
+
6.4.1 Two-Track Pharmacode
---------------------------
-Developed by Laetus, Pharmacode Two-Track is an alternative system to
-Pharmacode One-Track used for the identification of pharmaceuticals. The
-symbology is able to encode whole numbers between 4 and 64570080.
+
+[zint -b PHARMA_TWO --compliantheight -d "29876543"]
+
+Developed by Laetus, Pharmacode Two-Track is an alternative system to Pharmacode
+One-Track (see 6.1.9 Pharmacode) used for the identification of pharmaceuticals.
+The symbology is able to encode whole numbers between 4 and 64570080.
6.4.2 POSTNET
--------------
+
+[zint -b POSTNET --compliantheight -d "12345678901"]
+
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 PostNet6 (5
-digit ZIP input), PostNet10 (5 digit ZIP + 4 digit user data) and PostNet12 (5
-digit ZIP + 6 digit user data).
+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 PostNet6 (5 digit
+ZIP input), PostNet10 (5 digit ZIP + 4 digit user data) and PostNet12 (5 digit
+ZIP + 6 digit user data).
6.4.3 PLANET
-------------
+
+[zint -b PLANET --compliantheight -d "4012345235636"]
+
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.
@@ -2426,71 +3039,93 @@ lengths used by USPS were Planet12 (11 digit input) and Planet14 (13 digit
input).
6.5 4-State Postal Codes
-------------------------
+
6.5.1 Australia Post 4-State Symbols
-------------------------------------
+
6.5.1.1 Customer Barcodes
--------------------------
+
+[zint -b AUSPOST --compliantheight -d "96184209"]
+
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:
+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:
------------------------------------------------------------------
-Input | Required Input Format | Symbol | FCC | Encoding
-Length | | Length | | Table
------------------------------------------------------------------
-8 | 99999999 | 37-bar | 11 | None
-13 | 99999999AAAAA | 52-bar | 59 | C
-16 | 9999999999999999 | 52-bar | 59 | N
-18 | 99999999AAAAAAAAAA | 67-bar | 62 | C
-23 | 99999999999999999999999 | 67-bar | 62 | N
------------------------------------------------------------------
+ ------------------------------------------------------------
+ Input Required Input Format Symbol FCC Encoding
+ Length Length Table
+ -------- ------------------------- -------- ----- ----------
+ 8 99999999 37-bar 11 None
+
+ 13 99999999AAAAA 52-bar 59 C
+
+ 16 9999999999999999 52-bar 59 N
+
+ 18 99999999AAAAAAAAAA 67-bar 62 C
+
+ 23 99999999999999999999999 67-bar 62 N
+ ------------------------------------------------------------
+
+ : {#tbl:auspost_input_formats tag=“: Australia Post Input Formats”}
6.5.1.2 Reply Paid Barcode
---------------------------
+
+[zint -b AUSREPLY --compliantheight -d "12345678"]
+
A Reply Paid version of the Australia Post 4-State Barcode (FCC 45) which
requires an 8-digit DPID input.
6.5.1.3 Routing Barcode
------------------------
+
+[zint -b AUSROUTE --compliantheight -d "34567890"]
+
A Routing version of the Australia Post 4-State Barcode (FCC 87) which requires
an 8-digit DPID input.
6.5.1.4 Redirect Barcode
-------------------------
+
+[zint -b AUSREDIRECT --compliantheight -d "98765432"]
+
A Redirection version of the Australia Post 4-State Barcode (FCC 92) which
requires an 8-digit DPID input.
6.5.2 Dutch Post KIX Code
--------------------------
-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.
+
+[zint -b KIX --compliantheight -d "2500GG30250"]
+
+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.
6.5.3 Royal Mail 4-State Customer Code (RM4SCC)
------------------------------------------------
+
+[zint -b RM4SCC --compliantheight -d "W1J0TR01"]
+
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 "W1J0TR01" for 1 Piccadilly Circus in London. Check digit data is
-generated by Zint.
+A-Z and usually includes delivery postcode followed by house number. For example
+"W1J0TR01" for 1 Piccadilly Circus in London. Check digit data is generated by
+Zint.
6.5.4 Royal Mail 4-State Mailmark
----------------------------------
-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. Some of the permitted inputs include a number of
-trailing space characters - these will be appended by Zint if not included in
-the input data.
+
+[zint -b MAILMARK --compliantheight -d "1100000000000XY11"]
+
+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. Some of the permitted inputs include a number of trailing
+space characters - these will be appended by Zint if not included in the input
+data.
6.5.5 USPS Intelligent Mail
----------------------------
+
+[zint -b USPS_IMAIL --compliantheight -d "01234567094987654321-01234"]
+
Also known as the OneCode barcode and used in the US 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
@@ -2499,310 +3134,331 @@ consists of a 20 digit tracking code, followed by a dash (-), 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:
-"01234567094987654321"
+ "01234567094987654321"
-"01234567094987654321-01234"
+ "01234567094987654321-01234"
-"01234567094987654321-012345678"
+ "01234567094987654321-012345678"
-"01234567094987654321-01234567891"
+ "01234567094987654321-01234567891"
6.5.6 Japanese Postal Code
---------------------------
-Used for address data on mail items for Japan Post. Accepted values are 0-9,
-A-Z and Dash (-). A modulo 19 check digit is added by Zint.
+
+[zint -b JAPANPOST --compliantheight -d "15400233-16-4-205"]
+
+Used for address data on mail items for Japan Post. Accepted values are 0-9, A-Z
+and dash (-). A modulo 19 check digit is added by Zint.
6.6 Two-Dimensional Matrix Symbols
-----------------------------------
+
6.6.1 Data Matrix (ISO 16022)
------------------------------
+
+[zint -b HIBC_DM -d "/ACMRN123456/V200912190833" --fast --square]
+
Also known as Semacode this symbology was developed in 1989 by Acuity CiMatrix
-in partnership with the US 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
+in partnership with the US 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
-also be adjusted using the --vers= option or by setting option_2 as shown in the
-table below. A separate symbology ID can be used to encode Health Industry
-Barcode (HIBC) data which adds a leading '+' character and a modulo-49 check
-digit to the encoded data. Note that only ECC200 encoding is supported, the
+also be adjusted using the --vers option (API option_2) as shown in the table
+below. A separate symbology ID (BARCODE_HIBC_DM) can be used to encode Health
+Industry Barcode (HIBC) data. Note that only ECC200 encoding is supported, the
older standards have now been removed from Zint.
--------------------------------------------------------------------------------
-Input | Symbol Size | Input | Symbol Size | Input | Symbol Size
--------------------------------------------------------------------------------
-1 | 10 x 10 | 11 | 36 x 36 | 21 | 104 x 104
-2 | 12 x 12 | 12 | 40 x 40 | 22 | 120 x 120
-3 | 14 x 14 | 13 | 44 x 44 | 23 | 132 x 132
-4 | 16 x 16 | 14 | 48 x 48 | 24 | 144 x 144
-5 | 18 x 18 | 15 | 52 x 52 | 25 | 8 x 18
-6 | 20 x 20 | 16 | 64 x 64 | 26 | 8 x 32
-7 | 22 x 22 | 17 | 72 x 72 | 28 | 12 x 26
-8 | 24 x 24 | 18 | 80 x 80 | 28 | 12 x 36
-9 | 26 x 26 | 19 | 88 x 88 | 29 | 16 x 36
-10 | 32 x 32 | 20 | 96 x 96 | 30 | 16 x 48
--------------------------------------------------------------------------------
+ Input Symbol Size Input Symbol Size Input Symbol Size
+ ------- ------------- -- ------- ------------- -- ------- -------------
+ 1 10 x 10 11 36 x 36 21 104 x 104
+ 2 12 x 12 12 40 x 40 22 120 x 120
+ 3 14 x 14 13 44 x 44 23 132 x 132
+ 4 16 x 16 14 48 x 48 24 144 x 144
+ 5 18 x 18 15 52 x 52 25 8 x 18
+ 6 20 x 20 16 64 x 64 26 8 x 32
+ 7 22 x 22 17 72 x 72 28 12 x 26
+ 8 24 x 24 18 80 x 80 28 12 x 36
+ 9 26 x 26 19 88 x 88 29 16 x 36
+ 10 32 x 32 20 96 x 96 30 16 x 48
+
+ : {#tbl:datamatrix_sizes tag=“: Data Matrix Sizes”}
When using automatic symbol sizes you can force Zint to use square symbols
-(versions 1-24) at the command line by using the option --square and when
-using the API by setting the value option_3 = DM_SQUARE.
+(versions 1-24) at the command line by using the option --square (API
+option_3 = DM_SQUARE).
Data Matrix Rectangular Extension (ISO/IEC 21471) codes may be generated with
the following values as before:
----------------------------------------------------
-Input | Symbol Size | Input | Symbol Size
----------------------------------------------------
-31 | 8 x 48 | 40 | 20 x 36
-32 | 8 x 64 | 41 | 20 x 44
-33 | 8 x 80 | 42 | 20 x 64
-34 | 8 x 96 | 43 | 22 x 48
-35 | 8 x 120 | 44 | 24 x 48
-36 | 8 x 144 | 45 | 24 x 64
-37 | 12 x 64 | 46 | 26 x 40
-38 | 12 x 88 | 47 | 26 x 48
-39 | 16 x 64 | 48 | 26 x 64
----------------------------------------------------
+ Input Symbol Size Input Symbol Size
+ ------- ------------- -- ------- -------------
+ 31 8 x 48 40 20 x 36
+ 32 8 x 64 41 20 x 44
+ 33 8 x 80 42 20 x 64
+ 34 8 x 96 43 22 x 48
+ 35 8 x 120 44 24 x 48
+ 36 8 x 144 45 24 x 64
+ 37 12 x 64 46 26 x 40
+ 38 12 x 88 47 26 x 48
+ 39 16 x 64 48 26 x 64
+
+ : {#tbl:dmre_sizes tag=“: DMRE Sizes”}
DMRE symbol sizes may be activated in automatic size mode using the option
---dmre or by the API option_3 = DM_DMRE
+--dmre (API option_3 = DM_DMRE).
-GS1 data may be encoded using FNC1 (preferred) or GS as separator. Use the
-option --gssep to change to GS or use the API output_options |= GS1_GS_SEPARATOR
+GS1 data may be encoded using FNC1 (default) or GS as separator. Use the option
+--gssep to change to GS (API output_options |= GS1_GS_SEPARATOR).
-For a faster but less optimal encoding, the --fast option (API input_mode |=
-FAST_MODE) may be used.
+For a faster but less optimal encoding, the --fast option (API
+input_mode |= FAST_MODE) may be used.
Data Matrix supports Structured Append of up to 16 symbols and a numeric ID
(file identifications), which can be set by using the --structapp option (see
-section 4.16) or the API structapp variable. The ID consists of 2 numbers ID1
-and ID2, each of which can range from 1 to 254, and is specified as the single
+4.16 Structured Append) (API structapp). The ID consists of 2 numbers ID1 and
+ID2, each of which can range from 1 to 254, and is specified as the single
number ID1 * 1000 + ID2, so for instance ID1 "123" and ID2 "234" would be given
as "123234". Note that both ID1 and ID2 must be non-zero, so e.g. "123000" or
"000123" would be invalid IDs. If an ID is not given it defaults to "001001".
6.6.2 QR Code (ISO 18004)
--------------------------
+
+[zint -b QRCODE -d "QR Code Symbol" --mask=5]
+
Also known as Quick Response Code this symbology was developed by Denso. Four
-levels of error correction are available using the --secure= option or by
-setting option_1 as shown in the following table.
+levels of error correction are available using the --secure option (API
+option_1) as shown in the following table.
------------------------------------------------------------------------
-Input | ECC Level | Error Correction Capacity | Recovery Capacity
------------------------------------------------------------------------
-1 | L | Approx 20% of symbol | Approx 7%
-2 | M | Approx 37% of symbol | Approx 15%
-3 | Q | Approx 55% of symbol | Approx 25%
-4 | H | Approx 65% of symbol | Approx 30%
------------------------------------------------------------------------
+ Input ECC Level Error Correction Capacity Recovery Capacity
+ ------- ----------- --------------------------- -------------------
+ 1 L Approx 20% of symbol Approx 7%
+ 2 M Approx 37% of symbol Approx 15%
+ 3 Q Approx 55% of symbol Approx 25%
+ 4 H Approx 65% of symbol Approx 30%
-The size of the symbol can be set by using the --vers= option or setting
-option_2 to the QR Code version required (1-40). The size of symbol generated
+ : {#tbl:qrcode_eccs tag=“: QR Code ECC Levels”}
+
+The size of the symbol can be specified by setting the --vers option (API
+option_2) to the QR Code version required (1-40). The size of symbol generated
is shown in the table below.
--------------------------------------------------------------------------------
-Input | Symbol Size | Input | Symbol Size | Input | Symbol Size
--------------------------------------------------------------------------------
-1 | 21 x 21 | 15 | 77 x 77 | 29 | 133 x 133
-2 | 25 x 25 | 16 | 81 x 81 | 30 | 137 x 137
-3 | 29 x 29 | 17 | 85 x 85 | 31 | 141 x 141
-4 | 33 x 33 | 18 | 89 x 89 | 32 | 145 x 145
-5 | 37 x 37 | 19 | 93 x 93 | 33 | 149 x 149
-6 | 41 x 41 | 20 | 97 x 97 | 34 | 153 x 153
-7 | 45 x 45 | 21 | 101 x 101 | 35 | 157 x 157
-8 | 49 x 49 | 22 | 105 x 105 | 36 | 161 x 161
-9 | 53 x 53 | 23 | 109 x 109 | 37 | 165 x 165
-10 | 57 x 57 | 24 | 113 x 113 | 38 | 169 x 169
-11 | 61 x 61 | 25 | 117 x 117 | 39 | 173 x 173
-12 | 65 x 65 | 26 | 121 x 121 | 40 | 177 x 177
-13 | 69 x 69 | 27 | 125 x 125 |
-14 | 73 x 73 | 28 | 129 x 129 |
--------------------------------------------------------------------------------
+ Input Symbol Size Input Symbol Size Input Symbol Size
+ ------- ------------- -- ------- ------------- -- ------- -------------
+ 1 21 x 21 15 77 x 77 29 133 x 133
+ 2 25 x 25 16 81 x 81 30 137 x 137
+ 3 29 x 29 17 85 x 85 31 141 x 141
+ 4 33 x 33 18 89 x 89 32 145 x 145
+ 5 37 x 37 19 93 x 93 33 149 x 149
+ 6 41 x 41 20 97 x 97 34 153 x 153
+ 7 45 x 45 21 101 x 101 35 157 x 157
+ 8 49 x 49 22 105 x 105 36 161 x 161
+ 9 53 x 53 23 109 x 109 37 165 x 165
+ 10 57 x 57 24 113 x 113 38 169 x 169
+ 11 61 x 61 25 117 x 117 39 173 x 173
+ 12 65 x 65 26 121 x 121 40 177 x 177
+ 13 69 x 69 27 125 x 125
+ 14 73 x 73 28 129 x 129
-The maximum capacity of a (version 40) QR Code symbol is 7089 numeric digits,
+ : {#tbl:qrcode_sizes tag=“: QR Code Sizes”}
+
+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 characters in
-the Latin-1 set and Kanji characters which are members of the Shift JIS
-encoding scheme. In addition QR Code supports using other character sets using
-the ECI mechanism. Input should usually be entered as UTF-8 (Unicode) with
-conversion to Shift JIS being carried out by Zint. A separate symbology ID can
-be used to encode Health Industry Barcode (HIBC) data which adds a leading '+'
-character and a modulo-49 check digit to the encoded data.
+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 (BARCODE_HIBC_QR) can be used to encode Health Industry Barcode
+(HIBC) data.
-Non-ASCII data density may be maximized by using the --fullmultibyte switch or
-by setting option_3 to ZINT_FULL_MULTIBYTE, but check that your barcode reader
-supports this before using.
+Non-ASCII data density may be maximized by using the --fullmultibyte switch (API
+option_3 = ZINT_FULL_MULTIBYTE), but check that your barcode reader supports
+this before using.
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 --mask= switch with values 0-7, or by setting option_3 to
-(N + 1) << 8 where N is 0-7. To use with ZINT_FULL_MULTIBYTE set option_3 =
-ZINT_FULL_MULTIBYTE | (N + 1) << 8.
+by using the --mask switch with values 0-7, or in the API by setting
+option_3 = (N + 1) << 8 where N is 0-7. To use with ZINT_FULL_MULTIBYTE set
+
+ option_3 = ZINT_FULL_MULTIBYTE | (N + 1) << 8
QR Code supports Structured Append of up to 16 symbols and a numeric ID
-(parity), which can be set by using the --structapp option (see section 4.16) or
-the API structapp variable. The parity ID ranges from 0 (default) to 255, and
-for full compliance should be set to the value obtained by XOR-ing together each
+(parity), which can be set by using the --structapp option (see 4.16 Structured
+Append) (API structapp). The parity ID ranges from 0 (default) to 255, and for
+full compliance should be set to the value obtained by XOR-ing together each
byte of the complete data forming the sequence. Currently this calculation must
be done outside of Zint.
6.6.3 Micro QR Code (ISO 18004)
--------------------------------
-A miniature version of the QR Code symbol for short messages, Micro QR Code
-symbols can encode characters in the Latin-1 set and Kanji characters which are
-members of the Shift JIS encoding scheme. 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 --vers= option or
-by setting option_2, as shown in the table below. Note that versions M1 and M2
-have restrictions on what characters can be encoded.
-------------------------------------------------------------------------
-Input | Version | Symbol Size | Allowed Characters
-------------------------------------------------------------------------
-1 | M1 | 11 x 11 | Numeric only
-2 | M2 | 13 x 13 | Numeric, uppercase letters, space,
- | | | and the characters "$%*+-./:"
-3 | M3 | 15 x 15 | Latin-1 and Kanji
-4 | M4 | 17 x 17 | Latin-1 and Kanji
-------------------------------------------------------------------------
+[zint -b MICROQR -d "01234567"]
+
+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 --vers option (API option_2), as shown in the table below. Note
+that versions M1 and M2 have restrictions on what characters can be encoded.
+
+ ------------------------------------------------------------------
+ Input Version Symbol Size Allowed Characters
+ ------- --------- ------------- ----------------------------------
+ 1 M1 11 x 11 Numeric only
+
+ 2 M2 13 x 13 Numeric, uppercase letters, space,
+ and the characters "$%*+-./:"
+
+ 3 M3 15 x 15 Latin-1 and Shift JIS
+
+ 4 M4 17 x 17 Latin-1 and Shift JIS
+ ------------------------------------------------------------------
+
+ : {#tbl:micrqr_sizes tag=“: Micro QR Code Sizes”}
Except for version M1, which is always ECC level L, the amount of ECC codewords
-can be adjusted using the --secure= option (API option_1); however ECC level H
-is not available for any version, and ECC level Q is only available for version
-M4:
+can be adjusted using the --secure option (API option_1); however ECC level H is
+not available for any version, and ECC level Q is only available for version M4:
-----------------------------------------------------------------------------
-Input | ECC | Error Correction | Recovery | Available for
- | Level | Capacity | Capacity | Versions
-----------------------------------------------------------------------------
-1 | L | Approx 20% of symbol | Approx 7% | M1, M2, M3, M4
-2 | M | Approx 37% of symbol | Approx 15% | M2, M3, M4
-3 | Q | Approx 55% of symbol | Approx 25% | M4
----------------------------------------------------------------------------
+ ----------------------------------------------------------------------
+ Input ECC Error Correction Recovery Available for
+ Level Capacity Capacity Versions
+ -------- -------- ----------------------- ------------- --------------
+ 1 L Approx 20% of symbol Approx 7% M1, M2, M3, M4
+
+ 2 M Approx 37% of symbol Approx 15% M2, M3, M4
+
+ 3 Q Approx 55% of symbol Approx 25% M4
+ ----------------------------------------------------------------------
The defaults for symbol size and ECC level depend on the input and whether
either of them is specified.
For barcode readers that support it, non-ASCII data density may be maximized by
-using the --fullmultibyte switch or by setting option_3 to ZINT_FULL_MULTIBYTE.
+using the --fullmultibyte switch (API option_3 = ZINT_FULL_MULTIBYTE).
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 --mask= switch with values 0-3, or by setting option_3
-to (N + 1) << 8 where N is 0-3. To use with ZINT_FULL_MULTIBYTE set option_3 =
-ZINT_FULL_MULTIBYTE | (N + 1) << 8.
+specified by using the --mask switch with values 0-3, or in the API by setting
+option_3 = (N + 1) << 8 where N is 0-3. To use with ZINT_FULL_MULTIBYTE set
+
+ option_3 = ZINT_FULL_MULTIBYTE | (N + 1) << 8
6.6.4 Rectangular Micro QR Code (rMQR)
---------------------------------------
+
+[zint -b RMQR -d "0123456"]
+
A rectangular version of QR Code, it is still under development, so it is
recommended it should not yet be used for a production environment. Like QR
-Code, rMQR supports encoding of GS1 data, and Latin-1 characters in the ISO/IEC
-8859-1 set and Kanji characters in the Shift JIS encoding scheme, 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 --secure= option (API option_1), however
-only ECC levels M and H are valid for this type of symbol.
+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 --secure option (API
+option_1), however only ECC levels M and H are valid for this type of symbol.
------------------------------------------------------------------------
-Input | ECC Level | Error Correction Capacity | Recovery Capacity
------------------------------------------------------------------------
-2 | M | Approx 37% of symbol | Approx 15%
-4 | H | Approx 65% of symbol | Approx 30%
------------------------------------------------------------------------
+ Input ECC Level Error Correction Capacity Recovery Capacity
+ ------- ----------- --------------------------- -------------------
+ 2 M Approx 37% of symbol Approx 15%
+ 4 H Approx 65% of symbol Approx 30%
-The preferred symbol sizes can be selected using the --vers= option (API
+ : {#tbl:rmqr_eccs tag=“: rMQR ECC Levels”}
+
+The preferred symbol sizes can be selected using the --vers option (API
option_2) 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.
---------------------------------------------------------------------------------
-Input | Version | Symbol Size (HxW) | Input | Version | Symbol Size (HxW)
---------------------------------------------------------------------------------
-1 | R7x43 | 7 x 73 | 20 | R13x77 | 13 x 77
-2 | R7x59 | 7 x 59 | 21 | R13x99 | 13 x 99
-3 | R7x77 | 7 x 77 | 22 | R13x139 | 13 x 139
-4 | R7x99 | 7 x 99 | 23 | R15x43 | 15 x 43
-5 | R7x139 | 7 x 139 | 24 | R15x59 | 15 x 59
-6 | R9x43 | 9 x 43 | 25 | R15x77 | 15 x 77
-7 | R9x59 | 9 x 59 | 26 | R15x99 | 15 x 99
-8 | R9x77 | 9 x 77 | 27 | R15x139 | 15 x 139
-9 | R9x99 | 9 x 99 | 28 | R17x43 | 17 x 43
-10 | R9x139 | 9 x 139 | 29 | R17x59 | 17 x 59
-11 | R11x27 | 11 x 27 | 30 | R17x77 | 17 x 77
-12 | R11x43 | 11 x 43 | 31 | R17x99 | 17 x 99
-13 | R11x59 | 11 x 59 | 32 | R17x139 | 17 x 139
-14 | R11x77 | 11 x 77 | 33 | R7xW | 7 x automatic width
-15 | R11x99 | 11 x 99 | 34 | R9xW | 9 x automatic width
-16 | R11x139 | 11 x 139 | 35 | R11xW | 11 x automatic width
-17 | R13x27 | 13 x 27 | 36 | R13xW | 13 x automatic width
-18 | R13x43 | 13 x 43 | 37 | R15xW | 15 x automatic width
-19 | R13x59 | 13 x 59 | 38 | R17xW | 17 x automatic width
---------------------------------------------------------------------------------
+ Input Version Symbol Size (HxW) Input Version Symbol Size (HxW)
+ ------- --------- ------------------- -- ------- --------- ----------------------
+ 1 R7x43 7 x 73 20 R13x77 13 x 77
+ 2 R7x59 7 x 59 21 R13x99 13 x 99
+ 3 R7x77 7 x 77 22 R13x139 13 x 139
+ 4 R7x99 7 x 99 23 R15x43 15 x 43
+ 5 R7x139 7 x 139 24 R15x59 15 x 59
+ 6 R9x43 9 x 43 25 R15x77 15 x 77
+ 7 R9x59 9 x 59 26 R15x99 15 x 99
+ 8 R9x77 9 x 77 27 R15x139 15 x 139
+ 9 R9x99 9 x 99 28 R17x43 17 x 43
+ 10 R9x139 9 x 139 29 R17x59 17 x 59
+ 11 R11x27 11 x 27 30 R17x77 17 x 77
+ 12 R11x43 11 x 43 31 R17x99 17 x 99
+ 13 R11x59 11 x 59 32 R17x139 17 x 139
+ 14 R11x77 11 x 77 33 R7xW 7 x automatic width
+ 15 R11x99 11 x 99 34 R9xW 9 x automatic width
+ 16 R11x139 11 x 139 35 R11xW 11 x automatic width
+ 17 R13x27 13 x 27 36 R13xW 13 x automatic width
+ 18 R13x43 13 x 43 37 R15xW 15 x automatic width
+ 19 R13x59 13 x 59 38 R17xW 17 x automatic width
+
+ : {#tbl:rmqr_sizes tag=“: rMQR Sizes”}
For barcode readers that support it, non-ASCII data density may be maximized by
-using the --fullmultibyte switch or by setting option_3 to ZINT_FULL_MULTIBYTE.
+using the --fullmultibyte switch or in the API by setting
+option_3 = ZINT_FULL_MULTIBYTE.
6.6.5 UPNQR (Univerzalnega Plačilnega Naloga QR)
-------------------------------------------------
+
+[zint -b UPNQR -i upn_utf8.txt --quietzones]
+
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 ISO/IEC 8859-2 formatted
-data. Zint will accept UTF-8 data and convert it to ISO/IEC 8859-2, or if your
-data is already ISO/IEC 8859-2 formatted use the --binary switch or if using the
-API set symbol->input_mode = DATA MODE;
+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 --binary switch
+(API input_mode = DATA MODE).
-The following example creates a symbol from data saved as an ISO/IEC 8859-2
-file:
+The following example creates a symbol from data saved as a Latin-2 file:
-zint -o upnqr.png -b 143 --border=5 --scale=3 --binary -i upn.txt
+ zint -o upnqr.png -b 143 --scale=3 --binary -i upn.txt
6.6.6 MaxiCode (ISO 16023)
---------------------------
-Developed by UPS the MaxiCode symbology employs a grid of hexagons surrounding
-a 'bulls-eye' 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:
-----------------------------------------------------------------------------
-Characters | Meaning
-----------------------------------------------------------------------------
-1 - 9 | 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 can be filled with the SPACE character
- | (ASCII 32) or omitted (if omitted adjust the following
- | character positions).
-10 - 12 | Three digit country code according to ISO 3166-1.
-13 - 15 | Three digit service code. This depends on your parcel courier.
-----------------------------------------------------------------------------
+[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]
-The primary message can be set at the command prompt using the --primary=
-switch. The secondary message uses the normal data entry method. For example:
+Developed by UPS the MaxiCode symbology employs a grid of hexagons surrounding a
+bulls-eye 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:
-zint -o test.eps -b 57 --primary="999999999840012" -d "Secondary Message Here"
+ Characters Meaning
+ ------------ ----------------------------------------------------------------
+ 1 - 9 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 can be filled with the SPACE character
+ (ASCII 32) or omitted (if omitted adjust the following
+ character positions).
+ 10 - 12 Three digit country code according to ISO 3166-1.
+ 13 - 15 Three digit service code. This depends on your parcel courier.
-When using the API the primary message must be placed in the symbol->primary
-string. The secondary is entered in the same way as described in section 5.2.
-When either of these modes is selected Zint will analyse the primary message
-and select either mode 2 or mode 3 as appropriate.
+ : {#tbl:maxicode_scm tag=“: MaxiCode Structured Carrier Message Format”}
+
+The primary message can be set at the command prompt using the --primary switch
+(API primary). The secondary message uses the normal data entry method. For
+example:
+
+ zint -o test.eps -b 57 --primary="999999999840012" \
+ -d "Secondary Message Here"
+
+When using the API the primary message must be placed in the primary string. The
+secondary is entered in the same way as described in 5.2 Encoding and Saving to
+File. When either of these modes is selected Zint will analyse the primary
+message and select either mode 2 or mode 3 as appropriate.
As a convenience the secondary message for modes 2 and 3 can be set to be
-prefixed by the ISO 15434 Format "01" (transportation) sequence "[)>\R01\Gvv",
-where "vv" is a 2-digit version, by using the --scmvv= switch or by setting
-option_2 = vv + 1. For example to use the common version "96" (ASC MH10/SC 8):
+prefixed by the ISO/IEC 15434 Format "01" (transportation) sequence
+"[)>\R01\Gvv", where vv is a 2-digit version, by using the --scmvv switch (API
+option_2 = vv + 1). For example to use the common version "96" (ASC MH10/SC 8):
-zint -b 57 --primary="152382802840001" --scmvv=96 --esc \
- -d "1Z00004951\GUPSN\G06X610\G159\G1234567\G1/1\G\GY\G1 MAIN ST\GTOWN\GNY\R\E"
+ zint -b 57 --primary="152382802840001" --scmvv=96 --esc -d \
+ "1Z00004951\GUPSN\G06X610\G159\G1234567\G1/1\G\GY\G1 MAIN ST\GNY\GNY\R\E"
-will prefix "[)>\R01\G96" to the secondary message. ("\R", "\G" and "\E" are the
+will prefix "[)>\R01\G96" to the secondary message. (\R, \G and \E are the
escape sequences for Record Separator, Group Separator and End of Transmission
-respectively - see section 4.1.)
+respectively - see Table {@tbl:escape_sequences}.)
-Modes 4 to 6 can be accessed using the --mode= switch or by setting option_1.
-Modes 4 to 6 do not have a primary message. For example:
+Modes 4 to 6 can be accessed using the --mode switch (API option_1). Modes 4 to
+6 do not have a primary message. For example:
-zint -o test.eps -b 57 --mode=4 -d "A MaxiCode Message in Mode 4"
+ zint -o test.eps -b 57 --mode=4 -d "A MaxiCode Message in Mode 4"
Mode 6 is reserved for the maintenance of scanner hardware and should not be
used to encode user data.
@@ -2813,343 +3469,386 @@ MaxiCode symbol depends on the type of characters used in the text.
Example maximum data lengths are given in the table below:
------------------------------------------------------------------------------
-Mode | Maximum Data Length | Maximum Data Length | Number of Error
- | for Capital Letters | for Numeric Digits | Correction Codewords
------------------------------------------------------------------------------
-2* | 84 | 126 | 50
-3* | 84 | 126 | 50
-4 | 93 | 138 | 50
-5 | 77 | 113 | 66
-6 | 93 | 138 | 50
------------------------------------------------------------------------------
+ ------------------------------------------------------------------------
+ Mode Maximum Data Length Maximum Data Length Number of Error
+ for Capital Letters for Numeric Digits Correction Codewords
+ ------ --------------------- --------------------- ---------------------
+ 2* 84 126 50
+
+ 3* 84 126 50
+
+ 4 93 138 50
+
+ 5 77 113 66
+
+ 6 93 138 50
+ ------------------------------------------------------------------------
+
+ : {#tbl:maxicode_data_length_maxima tag=“: MaxiCode Data Length Maxima”}
+
* - secondary only
MaxiCode supports Structured Append of up to 8 symbols, which can be set by
-using the --structapp option (see section 4.16) or the API structapp variable.
-It does not support specifying an ID.
+using the --structapp option (see 4.16 Structured Append) (API structapp). It
+does not support specifying an ID.
MaxiCode uses a different scaling than other symbols for raster output, see
-4.9.2, and also for EMF vector output, when the scale is multiplied by 20
-instead of 2.
+4.9.2 MaxiCode Raster Scaling, and also for EMF vector output, when the scale is
+multiplied by 20 instead of 2.
6.6.7 Aztec Code (ISO 24778)
-----------------------------
+
+[zint -b AZTEC -d "123456789012"]
+
Invented by Andrew Longacre at Welch Allyn Inc in 1995 the Aztec Code symbol is
a matrix symbol with a distinctive bulls-eye 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:
+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:
-The size of the symbol can be specified using the --vers= option or setting
-option_2 to a value between 1 and 36 according to the following table. The
-symbols marked with an asterisk (*) in the table below are 'compact' symbols,
-meaning they have a smaller bulls-eye pattern at the centre of the symbol.
+The size of the symbol can be specified using the --vers option (API option_2)
+to a value between 1 and 36 according to the following table. The symbols marked
+with an asterisk (*) in the table below are ‘compact’ symbols, meaning they have
+a smaller bulls-eye pattern at the centre of the symbol.
--------------------------------------------------------------------------------
-Input | Symbol Size | Input | Symbol Size | Input | Symbol Size
--------------------------------------------------------------------------------
-1 | 15 x 15* | 13 | 53 x 53 | 25 | 105 x 105
-2 | 19 x 19* | 14 | 57 x 57 | 26 | 109 x 109
-3 | 23 x 23* | 15 | 61 x 61 | 27 | 113 x 113
-4 | 27 x 27* | 16 | 67 x 67 | 28 | 117 x 117
-5 | 19 x 19 | 17 | 71 x 71 | 29 | 121 x 121
-6 | 23 x 23 | 18 | 75 x 75 | 30 | 125 x 125
-7 | 27 x 27 | 19 | 79 x 79 | 31 | 131 x 131
-8 | 31 x 31 | 20 | 83 x 83 | 32 | 135 x 135
-9 | 37 x 37 | 21 | 87 x 87 | 33 | 139 x 139
-10 | 41 x 41 | 22 | 91 x 91 | 34 | 143 x 143
-11 | 45 x 45 | 23 | 95 x 95 | 35 | 147 x 147
-12 | 49 x 49 | 24 | 101 x 101 | 36 | 151 x 151
--------------------------------------------------------------------------------
+ Input Symbol Size Input Symbol Size Input Symbol Size
+ ------- ------------- -- ------- ------------- -- ------- -------------
+ 1 15 x 15* 13 53 x 53 25 105 x 105
+ 2 19 x 19* 14 57 x 57 26 109 x 109
+ 3 23 x 23* 15 61 x 61 27 113 x 113
+ 4 27 x 27* 16 67 x 67 28 117 x 117
+ 5 19 x 19 17 71 x 71 29 121 x 121
+ 6 23 x 23 18 75 x 75 30 125 x 125
+ 7 27 x 27 19 79 x 79 31 131 x 131
+ 8 31 x 31 20 83 x 83 32 135 x 135
+ 9 37 x 37 21 87 x 87 33 139 x 139
+ 10 41 x 41 22 91 x 91 34 143 x 143
+ 11 45 x 45 23 95 x 95 35 147 x 147
+ 12 49 x 49 24 101 x 101 36 151 x 151
+
+ : {#tbl:aztec_sizes tag=“: Aztec Code Sizes”}
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.
-Alternatively the amount of error correction data can be specified by use of the
---secure= option or by setting option_1 to a value from the following table:
+Alternatively the amount of error correction data can be specified by setting
+the --secure option (API option_1) to a value from the following table:
-----------------------------------
-Mode | Error Correction Capacity
-----------------------------------
-1 | >10% + 3 codewords
-2 | >23% + 3 codewords
-3 | >36% + 3 codewords
-4 | >50% + 3 codewords
-----------------------------------
+ Mode Error Correction Capacity
+ ------ ---------------------------
+ 1 >10% + 3 codewords
+ 2 >23% + 3 codewords
+ 3 >36% + 3 codewords
+ 4 >50% + 3 codewords
+
+ : {#tbl:aztec_eccs tag=“: Aztec Code Error Correction Modes”}
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.
+the same symbol. If both options are selected then the error correction capacity
+selection will be ignored.
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 can be used to encode Health Industry Barcode (HIBC)
-data which adds a leading '+' character and a modulo-49 check digit to the
-encoded data.
+A separate symbology ID (BARCODE_HIBC_AZTEC) can be used to encode Health
+Industry Barcode (HIBC) data.
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
---structapp option (see section 4.16) or the API structapp variable. The ID
-cannot contain spaces. If an ID is not given, no ID is encoded.
+--structapp option (see 4.16 Structured Append) (API structapp). The ID cannot
+contain spaces. If an ID is not given, no ID is encoded.
+
+6.6.8 Aztec Runes (ISO 24778)
+
+[zint -b AZRUNE -d "125"]
-6.6.8 Aztec Runes
------------------
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.
6.6.9 Code One
---------------
-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. There are two types of Code One symbol - fixed-ratio symbols
-which are roughly square (versions A through to H) and variable-width versions
-(version S and T). These can be selected by using --vers= or setting option_2
-as shown in the table below:
---------------------------------------------------------------------
-Input | Version | Size | Numeric | Alphanumeric
- | | (W x H) | Data Capacity | Data Capacity
---------------------------------------------------------------------
-1 | A | 16 x 18 | 22 | 13
-2 | B | 22 x 22 | 44 | 27
-3 | C | 28 x 28 | 104 | 64
-4 | D | 40 x 42 | 217 | 135
-5 | E | 52 x 54 | 435 | 271
-6 | F | 70 x 76 | 886 | 553
-7 | G | 104 x 98 | 1755 | 1096
-8 | H | 148 x 134 | 3550 | 2218
-9 | S | width x 8 | 18 | N/A
-10 | T | width x 16 | 90 | 55
---------------------------------------------------------------------
+[zint -b CODEONE -d "1234567890123456789012"]
+
+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 (version S and T). These can be selected by using
+--vers (API option_2) as shown in the table below:
+
+ --------------------------------------------------------------
+ Input Version Size (W x H) Numeric Data Alphanumeric
+ Capacity Data Capacity
+ ------- --------- ------------ --------------- ---------------
+ 1 A 16 x 18 22 13
+
+ 2 B 22 x 22 44 27
+
+ 3 C 28 x 28 104 64
+
+ 4 D 40 x 42 217 135
+
+ 5 E 52 x 54 435 271
+
+ 6 F 70 x 76 886 553
+
+ 7 G 104 x 98 1755 1096
+
+ 8 H 148 x 134 3550 2218
+
+ 9 S width x 8 18 N/A
+
+ 10 T width x 16 90 55
+ --------------------------------------------------------------
+
+ : {#tbl:codeone_sizes tag=“: Code One Sizes”}
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.
Code One supports Structured Append of up to 128 symbols, which can be set by
-using the --structapp option (see section 4.16) or the API structapp variable.
-It does not support specifying an ID. Structured Append is not supported with
-GS1 data nor for Version S symbols.
+using the --structapp option (see 4.16 Structured Append) (API structapp). It
+does not support specifying an ID. Structured Append is not supported with GS1
+data nor for Version S symbols.
6.6.10 Grid Matrix
-------------------
-By default Grid Matrix supports encoding in Latin-1 and Chinese characters
-within the GB 2312 standard set to be encoded in a chequerboard pattern. Input
-should be entered as UTF-8 (Unicode) with conversion to GB 2312 being carried
-out automatically by Zint. The symbology also supports the ECI mechanism.
-Support for GS1 data has not yet been implemented.
+
+[zint -b GRIDMATRIX --eci=29 -d "AAT2556 电池充电器+降压转换器 200mA至2A tel:86 019 82512738"]
+
+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. The symbology also supports the
+ECI mechanism. Support for GS1 data has not yet been implemented.
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 --vers=
-option or by setting option_2, and the error correction capacity can be
-specified by using the --secure= option or by setting option_1 according to
-the following tables:
+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 --vers
+option (API option_2), and the error correction capacity can be specified by
+using the --secure option (API option_1), according to the following tables:
-----------------------------------------------------
-Input | Symbol Size | Input | Symbol Size
-----------------------------------------------------
-1 | 18 x 18 | 8 | 102 x 102
-2 | 30 x 30 | 9 | 114 x 114
-3 | 42 x 42 | 10 | 126 x 126
-4 | 54 x 54 | 11 | 138 x 138
-5 | 66 x 66 | 12 | 150 x 150
-6 | 78 x 78 | 13 | 162 x 162
-7 | 90 x 90
-----------------------------------------------------
+ Input Symbol Size Input Symbol Size
+ ------- ------------- -- ------- -------------
+ 1 18 x 18 8 102 x 102
+ 2 30 x 30 9 114 x 114
+ 3 42 x 42 10 126 x 126
+ 4 54 x 54 11 138 x 138
+ 5 66 x 66 12 150 x 150
+ 6 78 x 78 13 162 x 162
+ 7 90 x 90
-----------------------------------
-Mode | Error Correction Capacity
-----------------------------------
-1 | Approximately 10%
-2 | Approximately 20%
-3 | Approximately 30%
-4 | Approximately 40%
-5 | Approximately 50%
-----------------------------------
+ : {#tbl:gridmatrix_sizes tag=“: Grid Matrix Sizes”}
-Non-ASCII data density may be maximized by using the --fullmultibyte switch or
-by setting option_3 to ZINT_FULL_MULTIBYTE, but check that your barcode reader
-supports this before using.
+ Mode Error Correction Capacity
+ ------ ---------------------------
+ 1 Approximately 10%
+ 2 Approximately 20%
+ 3 Approximately 30%
+ 4 Approximately 40%
+ 5 Approximately 50%
+
+ : {#tbl:gridmatrix_eccs tag=“: Grid Matrix Error Correction Modes”}
+
+Non-ASCII data density may be maximized by using the --fullmultibyte switch (API
+option_3 = ZINT_FULL_MULTIBYTE), but check that your barcode reader supports
+this before using.
Grid Matrix supports Structured Append of up to 16 symbols and a numeric ID
-(file signature), which can be set by using the --structapp option (see section
-4.16) or the API structapp variable. The ID ranges from 0 (default) to 255.
+(file signature), which can be set by using the --structapp option (see 4.16
+Structured Append) (API structapp). The ID ranges from 0 (default) to 255.
6.6.11 DotCode
---------------
+
+[zint -b DOTCODE -d "[01]00012345678905[17]201231[10]ABC123456" --gs1]
+
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 --cols= option or by setting option_2 (maximum
-200). Outputting DotCode to raster images (PNG, GIF, BMP, PCX, TIF) will require
-setting the scale of the image to a larger value than the default (e.g. approx
-10) for the dots to be plotted correctly. Approximately 33% of the resulting
-symbol is comprised of error correction codewords.
+can be adjusted by using the --cols option (API option_2) (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.
-DotCode has two sets of 4 masks, designated 0-3 and 0'-3', the second 'prime'
+DotCode has two sets of 4 masks, designated 0-3 and 0’-3’, the second "prime"
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
---mask= switch with values 0-7, where 4-7 denote 0'-3', or by setting option_3
-to (N + 1) << 8 where N is 0-7.
+selected automatically by Zint but may be manually specified by using the --mask
+switch with values 0-7, where 4-7 denote 0’-3’, or in the API by setting
+option_3 = (N + 1) << 8 where N is 0-7.
DotCode supports Structured Append of up to 35 symbols, which can be set by
-using the --structapp option (see section 4.16) or the API structapp variable.
-It does not support specifying an ID.
+using the --structapp option (see 4.16 Structured Append) (API structapp). It
+does not support specifying an ID.
+
+6.6.12 Han Xin Code (ISO 20830)
+
+[zint -b HANXIN -d "Hanxin Code symbol"]
-6.6.12 Han Xin Code
--------------------
Also known as Chinese Sensible Code, Han Xin is capable of encoding characters
-in the GB 18030 character set (which includes all Unicode characters) and is
-also able to support the ECI mechanism. Support for the encoding of GS1 data has
-not yet been implemented.
+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.
-The size of the symbol can be specified using the --vers= option or setting
-option_2 to a value between 1 and 84 according to the following table.
+The size of the symbol can be specified using the --vers option (API option_2)
+to a value between 1 and 84 according to the following table.
--------------------------------------------------------------------------------
-Input | Symbol Size | Input | Symbol Size | Input | Symbol Size
--------------------------------------------------------------------------------
-1 | 23 x 23 | 29 | 79 x 79 | 57 | 135 x 135
-2 | 25 x 25 | 30 | 81 x 81 | 58 | 137 x 137
-3 | 27 x 27 | 31 | 83 x 83 | 59 | 139 x 139
-4 | 29 x 29 | 32 | 85 x 85 | 60 | 141 x 141
-5 | 31 x 31 | 33 | 87 x 87 | 61 | 143 x 143
-6 | 33 x 33 | 34 | 89 x 89 | 62 | 145 x 145
-7 | 35 x 35 | 35 | 91 x 91 | 63 | 147 x 147
-8 | 37 x 37 | 36 | 93 x 93 | 64 | 149 x 149
-9 | 39 x 39 | 37 | 95 x 95 | 65 | 151 x 151
-10 | 41 x 41 | 38 | 97 x 97 | 66 | 153 x 153
-11 | 43 x 43 | 39 | 99 x 99 | 67 | 155 x 155
-12 | 45 x 45 | 40 | 101 x 101 | 68 | 157 x 157
-13 | 47 x 47 | 41 | 103 x 103 | 69 | 159 x 159
-14 | 49 x 49 | 42 | 105 x 105 | 70 | 161 x 161
-15 | 51 x 51 | 43 | 107 x 107 | 71 | 163 x 163
-16 | 53 x 53 | 44 | 109 x 109 | 72 | 165 x 165
-17 | 55 x 55 | 45 | 111 x 111 | 73 | 167 x 167
-18 | 57 x 57 | 46 | 113 x 113 | 74 | 169 x 169
-19 | 59 x 59 | 47 | 115 x 115 | 75 | 171 x 171
-20 | 61 x 61 | 48 | 117 x 117 | 76 | 173 x 173
-21 | 63 x 63 | 49 | 119 x 119 | 77 | 175 x 175
-22 | 65 x 65 | 50 | 121 x 121 | 78 | 177 x 177
-23 | 67 x 67 | 51 | 123 x 123 | 79 | 179 x 179
-24 | 69 x 69 | 52 | 125 x 125 | 80 | 181 x 181
-25 | 71 x 71 | 53 | 127 x 127 | 81 | 183 x 183
-26 | 73 x 73 | 54 | 129 x 129 | 82 | 185 x 185
-27 | 75 x 75 | 55 | 131 x 131 | 83 | 187 x 187
-28 | 77 x 77 | 56 | 133 x 133 | 84 | 189 x 189
--------------------------------------------------------------------------------
+ Input Symbol Size Input Symbol Size Input Symbol Size
+ ------- ------------- -- ------- ------------- -- ------- -------------
+ 1 23 x 23 29 79 x 79 57 135 x 135
+ 2 25 x 25 30 81 x 81 58 137 x 137
+ 3 27 x 27 31 83 x 83 59 139 x 139
+ 4 29 x 29 32 85 x 85 60 141 x 141
+ 5 31 x 31 33 87 x 87 61 143 x 143
+ 6 33 x 33 34 89 x 89 62 145 x 145
+ 7 35 x 35 35 91 x 91 63 147 x 147
+ 8 37 x 37 36 93 x 93 64 149 x 149
+ 9 39 x 39 37 95 x 95 65 151 x 151
+ 10 41 x 41 38 97 x 97 66 153 x 153
+ 11 43 x 43 39 99 x 99 67 155 x 155
+ 12 45 x 45 40 101 x 101 68 157 x 157
+ 13 47 x 47 41 103 x 103 69 159 x 159
+ 14 49 x 49 42 105 x 105 70 161 x 161
+ 15 51 x 51 43 107 x 107 71 163 x 163
+ 16 53 x 53 44 109 x 109 72 165 x 165
+ 17 55 x 55 45 111 x 111 73 167 x 167
+ 18 57 x 57 46 113 x 113 74 169 x 169
+ 19 59 x 59 47 115 x 115 75 171 x 171
+ 20 61 x 61 48 117 x 117 76 173 x 173
+ 21 63 x 63 49 119 x 119 77 175 x 175
+ 22 65 x 65 50 121 x 121 78 177 x 177
+ 23 67 x 67 51 123 x 123 79 179 x 179
+ 24 69 x 69 52 125 x 125 80 181 x 181
+ 25 71 x 71 53 127 x 127 81 183 x 183
+ 26 73 x 73 54 129 x 129 82 185 x 185
+ 27 75 x 75 55 131 x 131 83 187 x 187
+ 28 77 x 77 56 133 x 133 84 189 x 189
+
+ : {#tbl:hanxin_sizes tag=“: Han Xin Sizes”}
There are four levels of error correction capacity available for Han Xin Code
-which can be set by using the --secure= option or by setting option_1 to a value
-from the following table:
+which can be set by using the --secure option (API option_1) to a value from the
+following table:
---------------------------
-Mode | Recovery Capacity
---------------------------
-1 | Approx 8%
-2 | Approx 15%
-3 | Approx 23%
-4 | Approx 30%
---------------------------
+ Mode Recovery Capacity
+ ------ -------------------
+ 1 Approx 8%
+ 2 Approx 15%
+ 3 Approx 23%
+ 4 Approx 30%
-Non-ASCII data density may be maximized by using the --fullmultibyte switch or
-by setting option_3 to ZINT_FULL_MULTIBYTE, but check that your barcode reader
-supports this before using.
+ : {#tbl:hanxin_eccs tag=“: Han Xin Error Correction Modes”}
+
+Non-ASCII data density may be maximized by using the --fullmultibyte switch (API
+option_3 = ZINT_FULL_MULTIBYTE), but check that your barcode reader supports
+this before using.
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 --mask= switch with values 0-3, or by setting option_3 to
-(N + 1) << 8 where N is 0-3. To use with ZINT_FULL_MULTIBYTE set option_3 =
-ZINT_FULL_MULTIBYTE | (N + 1) << 8.
+by using the --mask switch with values 0-3, or in the API by setting
+option_3 = (N + 1) << 8 where N is 0-3. To use with ZINT_FULL_MULTIBYTE set
+
+ option_3 = ZINT_FULL_MULTIBYTE | (N + 1) << 8
6.6.13 Ultracode
-----------------
+
+[zint -b ULTRA -d "HEIMASÍÐA KENNARAHÁSKÓLA ÍSLANDS"]
+
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
---secure= option or by setting option_1 to a value as shown in the following
-table:
+--secure option (API option_1) to a value as shown in the following table:
------------------------------------------------------------------
-Value | EC Level | Amount of symbol holding error correction data
------------------------------------------------------------------
-1 | EC0 | 0% - Error detection only
-2 | EC1 | Approx 5%
-3 | EC2 | Approx 9% - Default value
-4 | EC3 | Approx 17%
-5 | EC4 | Approx 25%
-6 | EC5 | Approx 33%
------------------------------------------------------------------
+ Value EC Level Amount of symbol holding error correction data
+ ------- ---------- ------------------------------------------------
+ 1 EC0 0% - Error detection only
+ 2 EC1 Approx 5%
+ 3 EC2 Approx 9% - Default value
+ 4 EC3 Approx 17%
+ 5 EC4 Approx 25%
+ 6 EC5 Approx 33%
-Zint does not currently implement data compression by default, but this can
-be initiated through the API by setting
+ : {#tbl:ultra_eccs tag=“: Ultracode Error Correction Values”}
-symbol->option_3 = ULTRA_COMPRESSION;
+Zint does not currently implement data compression by default, but this can be
+initiated through the API by setting
-WARNING: Ultracode data compression is experimental and should not be used
-in a production environment.
+ symbol->option_3 = ULTRA_COMPRESSION;
+
+WARNING: Ultracode data compression is experimental and should not be used in a
+production environment.
Revision 2 of Ultracode (2021) which swops and inverts the DCCU and DCCL tiles
-may be specified using the --vers= switch with a value of 2 or by setting
-option_2 to 2.
+may be specified using --vers=2 (API option_2 = 2).
Ultracode supports Structured Append of up to 8 symbols and an optional numeric
-ID (File Number), which can be set by using the --structapp option (see section
-4.16) or the API structapp variable. The ID ranges from 1 to 80088. If an ID is
+ID (File Number), which can be set by using the --structapp option (see 4.16
+Structured Append) (API structapp). The ID ranges from 1 to 80088. If an ID is
not given, no ID is encoded.
6.7 Other Barcode-Like Markings
--------------------------------
+
6.7.1 Facing Identification Mark (FIM)
---------------------------------------
+
+[zint -b FIM --compliantheight -d "C"]
+
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.
-------------------------------------------------------------------------------
-Code Letter | Usage
-------------------------------------------------------------------------------
-A | Used for courtesy reply mail and metered reply mail with a
- | pre-printed POSTNET symbol.
-B | Used for business reply mail without a pre-printed zip code.
-C | Used for business reply mail with a pre-printed zip code.
-D | Used for Information Based Indicia (IBI) postage.
-E | Used for customized mail with a USPS Intelligent Mail barcode.
-------------------------------------------------------------------------------
+ Code Letter Usage
+ ------------- ----------------------------------------------------------------
+ A Used for courtesy reply mail and metered reply mail with a
+ pre-printed POSTNET symbol.
+ B Used for business reply mail without a pre-printed zip code.
+ C Used for business reply mail with a pre-printed zip code.
+ D Used for Information Based Indicia (IBI) postage.
+ E Used for customized mail with a USPS Intelligent Mail barcode.
+
+ : {#tbl:fim_characters tag=“: Valid FIM Characters”}
6.7.2 Flattermarken
--------------------
+
+[zint -b FLAT -d "1304056"]
+
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 90 digits and does not include a check digit.
6.7.3 DAFT Code
----------------
+
+[zint -b DAFT -d "AAFDTTDAFADTFTTFFFDATFTADTTFFTDAFAFDTF" --height=8.494 --vers=256]
+
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 'D', 'A', 'F'
and 'T' 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 --vers= option or by setting option_2. The
-default value is 250 (25%).
+thousandths (permille) using the --vers option (API option_2). The default value
+is 250 (25%).
+For example the following
+
+ zint -b DAFT -d AAFDTTDAFADTFTTFFFDATFTADTTFFTDAFAFDTF --height=8.494 --vers=256
+
+produces the same barcode (see 6.5.3 Royal Mail 4-State Customer Code (RM4SCC))
+as
+
+ zint -b RM4SCC --compliantheight -d "W1J0TR01"
7. Legal and Version Information
-================================
+
7.1 License
------------
+
Zint, libzint and Zint Barcode Studio are Copyright © 2022 Robin Stuart. All
-historical versions are distributed under the GNU General Public License
-version 3 or later. Version 2.5 (and later) is released under a dual license:
-the encoding library is released under the BSD license whereas the GUI, Zint
-Barcode Studio, is released under the GNU General Public License version 3 or
-later.
+historical versions are distributed under the GNU General Public License version
+3 or later. Version 2.5 (and later) is released under a dual license: the
+encoding library is released under the BSD license whereas the GUI, Zint Barcode
+Studio, is released under the GNU General Public License version 3 or later.
Telepen is a trademark of SB Electronic Systems Ltd.
@@ -3167,12 +3866,12 @@ countries.
Zint.org.uk website design and hosting provided by Robert Elliott.
7.2 Patent Issues
------------------
+
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
+Zint are ‘unadopted’, that is the holder does not object to their methods being
used.
Any methods patented or owned by third parties or trademarks or registered
@@ -3181,149 +3880,248 @@ their respective owners and do not indicate endorsement or affiliation with
those owners, companies or organisations.
7.3 Version Information
------------------------
-The current version of Zint is 2.10.0.9. See "ChangeLog" in the project root
-directory for information on all releases.
+
+The current stable version of Zint is 2.10.0, released on 14th August 2021.
+
+See "ChangeLog" in the project root directory for information on all releases.
7.4 Sources of Information
---------------------------
+
Below is a list of some of the sources used in rough chronological order:
-Nick Johnson's Barcode Specifications
-Bar Code 1 Specification Source Page
-SB Electronic Systems Telepen website
-Pharmacode specifications from Laetus
-Morovia RM4SCC specification
-Australia Post's 'A Guide to Printing the 4-State Barcode' and bcsample source
- code
-Plessey algorithm from GNU-Barcode v0.98 by Leonid A. Broukhis
-GS1 General Specifications v 8.0 Issue 2
-PNG: The Definitive Guide and wpng source code by Greg Reolofs
-PDF417 specification and pdf417 source code by Grand Zebu
-Barcode Reference, TBarCode/X User Documentation and TBarCode/X demonstration
- program from Tec-It
-IEC16022 source code by Stefan Schmidt et al
-United States Postal Service Specification USPS-B-3200
-Adobe Systems Incorporated Encapsulated PostScript File Format Specification
-BSI Online Library
-Libdmtx Data Matrix ECC200 decoding library
+- Nick Johnson’s Barcode Specifications
+- Bar Code 1 Specification Source Page
+- SB Electronic Systems Telepen website
+- Pharmacode specifications from Laetus
+- Morovia RM4SCC specification
+- Australia Post’s ‘A Guide to Printing the 4-State Barcode’ and bcsample
+ source code
+- Plessey algorithm from GNU-Barcode v0.98 by Leonid A. Broukhis
+- GS1 General Specifications v 8.0 Issue 2
+- PNG: The Definitive Guide and wpng source code by Greg Reolofs
+- PDF417 specification and pdf417 source code by Grand Zebu
+- Barcode Reference, TBarCode/X User Documentation and TBarCode/X
+ demonstration program from Tec-It
+- IEC16022 source code by Stefan Schmidt et al
+- United States Postal Service Specification USPS-B-3200
+- Adobe Systems Incorporated Encapsulated PostScript File Format Specification
+- BSI Online Library
+- Libdmtx Data Matrix ECC200 decoding library
+
+7.5 Standards Compliance
-7.5 Standard Compliance
------------------------
Zint was developed to provide compliance with the following British and
international standards:
-> BS EN 797:1996 Bar coding - Symbology specifications - 'EAN/UPC'
-> BS EN 798:1996 Bar coding - Symbology specifications - 'Codabar'
-> BS EN 12323:2005 AIDC technologies - Symbology specifications - Code 16K
-> ISO/IEC 15417:2007 Information technology - Automatic identification and data
- capture techniques - Code 128 bar code symbology specification
-> ISO/IEC 15438:2015 Information technology - Automatic identification and data
- capture techniques - PDF417 bar code symbology specification
-> ISO/IEC 16022:2006 Information technology - Automatic identification and data
- capture techniques - Data Matrix ECC200 bar code symbology specification
-> ISO/IEC 16023:2000 Information technology - International symbology
- specification - MaxiCode
-> ISO/IEC 16388:2007 Information technology - Automatic identification and data
- capture techniques - Code 39 bar code symbology specification
-> ISO/IEC 18004:2015 Information technology - Automatic identification and data
- capture techniques - QR Code bar code symbology specification
-> ISO/IEC 20830:2021 Information technology - Automatic identification and data
- capture techniques - Han Xin Code bar code symbology specification
-> ISO/IEC 24723:2010 Information technology - Automatic identification and data
- capture techniques - GS1 Composite bar code symbology specification
-> ISO/IEC 24724:2011 Information technology - Automatic identification and data
- capture techniques - GS1 DataBar bar code symbology specification
-> ISO/IEC 24728:2006 Information technology - Automatic identification and data
- capture techniques - MicroPDF417 bar code symbology specification
-> ISO/IEC 24778:2008 Information technology - Automatic identification and data
- capture techniques - Aztec Code bar code symbology specification
-> ISO/IEC JTC1/SC31N000 (Draft 2019-6-24) Information technology - Automatic
- identification and data capture techniques - Rectangular Micro QR Code
- (rMQR) bar code symbology specification
-> ISO/IEC 16390:2007 Information technology - Automatic identification and data
- capture techniques - Interleaved 2 of 5 bar code symbology specification
-> ISO/IEC 21471:2020 Information technology - Automatic identification and data
- capture techniques - Extended rectangular data matrix (DMRE) bar code
- symbology specification
-> Uniform Symbology Specification Code One (AIM Inc., 1994)
-> ANSI/AIM BC12-1998 - Uniform Symbology Specification Channel Code
-> ANSI/AIM BC6-2000 - Uniform Symbology Specification Code 49
-> ANSI/AIM BC5-1995 - Uniform Symbology Specification Code 93
-> ANSI/HIBC 2.6-2016 - The Health Industry Bar Code (HIBC) Supplier Labeling
- Standard
-> AIM ISS-X-24 - Uniform Symbology Specification Codablock-F
-> 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)
-> AIMD014 (v 1.63) - Information technology, Automatic identification and data
- capture techniques - Bar code symbology specification - Grid Matrix
- (Released 9th Dec 2008)
-> AIMD/TSC15032-43 (v 0.99c) - International Technical Specification -
- Ultracode Symbology (Draft) (Released 4th Nov 2015)
-> GS1 General Specifications Release 22.0 (Jan 2022)
-> AIM ITS/04-001 International Technical Standard - Extended Channel
- Interpretations Part 1: Identification Schemes and Protocol (Released 24th
- May 2004)
-> AIM ITS/04-023 International Technical Standard - Extended Channel
- Interpretations Part 3: Register (Version 2, February 2022)
-
+- BS EN 798:1996 Bar coding - Symbology specifications - ‘Codabar’
+- BS EN 12323:2005 AIDC technologies - Symbology specifications - Code 16K
+- ISO/IEC 15420:2009 Information technology - Automatic identification and
+ data capture techniques - EAN/UPC bar code symbology specification
+- ISO/IEC 15417:2007 Information technology - Automatic identification and
+ data capture techniques - Code 128 bar code symbology specification
+- ISO/IEC 15438:2015 Information technology - Automatic identification and
+ data capture techniques - PDF417 bar code symbology specification
+- ISO/IEC 16022:2006 Information technology - Automatic identification and
+ data capture techniques - Data Matrix ECC200 bar code symbology
+ specification
+- ISO/IEC 16023:2000 Information technology - International symbology
+ specification - MaxiCode
+- ISO/IEC 16388:2007 Information technology - Automatic identification and
+ data capture techniques - Code 39 bar code symbology specification
+- ISO/IEC 18004:2015 Information technology - Automatic identification and
+ data capture techniques - QR Code bar code symbology specification
+- ISO/IEC 20830:2021 Information technology - Automatic identification and
+ data capture techniques - Han Xin Code bar code symbology specification
+- ISO/IEC 24723:2010 Information technology - Automatic identification and
+ data capture techniques - GS1 Composite bar code symbology specification
+- ISO/IEC 24724:2011 Information technology - Automatic identification and
+ data capture techniques - GS1 DataBar bar code symbology specification
+- ISO/IEC 24728:2006 Information technology - Automatic identification and
+ data capture techniques - MicroPDF417 bar code symbology specification
+- ISO/IEC 24778:2008 Information technology - Automatic identification and
+ data capture techniques - Aztec Code bar code symbology specification
+- ISO/IEC JTC1/SC31N000 (Draft 2019-6-24) Information technology - Automatic
+ identification and data capture techniques - Rectangular Micro QR Code
+ (rMQR) bar code symbology specification
+- ISO/IEC 16390:2007 Information technology - Automatic identification and
+ data capture techniques - Interleaved 2 of 5 bar code symbology
+ specification
+- ISO/IEC 21471:2020 Information technology - Automatic identification and
+ data capture techniques - Extended rectangular data matrix (DMRE) bar code
+ symbology specification
+- Uniform Symbology Specification Code One (AIM Inc., 1994)
+- ANSI/AIM BC12-1998 - Uniform Symbology Specification Channel Code
+- ANSI/AIM BC6-2000 - Uniform Symbology Specification Code 49
+- ANSI/AIM BC5-1995 - Uniform Symbology Specification Code 93
+- ANSI/HIBC 2.6-2016 - The Health Industry Bar Code (HIBC) Supplier Labeling
+ Standard
+- AIM ISS-X-24 - Uniform Symbology Specification Codablock-F
+- 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)
+- AIMD014 (v 1.63) - Information technology, Automatic identification and data
+ capture techniques - Bar code symbology specification - Grid Matrix
+ (Released 9th Dec 2008)
+- AIMD/TSC15032-43 (v 0.99c) - International Technical Specification -
+ Ultracode Symbology (Draft) (Released 4th Nov 2015)
+- GS1 General Specifications Release 22.0 (Jan 2022)
+- AIM ITS/04-001 International Technical Standard - Extended Channel
+ Interpretations Part 1: Identification Schemes and Protocol (Released 24th
+ May 2004)
+- AIM ITS/04-023 International Technical Standard - Extended Channel
+ Interpretations Part 3: Register (Version 2, February 2022)
A. Character Encoding
-=====================
+
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 character support as shown in the subsequent section.
+Zint. All symbologies use standard ASCII input as shown in section A.1, but some
+support extended characters as shown in the subsequent A.2 Latin Alphabet No. 1
+(ISO/IEC 8859-1).
A.1 ASCII Standard
-------------------
-The ubiquitous ASCII standard is well known to most computer users. It's
+
+The ubiquitous ASCII standard is well known to most computer users. It’s
reproduced here for reference.
--------------------------------------------------------------
-Hex | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7
--------------------------------------------------------------
-0 | NUL | DLE | SPACE | 0 | @ | P | ` | p
-1 | SOH | DC1 | ! | 1 | A | Q | a | q
-2 | STX | DC2 | " | 2 | B | R | b | r
-3 | ETX | DC3 | # | 3 | C | S | c | s
-4 | EOT | DC4 | $ | 4 | D | T | d | t
-5 | ENQ | NAK | % | 5 | E | U | e | u
-6 | ACK | SYN | & | 6 | F | V | f | v
-7 | BEL | ETB | ' | 7 | G | W | g | w
-8 | BS | CAN | ( | 8 | H | X | h | x
-9 | TAB | EM | ) | 9 | I | Y | i | y
-A | LF | SUB | * | : | J | Z | j | z
-B | VT | ESC | + | ; | K | [ | k | {
-C | FF | FS | , | < | L | \ | l | |
-D | CR | GS | - | = | M | ] | m | }
-E | SO | RS | . | > | N | ^ | n | ~
-F | SI | US | / | ? | O | _ | o | DEL
--------------------------------------------------------------
+ Hex 0 1 2 3 4 5 6 7
+ ----- ----- ----- ------- --- --- --- --- -----
+ 0 NUL DLE SPACE 0 @ P ` p
+ 1 SOH DC1 ! 1 A Q a q
+ 2 STX DC2 " 2 B R b r
+ 3 ETX DC3 # 3 C S c s
+ 4 EOT DC4 $ 4 D T d t
+ 5 ENQ NAK % 5 E U e u
+ 6 ACK SYN & 6 F V f v
+ 7 BEL ETB ' 7 G W g w
+ 8 BS CAN ( 8 H X h x
+ 9 TAB EM ) 9 I Y i y
+ A LF SUB * : J Z j z
+ B VT ESC + ; K [ k {
+ C FF FS , < L \ l |
+ D CR GS - = M ] m }
+ E SO RS . > N ^ n ~
+ F SI US / ? O _ o DEL
-A.2 Latin Alphabet No 1 (ISO/IEC 8859-1)
-----------------------------------------
-A common extension to the ASCII standard, Latin-1 is used to expand the range
-of Code 128, PDF417 and other symbols. Input strings to the CLI should be in
-UTF-8 (Unicode) format, unless the --binary switch is given.
+ : {#tbl:ascii tag=“: ASCII”}
-------------------------------------------------------
-Hex | 8 | 9 | A | B | C | D | E | F
-------------------------------------------------------
-0 | | | NBSP | ° | À | Ð | à | ð
-1 | | | ¡ | ± | Á | Ñ | á | ñ
-2 | | | ¢ | ² | Â | Ò | â | ò
-3 | | | £ | ³ | Ã | Ó | ã | ó
-4 | | | ¤ | ´ | Ä | Ô | ä | ô
-5 | | | ¥ | μ | Å | Õ | å | õ
-6 | | | ¦ | ¶ | Æ | Ö | æ | ö
-7 | | | § | · | Ç | × | ç | ÷
-8 | | | ¨ | ¸ | È | Ø | è | ø
-9 | | | © | ¹ | É | Ù | é | ù
-A | | | ª | º | Ê | Ú | ê | ú
-B | | | « | » | Ë | Û | ë | û
-C | | | ¬ | ¼ | Ì | Ü | ì | ü
-D | | | SHY | ½ | Í | Ý | í | ý
-E | | | ® | ¾ | Î | Þ | î | þ
-F | | | ¯ | ¿ | Ï | ß | ï | ÿ
-------------------------------------------------------
+A.2 Latin Alphabet No. 1 (ISO/IEC 8859-1)
+
+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 @tbl:default_character_sets) when a
+codepoint above hex 9F is encoded. Note that codepoints hex 80 to 9F are not
+defined.
+
+ Hex 8 9 A B C D E F
+ ----- --- --- ------ --- --- --- --- ---
+ 0 NBSP ° À Ð à ð
+ 1 ¡ ± Á Ñ á ñ
+ 2 ¢ ² Â Ò â ò
+ 3 £ ³ Ã Ó ã ó
+ 4 ¤ ´ Ä Ô ä ô
+ 5 ¥ μ Å Õ å õ
+ 6 ¦ ¶ Æ Ö æ ö
+ 7 § · Ç × ç ÷
+ 8 ¨ ¸ È Ø è ø
+ 9 © ¹ É Ù é ù
+ A ª º Ê Ú ê ú
+ B « » Ë Û ë û
+ C ¬ ¼ Ì Ü ì ü
+ D SHY ½ Í Ý í ý
+ E ® ¾ Î Þ î þ
+ F ¯ ¿ Ï ß ï ÿ
+
+ : {#tbl:iso_iec_8869_1 tag=“: ISO/IEC 8859-1”}
+
+B. CLI Help
+
+ Zint version 2.10.0.9
+ Encode input data in a barcode and save as BMP/EMF/EPS/GIF/PCX/PNG/SVG/TIF/TXT
+
+ -b, --barcode=TYPE Number or name of barcode type. Default is 20 (CODE128)
+ --addongap=NUMBER Set add-on gap in multiples of X-dimension for UPC/EAN
+ --batch Treat each line of input file as a separate data set
+ --bg=COLOUR Specify a background colour (in hex RGB/RGBA)
+ --binary Treat input as raw binary data
+ --bind Add boundary bars
+ --bold Use bold text
+ --border=NUMBER Set width of border in multiples of X-dimension
+ --box Add a box around the symbol
+ --cmyk Use CMYK colour space in EPS/TIF symbols
+ --cols=NUMBER Set the number of data columns in symbol
+ --compliantheight Warn if height not compliant, and use standard default
+ -d, --data=DATA Set the symbol data content (segment 0)
+ --direct Send output to stdout
+ --dmre Allow Data Matrix Rectangular Extended
+ --dotsize=NUMBER Set radius of dots in dotty mode
+ --dotty Use dots instead of squares for matrix symbols
+ --dump Dump hexadecimal representation to stdout
+ -e, --ecinos Display ECI (Extended Channel Interpretation) table
+ --eci=NUMBER Set the ECI code for the data (segment 0)
+ --esc Process escape characters in input data
+ --fast Use faster encodation (Data Matrix)
+ --fg=COLOUR Specify a foreground colour (in hex RGB/RGBA)
+ --filetype=TYPE Set output file type BMP/EMF/EPS/GIF/PCX/PNG/SVG/TIF/TXT
+ --fullmultibyte Use multibyte for binary/Latin (QR/Han Xin/Grid Matrix)
+ --gs1 Treat input as GS1 compatible data
+ --gs1nocheck Do not check validity of GS1 data
+ --gs1parens Process parentheses "()" as GS1 AI delimiters, not "[]"
+ --gssep Use separator GS for GS1 (Data Matrix)
+ --guarddescent=NUMBER Set height of guard bar descent in X-dims (UPC/EAN)
+ -h, --help Display help message
+ --height=NUMBER Set height of symbol in multiples of X-dimension
+ --heightperrow Treat height as per-row
+ -i, --input=FILE Read input data from FILE
+ --init Create reader initialisation/programming symbol
+ --mask=NUMBER Set masking pattern to use (QR/Han Xin/DotCode)
+ --mirror Use batch data to determine filename
+ --mode=NUMBER Set encoding mode (MaxiCode/Composite)
+ --nobackground Remove background (EMF/EPS/GIF/PNG/SVG/TIF only)
+ --noquietzones Disable default quiet zones
+ --notext Remove human readable text
+ -o, --output=FILE Send output to FILE. Default is out.png
+ --primary=STRING Set primary message (MaxiCode/Composite)
+ --quietzones Add compliant quiet zones
+ -r, --reverse Reverse colours (white on black)
+ --rotate=NUMBER Rotate symbol by NUMBER degrees
+ --rows=NUMBER Set number of rows (Codablock-F/PDF417)
+ --scale=NUMBER Adjust size of X-dimension
+ --scmvv=NUMBER Prefix SCM with "[)>\R01\Gvv" (vv is NUMBER) (MaxiCode)
+ --secure=NUMBER Set error correction level (ECC)
+ --segN=ECI,DATA Set the ECI & data content for segment N, where N 1 to 9
+ --separator=NUMBER Set height of row separator bars (stacked symbologies)
+ --small Use small text
+ --square Force Data Matrix symbols to be square
+ --structapp=I,C[,ID] Set Structured Append info (I index, C count)
+ -t, --types Display table of barcode types
+ --vers=NUMBER Set symbol version (size, check digits, other options)
+ -v, --version Display Zint version
+ --vwhitesp=NUMBER Set height of vertical whitespace in multiples of X-dim
+ -w, --whitesp=NUMBER Set width of horizontal whitespace in multiples of X-dim
+ --werror Convert all warnings into errors
+
+[1] 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!
+
+[2] The symbologies marked with an asterisk (*) in the above table used
+different names in Zint before version 2.9.0. For example, symbology 29 used the
+name BARCODE_RSS14. These names are now deprecated but are still recognised by
+Zint and will continue to be supported in future versions.
+
+[3] Shift JIS (JIS X 0201 Roman) re-maps two ASCII characters: backslash (\) to
+the yen sign (¥), and tilde (~) to overline (U+203E).
+
+[4] ISO/IEC 646 Invariant is a subset of ASCII with 12 characters undefined: #,
+$, @, [, \, ], ^, `, {, |, }, ~.
+
+[5] This 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).
+
+[6] This flag is always set for Codablock-F, Code 16K and Code 49. Special
+considerations apply to ITF-14 - see 6.1.2.6 ITF-14.
+
+[7] 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.
diff --git a/docs/pygments.theme b/docs/pygments.theme
new file mode 100644
index 00000000..d2777d94
--- /dev/null
+++ b/docs/pygments.theme
@@ -0,0 +1,211 @@
+{
+ "text-color": null,
+ "background-color": "#fafafa",
+ "line-number-color": "#aaaaaa",
+ "line-number-background-color": null,
+ "text-styles": {
+ "Alert": {
+ "text-color": "#ff0000",
+ "background-color": null,
+ "bold": true,
+ "italic": false,
+ "underline": false
+ },
+ "Annotation": {
+ "text-color": "#60a0b0",
+ "background-color": null,
+ "bold": true,
+ "italic": true,
+ "underline": false
+ },
+ "Attribute": {
+ "text-color": "#7d9029",
+ "background-color": null,
+ "bold": false,
+ "italic": false,
+ "underline": false
+ },
+ "BaseN": {
+ "text-color": "#40a070",
+ "background-color": null,
+ "bold": false,
+ "italic": false,
+ "underline": false
+ },
+ "BuiltIn": {
+ "text-color": null,
+ "background-color": null,
+ "bold": false,
+ "italic": false,
+ "underline": false
+ },
+ "Char": {
+ "text-color": "#4070a0",
+ "background-color": null,
+ "bold": false,
+ "italic": false,
+ "underline": false
+ },
+ "Comment": {
+ "text-color": "#60a0b0",
+ "background-color": null,
+ "bold": false,
+ "italic": true,
+ "underline": false
+ },
+ "CommentVar": {
+ "text-color": "#60a0b0",
+ "background-color": null,
+ "bold": true,
+ "italic": true,
+ "underline": false
+ },
+ "Constant": {
+ "text-color": "#880000",
+ "background-color": null,
+ "bold": false,
+ "italic": false,
+ "underline": false
+ },
+ "ControlFlow": {
+ "text-color": "#007020",
+ "background-color": null,
+ "bold": true,
+ "italic": false,
+ "underline": false
+ },
+ "DataType": {
+ "text-color": "#902000",
+ "background-color": null,
+ "bold": false,
+ "italic": false,
+ "underline": false
+ },
+ "DecVal": {
+ "text-color": "#40a070",
+ "background-color": null,
+ "bold": false,
+ "italic": false,
+ "underline": false
+ },
+ "Documentation": {
+ "text-color": "#ba2121",
+ "background-color": null,
+ "bold": false,
+ "italic": true,
+ "underline": false
+ },
+ "Error": {
+ "text-color": "#ff0000",
+ "background-color": null,
+ "bold": true,
+ "italic": false,
+ "underline": false
+ },
+ "Extension": {
+ "text-color": null,
+ "background-color": null,
+ "bold": false,
+ "italic": false,
+ "underline": false
+ },
+ "Float": {
+ "text-color": "#40a070",
+ "background-color": null,
+ "bold": false,
+ "italic": false,
+ "underline": false
+ },
+ "Function": {
+ "text-color": "#06287e",
+ "background-color": null,
+ "bold": false,
+ "italic": false,
+ "underline": false
+ },
+ "Import": {
+ "text-color": null,
+ "background-color": null,
+ "bold": false,
+ "italic": false,
+ "underline": false
+ },
+ "Information": {
+ "text-color": "#60a0b0",
+ "background-color": null,
+ "bold": true,
+ "italic": true,
+ "underline": false
+ },
+ "Keyword": {
+ "text-color": "#007020",
+ "background-color": null,
+ "bold": true,
+ "italic": false,
+ "underline": false
+ },
+ "Operator": {
+ "text-color": "#666666",
+ "background-color": null,
+ "bold": false,
+ "italic": false,
+ "underline": false
+ },
+ "Other": {
+ "text-color": "#007020",
+ "background-color": null,
+ "bold": false,
+ "italic": false,
+ "underline": false
+ },
+ "Preprocessor": {
+ "text-color": "#bc7a00",
+ "background-color": null,
+ "bold": false,
+ "italic": false,
+ "underline": false
+ },
+ "SpecialChar": {
+ "text-color": "#4070a0",
+ "background-color": null,
+ "bold": false,
+ "italic": false,
+ "underline": false
+ },
+ "SpecialString": {
+ "text-color": "#bb6688",
+ "background-color": null,
+ "bold": false,
+ "italic": false,
+ "underline": false
+ },
+ "String": {
+ "text-color": "#4070a0",
+ "background-color": null,
+ "bold": false,
+ "italic": false,
+ "underline": false
+ },
+ "Variable": {
+ "text-color": "#19177c",
+ "background-color": null,
+ "bold": false,
+ "italic": false,
+ "underline": false
+ },
+ "VerbatimString": {
+ "text-color": "#4070a0",
+ "background-color": null,
+ "bold": false,
+ "italic": false,
+ "underline": false
+ },
+ "Warning": {
+ "text-color": "#60a0b0",
+ "background-color": null,
+ "bold": true,
+ "italic": true,
+ "underline": false
+ }
+ }
+}
diff --git a/docs/zint.1.gz b/docs/zint.1.gz
new file mode 100644
index 00000000..05eba680
Binary files /dev/null and b/docs/zint.1.gz differ
diff --git a/docs/zint.1.pmd b/docs/zint.1.pmd
new file mode 100644
index 00000000..308249d9
--- /dev/null
+++ b/docs/zint.1.pmd
@@ -0,0 +1,336 @@
+% zint(1) Version 2.10.0.9
+% Robin Stuart
+% May 2022
+
+# NAME
+
+`zint` - Encode data as a barcode image
+
+# SYNOPSIS
+
+| `zint` [`-h` | `--help`]
+| `zint` [*options*]
+
+# DESCRIPTION
+
+zint takes input data from the command line or a file to encode in a barcode which is then output to an image file.
+
+The output image file (specified with `-o` or `--output`) may be in one of these formats: Windows Bitmap (`BMP`),
+Enhanced Metafile Format (`EMF`), Encapsulated PostScript (`EPS`), Graphics Interchange Format (`GIF`), ZSoft
+Paintbrush (`PCX`), Portable Network Format (`PNG`), Scalable Vector Graphic (`SVG`), or Tagged Image File Format
+(`TIF`).
+
+# OPTIONS
+
+`-h`, `--help`
+: Print usage information summarizing command line options.
+
+`-b TYPE`, `--barcode=TYPE`
+: Set the barcode symbology that will be used to encode the data. *TYPE* 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 `-t`
+ or `--types` option. Type names are case-insensitive, and non-alphanumerics are ignored.
+
+`--addongap=INTEGER`
+: For UPC/EAN symbologies, set the gap between the main data and the add-on. *INTEGER* 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.
+
+`--batch`
+: Treat each line of an input file specified with `-i` or `--input` 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 `-o` or `--output` option.
+
+`--bg=COLOUR`
+: Specify a background (paper) colour where *COLOUR* is in hex RRGGBB or RRGGGAA format.
+
+`--binary`
+: 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 encodation takes place.
+
+`--bind`
+: Add horizontal boundary bars, aka bearer bars, to the symbol. The width of the boundary bars must be specified by
+ the `--border` option. `--bind` can also be used to add row separator bars to symbols stacked with multiple `-d`
+ or `--data` inputs, in which case the width of the separator bars must be specified with the `--separator` option.
+
+`--bold`
+: Use bold text for the Human Readable Text.
+
+`--border=INTEGER`
+: Set the width of boundary bars (`--bind`) or box borders (`--box`), where *INTEGER* is in integral multiples of
+ the X-dimension.
+
+`--box`
+: Add a box around the symbol. The width of the borders must be specified by the `--border` option.
+
+`--cmyk`
+: Use the CMYK colour space when outputting to Encapsulated PostScript (EPS) or TIF files.
+
+`--cols=INTEGER`
+: Set the number of data columns in the symbol to *INTEGER*. Affects Codablock-F, PDF417, MicroPDF417, GS1 DataBar
+ Expanded Stacked (DBar_ExpStk) and DotCode symbols.
+
+`--compliantheight`
+
+: Warn if the height specified by the `--height` option is not compliant with the barcode's specification, or if
+ `--height` is not given, default to the height specified by the specification (if any).
+
+`-d`, `--data=DATA`
+
+: Specify the input *DATA* to encode. The `--esc` option may be used to enter non-printing characters using escape
+ sequences.
+
+`--direct`
+
+: Send output to stdout, which in most cases should be re-directed via a pipe.
+
+`--dmre`
+
+: For Data Matrix symbols, allow Data Matrix Rectangular Extended (RMRE) sizes when considering automatic sizes.
+
+`--dotsize=NUMBER`
+
+: Set the radius of the dots in dotty mode (`--dotty`). *NUMBER* is in multiples of the X-dimension, and may be
+ floating-point.
+
+`--dotty`
+
+: Use dots instead of squares for matrix symbols. DotCode is always in dotty mode.
+
+`--dump`
+
+: Dump a hexadecimal representation of the symbol's encodation to stdout.
+
+`-e`, `--ecinos`
+
+: Display the table of ECIs (Extended Channel Interpretations).
+
+`--eci=INTEGER`
+
+: Set the ECI code for the input data to *INTEGER*. See `-e` or `--ecinos` for a list of the ECIs available.
+
+`--esc`
+
+: Process escape characters in the input data. The escape sequences are:
+
+ - `\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
+ - `\xNN` (0xNN) Any 8-bit character where NN is hexadecimal
+ - `\uNNNN` (U+NNNN) Any 16-bit Unicode BMP character where NNNN is hexadecimal
+
+`--fast`
+
+: Use faster if less optimal encodation (currently affects Data Matrix only).
+
+`--fg=COLOUR`
+
+: Specify a foreground (ink) colour where *COLOUR* is in hex RRGGBB or RRGGGAA format.
+
+`--filetype=TYPE`
+
+: Set the output file type to *TYPE*, which is one of `BMP`, `EMF`, `EPS`, `GIF`, `PCX`, `PNG`, `SVG`, `TIF`, `TXT`.
+
+`--fullmultibyte`
+
+: Use the multibyte modes of QR Code, Han Xin, and Grid Matrix for non-ASCII data.
+
+`--gs1`
+
+: Treat input as GS1 compatible data. Application Identifiers (AIs) should be placed in square brackets `"[]"` (but
+ see `--gs1parens`).
+
+`--gs1nocheck`
+
+: Do not check the validity of GS1 data.
+
+`--gs1parens`
+
+: Process parentheses `"()"` as GS1 AI delimiters, rather than square brackets `"[]"`. The input data must not
+ contain parentheses.
+
+`--gssep`
+
+: For Data Matrix in GS1 mode, use `GS` (0x1D) as the GS1 data separator instead of `FNC1`.
+
+`--guarddescent=INTEGER`
+
+: For UPC/EAN symbols, set the height of the guard bars' descent, where *INTEGER* is in integral multiples of the
+ X-dimension.
+
+`--height=NUMBER`
+
+: Set the height of the symbol in multiples of the X-dimension. *NUMBER* may be floating-point. Increments of 0.5
+ are recommended for raster output (BMP, GIF, PCX, PNG and TIF).
+
+`--heightperrow`
+
+: Treat height as per-row. Affects Codablock-F, Code16K, Code 49, GS1 DataBar Expanded Stacked (DBar_ExpStk),
+ MicroPDF417 and PDF417.
+
+`-i`, `--input=FILE`
+
+: Read the input data from *FILE*.
+
+`--init`
+
+: Create a reader initialisation/programming symbol.
+
+`--mask=INTEGER`
+
+: Set the masking pattern to use for QR Code, Han Xin or DotCode to *INTEGER*, overriding the automatic selection.
+
+`--mirror`
+
+: Use the batch data to determine the filename in batch mode (`--batch`).
+
+`--mode=INTEGER`
+
+: For MaxiCode and composite symbols, set the encoding mode to *INTEGER*. The meaning is symbol-specific.
+
+`--nobackground`
+
+: Remove the background colour (EMF, EPS, GIF, PNG, SVG and TIF only).
+
+`--noquietzones`
+
+: Disable any quiet zones for symbols that define them by default.
+
+`--notext`
+
+: Remove the Human Readable Text.
+
+`-o`, `--output=FILE`
+
+: Send the output to *FILE*. When not in batch mode, the default is "out.png" (or "out.gif" if zint built without
+ PNG support). When in batch mode (`--batch`), special characters can be used to format the output filenames:
+
+ - `~` Insert a number or 0
+ - `#` Insert a number or space
+ - `@` Insert a number or `*`
+ - Any other Insert literally
+
+`--primary=STRING`
+
+: For MaxiCode, set the content of the primary message. For Composite symbols, set the content of the linear symbol.
+
+`--quietzones`
+
+: Add compliant quiet zones for symbols that specify one.
+
+`-r`, `--reverse`
+
+: Reverse the foreground and background colours (white on black).
+
+`--rotate=INTEGER`
+
+: Rotate the symbol by *INTEGER* degrees, where *INTEGER* can be 0, 90, 270 or 360.
+
+`--rows=INTEGER`
+
+: Set the number of rows for Codablock-F or PDF417 to *INTEGER*.
+
+`--scale=NUMBER`
+
+: Set the X-dimension. *NUMBER* may be floating-point.
+
+`--scmvv=INTEGER`
+
+: For MaxiCode, prefix the Structured Carrier Message (SCM) with `"[)>\R01\Gvv"`, where vv is a 2-digit *INTEGER*.
+
+`--secure=INTEGER`
+
+: Set the error correction level (ECC) or check character options to *INTEGER*. The meaning is symbol-specific.
+
+`--segN=ECI,DATA`
+
+: Set the *ECI* & *DATA* content for segment N, where N is 1 to 9. `-d` or `--data` must still be given, and counts
+ as segment 0, its ECI given by `--eci`. Segments must be consecutive.
+
+`--separator=INTEGER`
+
+: Set the height of row separator bars for stacked symbologies, where *INTEGER* is in integral multiples of the
+ X-dimension.
+
+`--small`
+
+: Use small text for Human Readable Text.
+
+`--square`
+
+: For Data Matrix symbols, exclude rectangular sizes when considering automatic sizes.
+
+`--structapp=I,C[,ID]`
+
+: Set Structured Append info, where `I` is the 1-based index, `C` is the count of total symbols in the sequence, and
+ `ID`, which is optional, is the identifier that all symbols in the sequence share.
+
+`-t`, `--types`
+
+: Display the table of barcode types (symbologies).
+
+`--vers=INTEGER`
+
+: Set the symbol version (size, check digits, other options) to *INTEGER*. The meaning is symbol-specific.
+
+`-v`, `--version`
+
+: Display the zint version.
+
+`--vwhitesp=INTEGER`
+
+: Set the height of vertical whitespace either side of the barcode, where *INTEGER* is in integral multiples of the
+ X-dimension.
+
+`-w`, `--whitesp=INTEGER`
+
+: Set the width of horizontal whitespace above and below the barcode, where *INTEGER* is in integral multiples of
+ the X-dimension.
+
+`--werror`
+
+: Convert all warnings into errors.
+
+# EXAMPLES
+
+Create "out.png" (or "out.gif" if zint built without PNG support) in the current directory, as a Code 128 symbol.
+
+```bash
+zint -d 'This Text'
+```
+
+Create "qr.svg" in the current directory, as a QR Code symbol.
+
+```bash
+zint -b QRCode -d 'This Text' -o 'qr.svg'
+```
+
+# BUGS
+
+Please send bug reports to https://sourceforge.net/p/zint/tickets/
+
+# SEE ALSO
+
+Full documention for `zint` (and the API `libzint` and the GUI `zint-qt`) is available from
+http://zint.org.uk/Manual.aspx, and at https://sourceforge.net/p/zint/docs/manual.pmd.
+
+# STANDARDS
+
+Zint is designed to be compliant with a number of international standards, including:
+
+- EN 798:1996, EN 12323:2005, ISO/IEC 15420:2009, ISO/IEC 15417:2007,
+- ISO/IEC 15438:2015, ISO/IEC 16022:2006, ISO/IEC 16023:2000,
+- ISO/IEC 16388:2007, ISO/IEC 18004:2015, ISO/IEC 20830:2021,
+- ISO/IEC 24723:2010, ISO/IEC 24724:2011, ISO/IEC 24728:2006,
+- ISO/IEC 24778:2008, ISO/IEC 16390:2007, ISO/IEC 21471:2019,
+- ANSI-HIBC 2.6-2016, ANSI/AIM BC12-1998, ANSI/AIM BC6-2000,
+- ANSI/AIM BC5-1995, AIM ISS-X-24, AIMD014 (v 1.63), USPS-B-3200,
+- USS Code One (1994), GS1 22.0 (2022), AIM ITS/04-023 (2022)
diff --git a/docs/zint_images.sh b/docs/zint_images.sh
new file mode 100755
index 00000000..f44b8f05
--- /dev/null
+++ b/docs/zint_images.sh
@@ -0,0 +1,101 @@
+#!/bin/bash
+
+zint -b PDF417 -d "This Text" --height=4 --heightperrow --scale=0.6 -o images/pdf417_heightperrow.svg
+zint --border=10 --box -d "This Text" -w 10 --scale=0.6 -o images/code128_box.svg
+zint -b QRCODE --border=1 --box -d "This Text" --quietzones --scale=1 -o images/qrcode_box.svg
+zint -d "This Text" --fg=00FF00 --scale=0.6 -o images/code128_green.svg
+zint -d "This Text" --fg=00FF0055 --scale=0.6 -o images/code128_green_alpha.svg
+zint -d "This Text" --rotate=90 --scale=0.6 -o images/code128_rotate90.svg
+zint -b DATAMATRIX --eci=17 -d "€" --scale=1 -o images/datamatrix_euro.svg
+zint -b DATAMATRIX --eci=28 -d "\u5E38" --esc --scale=1 -o images/datamatrix_big5.svg
+zint -b QRCODE --binary -d "\xE2\x82\xAC\xE5\xB8\xB8" --esc --scale=1 -o images/qrcode_binary_utf8.svg
+zint -b CODEONE -d "123456789012345678" --dotty --vers=9 --scale=2 -o images/codeone_s_dotty.svg
+zint -b AZTEC --eci=9 -d "Κείμενο" --seg1=7,"Текст" --seg2=20,"文章" --scale=1 -o images/aztec_segs.svg
+zint -b DATAMATRIX -d "2nd of 3" --structapp="2,3,5006" --scale=1 -o images/datamatrix_structapp.svg
+zint --bold -d "This Text" --small --scale=0.6 -o images/code128_small_bold.svg
+zint -b CODE11 -d "9212320967" --scale=0.6 -o images/code11.svg
+zint -b C25STANDARD -d "9212320967" --scale=0.6 -o images/c25standard.svg
+zint -b C25IATA -d "9212320967" --scale=0.6 -o images/c25iata.svg
+zint -b C25IND -d "9212320967" --scale=0.6 -o images/c25ind.svg
+zint -b C25INTER --compliantheight -d "9212320967" --scale=0.6 -o images/c25inter.svg
+zint -b C25LOGIC -d "9212320967" --scale=0.6 -o images/c25logic.svg
+zint -b ITF14 --compliantheight -d "9212320967145" --scale=0.6 -o images/itf14.svg
+zint -b ITF14 --box --compliantheight -d "9212320967145" --scale=0.6 -o images/itf14_border0.svg
+zint -b DPLEIT -d "9212320967145" --scale=0.6 -o images/dpleit.svg
+zint -b DPIDENT -d "91232096712" --scale=0.6 -o images/dpident.svg
+zint -b UPCA --compliantheight -d "72527270270" --scale=0.5 -o images/upca.svg
+zint -b UPCA --compliantheight -d "72527270270+12345" --scale=0.5 -o images/upca_5.svg
+zint -b UPCE --compliantheight -d "1123456" --scale=0.5 -o images/upce.svg
+zint -b EANX --compliantheight -d "4512345678906" --scale=0.5 -o images/eanx13.svg
+zint -b EANX --compliantheight -d "54321" --scale=0.5 -o images/eanx5.svg
+zint -b EANX --compliantheight -d "7432365+54321" --scale=0.5 -o images/eanx8_5.svg
+zint -b ISBNX --compliantheight -d "9789295055124" --scale=0.5 -o images/isbnx.svg
+zint -b PLESSEY -d "C64" --scale=0.6 -o images/plessey.svg
+zint -b MSI_PLESSEY -d "6502" --vers=2 --scale=0.6 -o images/msi_plessey.svg
+zint -b TELEPEN --compliantheight -d "Z80" --scale=0.6 -o images/telepen.svg
+zint -b TELEPEN_NUM --compliantheight -d "466X33" --scale=0.6 -o images/telepen_num.svg
+zint -b CODE39 --compliantheight -d "1A" --vers=1 --scale=0.6 -o images/code39.svg
+zint -b EXCODE39 --compliantheight -d "123.45$@fd" --scale=0.6 -o images/excode39.svg
+zint -b CODE93 --compliantheight -d "C93" --scale=0.6 -o images/code93.svg
+zint -b PZN --compliantheight -d "2758089" --scale=0.6 -o images/pzn.svg
+zint -b LOGMARS --compliantheight -d "12345/ABCDE" --vers=1 --scale=0.6 -o images/logmars.svg
+zint -b CODE32 --compliantheight -d "14352312" --scale=0.6 -o images/code32.svg
+zint -b HIBC_39 --compliantheight -d "14352312" --scale=0.6 -o images/hibc_39.svg
+zint -b VIN -d "2FTPX28L0XCA15511" --vers=1 --scale=0.6 -o images/vin.svg
+zint -b CODABAR --compliantheight -d "A37859B" --scale=0.6 -o images/codabar.svg
+zint -b PHARMA --compliantheight -d "130170" --scale=0.6 -o images/pharma.svg
+zint -b CODE128 --bind -d "130170X178" --scale=0.6 -o images/code128.svg
+zint -b CODE128B -d "130170X178" --scale=0.6 -o images/code128b.svg
+zint -b GS1_128 --compliantheight -d "[01]98898765432106[3202]012345[15]991231" --scale=0.6 -o images/gs1_128.svg
+zint -b EAN14 --compliantheight -d "9889876543210" --scale=0.6 -o images/ean14.svg
+zint -b NVE18 --compliantheight -d "37612345000001003" --scale=0.6 -o images/nve18.svg
+zint -b HIBC_128 -d "A123BJC5D6E71" --scale=0.6 -o images/hibc_128.svg
+zint -b DPD --compliantheight -d "%000393206219912345678101040" --scale=0.6 -o images/dpd.svg
+zint -b DBAR_OMN --compliantheight -d "0950110153001" --scale=0.6 -o images/dbar_omn.svg
+zint -b DBAR_OMN -d "0950110153001" --height=13 --scale=0.6 -o images/dbar_truncated.svg
+zint -b DBAR_LTD --compliantheight -d "0950110153001" --scale=0.6 -o images/dbar_ltd.svg
+zint -b DBAR_EXP --compliantheight -d "[01]98898765432106[3202]012345[15]991231" --scale=0.6 -o images/dbar_exp.svg
+zint -b KOREAPOST -d "923457" --scale=0.6 -o images/koreapost.svg
+zint -b CHANNEL -d "453678" --compliantheight --scale=0.6 -o images/channel.svg
+zint -d "This" -d "That" --scale=0.6 -o images/code128stacked.svg
+zint --notext --bind --separator=2 -d "This" -d "That" --scale=0.6 -o images/code128stacked_sep2.svg
+zint -b CODABLOCKF -d "CODABLOCK F Symbology" --rows=3 --scale=0.6 -o images/codablockf.svg
+zint -b CODE16K --compliantheight -d "ab0123456789" --scale=0.6 -o images/code16k.svg
+zint -b PDF417 -d "PDF417" --scale=0.6 -o images/pdf417.svg
+zint -b PDF417COMP -d "PDF417" --scale=0.6 -o images/pdf417comp.svg
+zint -b MICROPDF417 -d "12345678" --scale=0.6 -o images/micropdf417.svg
+zint -b DBAR_STK --compliantheight -d "9889876543210" --scale=0.6 -o images/dbar_stk.svg
+zint -b DBAR_OMNSTK --compliantheight -d "9889876543210" --scale=0.6 -o images/dbar_omnstk.svg
+zint -b DBAR_EXPSTK --compliantheight -d "[01]98898765432106[3202]012345[15]991231" --scale=0.6 -o images/dbar_expstk.svg
+zint -b CODE49 --compliantheight -d "MULTIPLE ROWS IN CODE 49" --scale=0.6 -o images/code49.svg
+zint -b EANX_CC --compliantheight -d "[99]1234-abcd" --mode=1 --primary=331234567890 --scale=0.5 -o images/eanx_cc_a.svg
+zint -b EANX_CC --compliantheight -d "[99]1234-abcd" --mode=2 --primary=331234567890 --scale=0.5 -o images/eanx_cc_b.svg
+zint -b GS1_128_CC --compliantheight -d "[99]1234-abcd" --mode=3 --primary="[01]03312345678903" --scale=0.5 -o images/gs1_128_cc_c.svg
+zint -b PHARMA_TWO --compliantheight -d "29876543" --scale=1 -o images/pharma_two.svg
+zint -b POSTNET --compliantheight -d "12345678901" --scale=1 -o images/postnet.svg
+zint -b PLANET --compliantheight -d "4012345235636" --scale=1 -o images/planet.svg
+zint -b AUSPOST --compliantheight -d "96184209" --scale=1 -o images/auspost.svg
+zint -b AUSROUTE --compliantheight -d "34567890" --scale=1 -o images/ausroute.svg
+zint -b AUSREPLY --compliantheight -d "12345678" --scale=1 -o images/ausreply.svg
+zint -b AUSREDIRECT --compliantheight -d "98765432" --scale=1 -o images/ausredirect.svg
+zint -b KIX --compliantheight -d "2500GG30250" --scale=1 -o images/kix.svg
+zint -b RM4SCC --compliantheight -d "W1J0TR01" --scale=1 -o images/rm4scc.svg
+zint -b MAILMARK --compliantheight -d "1100000000000XY11" --scale=1 -o images/mailmark.svg
+zint -b USPS_IMAIL --compliantheight -d "01234567094987654321-01234" --scale=1 -o images/usps_imail.svg
+zint -b JAPANPOST --compliantheight -d "15400233-16-4-205" --scale=1 -o images/japanpost.svg
+zint -b HIBC_DM -d "/ACMRN123456/V200912190833" --fast --square --scale=1.2 -o images/hibc_dm.svg
+zint -b QRCODE -d "QR Code Symbol" --mask=5 --scale=1.2 -o images/qrcode.svg
+zint -b MICROQR -d "01234567" --scale=1.2 -o images/microqr.svg
+zint -b RMQR -d "0123456" --scale=1.2 -o images/rmqr.svg
+zint -b UPNQR -d "UPNQR\n\n\n\n\nJanez Novak\nDunajska 1\n1000 Ljubljana\n00000008105\n\n\nRENT\nPlačilo najemnine 10/2016\n15.11.2016\nSI56051008010486080\nRF45SBO2010\nNovo podjetje d.o.o.\nLepa cesta 15\n3698 Loški Potok\n188\n " --esc --scale=1 -o images/upnqr.svg
+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 --scale=1 -o images/maxicode.svg
+zint -b AZTEC -d "123456789012" --scale=1 -o images/aztec.svg
+zint -b AZRUNE -d "125" --scale=1 -o images/azrune.svg
+zint -b CODEONE -d "1234567890123456789012" --scale=1 -o images/codeone.svg
+zint -b GRIDMATRIX --eci=29 -d "AAT2556 电池充电器+降压转换器 200mA至2A tel:86 019 82512738" --scale=1 -o images/gridmatrix.svg
+zint -b DOTCODE -d "[01]00012345678905[17]201231[10]ABC123456" --gs1 --scale=1 -o images/dotcode.svg
+zint -b HANXIN -d "Hanxin Code symbol" --scale=1 -o images/hanxin.svg
+zint -b ULTRA -d "HEIMASÍÐA KENNARAHÁSKÓLA ÍSLANDS" --scale=2 -o images/ultra.svg
+zint -b FIM --compliantheight -d "C" --scale=1 -o images/fim.svg
+zint -b FLAT -d "1304056" --scale=0.6 -o images/flat.svg
+zint -b DAFT -d "AAFDTTDAFADTFTTFFFDATFTADTTFFTDAFAFDTF" --height=8.494 --vers=256 --scale=1 -o images/daft_rm4scc.svg
diff --git a/frontend/CMakeLists.txt b/frontend/CMakeLists.txt
index cdf5e257..0e6787a2 100644
--- a/frontend/CMakeLists.txt
+++ b/frontend/CMakeLists.txt
@@ -22,6 +22,9 @@ if(NOT HAVE_GETOPT)
endif()
install(TARGETS ${PROJECT_NAME} DESTINATION "${BIN_INSTALL_DIR}" RUNTIME)
+if(UNIX)
+ install(FILES "${CMAKE_SOURCE_DIR}/docs/zint.1.gz" DESTINATION "${MAN_INSTALL_DIR}/man1" COMPONENT doc)
+endif()
if(ZINT_TEST)
add_subdirectory(tests)
diff --git a/frontend/main.c b/frontend/main.c
index 60607fcd..5a10e445 100644
--- a/frontend/main.c
+++ b/frontend/main.c
@@ -97,7 +97,8 @@ static void types(void) {
}
/* Output version information */
-static void version(void) {
+static void version(int no_png) {
+ const char *no_png_lib = no_png ? " (no libpng)" : "";
const int zint_version = ZBarcode_Version();
const int version_major = zint_version / 10000;
const int version_minor = (zint_version % 10000) / 100;
@@ -108,18 +109,21 @@ static void version(void) {
/* This is a test release */
version_release = version_release / 10;
version_build = zint_version % 10;
- printf("Zint version %d.%d.%d.%d (dev)\n", version_major, version_minor, version_release, version_build);
+ printf("Zint version %d.%d.%d.%d (dev)%s\n", version_major, version_minor, version_release, version_build, no_png_lib);
} else {
/* This is a stable release */
- printf("Zint version %d.%d.%d\n", version_major, version_minor, version_release);
+ printf("Zint version %d.%d.%d%s\n", version_major, version_minor, version_release, no_png_lib);
}
}
/* Output usage information */
-static void usage(void) {
- version();
+static void usage(int no_png) {
+ const char *no_png_type = no_png ? "" : "/PNG";
+ const char *no_png_ext = no_png ? "gif" : "png";
- printf( "Encode input data in a barcode and save as BMP/EMF/EPS/GIF/PCX/PNG/SVG/TIF/TXT\n\n"
+ version(no_png);
+
+ printf( "Encode input data in a barcode and save as BMP/EMF/EPS/GIF/PCX%s/SVG/TIF/TXT\n\n"
" -b, --barcode=TYPE Number or name of barcode type. Default is 20 (CODE128)\n"
" --addongap=NUMBER Set add-on gap in multiples of X-dimension for UPC/EAN\n"
" --batch Treat each line of input file as a separate data set\n"
@@ -143,7 +147,7 @@ static void usage(void) {
" --esc Process escape characters in input data\n"
" --fast Use faster encodation (Data Matrix)\n"
" --fg=COLOUR Specify a foreground colour (in hex RGB/RGBA)\n"
- " --filetype=TYPE Set output file type BMP/EMF/EPS/GIF/PCX/PNG/SVG/TIF/TXT\n"
+ " --filetype=TYPE Set output file type BMP/EMF/EPS/GIF/PCX%s/SVG/TIF/TXT\n"
" --fullmultibyte Use multibyte for binary/Latin (QR/Han Xin/Grid Matrix)\n"
" --gs1 Treat input as GS1 compatible data\n"
" --gs1nocheck Do not check validity of GS1 data\n"
@@ -158,10 +162,10 @@ static void usage(void) {
" --mask=NUMBER Set masking pattern to use (QR/Han Xin/DotCode)\n"
" --mirror Use batch data to determine filename\n"
" --mode=NUMBER Set encoding mode (MaxiCode/Composite)\n"
- " --nobackground Remove background (EMF/EPS/GIF/PNG/SVG/TIF only)\n"
+ " --nobackground Remove background (EMF/EPS/GIF%s/SVG/TIF only)\n"
" --noquietzones Disable default quiet zones\n"
" --notext Remove human readable text\n"
- " -o, --output=FILE Send output to FILE. Default is out.png\n"
+ " -o, --output=FILE Send output to FILE. Default is out.%s\n"
" --primary=STRING Set primary message (MaxiCode/Composite)\n"
" --quietzones Add compliant quiet zones\n"
" -r, --reverse Reverse colours (white on black)\n"
@@ -170,17 +174,18 @@ static void usage(void) {
" --scale=NUMBER Adjust size of X-dimension\n"
" --scmvv=NUMBER Prefix SCM with \"[)>\\R01\\Gvv\" (vv is NUMBER) (MaxiCode)\n"
" --secure=NUMBER Set error correction level (ECC)\n"
- " --segN=ECI,DATA Set the ECI & data content for segment N where N is 1 to 9\n"
+ " --segN=ECI,DATA Set the ECI & data content for segment N, where N 1 to 9\n"
" --separator=NUMBER Set height of row separator bars (stacked symbologies)\n"
" --small Use small text\n"
" --square Force Data Matrix symbols to be square\n"
" --structapp=I,C[,ID] Set Structured Append info (I index, C count)\n"
" -t, --types Display table of barcode types\n"
" --vers=NUMBER Set symbol version (size, check digits, other options)\n"
- " --version Display Zint version\n"
+ " -v, --version Display Zint version\n"
" --vwhitesp=NUMBER Set height of vertical whitespace in multiples of X-dim\n"
" -w, --whitesp=NUMBER Set width of horizontal whitespace in multiples of X-dim\n"
- " --werror Convert all warnings into errors\n"
+ " --werror Convert all warnings into errors\n",
+ no_png_type, no_png_type, no_png_type, no_png_ext
);
}
@@ -207,8 +212,8 @@ static void show_eci(void) {
" 23: Windows 1252 - Latin 1\n"
" 24: Windows 1256 - Arabic\n"
" 25: UTF-16BE (High order byte first)\n"
- " 26: UTF-8 (Unicode)\n"
- " 27: ISO/IEC 646:1991 7-bit ASCII\n"
+ " 26: UTF-8\n"
+ " 27: ASCII (ISO/IEC 646 IRV)\n"
" 28: Big5 (Taiwan) Chinese Character Set\n"
" 29: GB 2312 (PRC) Chinese Character Set\n"
" 30: Korean Character Set EUC-KR (KS X 1001:2002)\n"
@@ -217,7 +222,7 @@ static void show_eci(void) {
" 33: UTF-16LE (Low order byte first)\n"
" 34: UTF-32BE (High order bytes first)\n"
" 35: UTF-32LE (Low order bytes first)\n"
- "170: ISO/IEC 646:1991 7-bit Invariant\n"
+ "170: ISO/IEC 646 Invariant (ASCII subset)\n"
"899: 8-bit binary data\n"
);
}
@@ -280,6 +285,7 @@ static int get_barcode_name(const char *barcode_name) {
{ BARCODE_C25IND, "c25ind" },
{ BARCODE_C25INTER, "c25inter" },
{ BARCODE_C25LOGIC, "c25logic" },
+ { BARCODE_C25STANDARD, "c25matrix" },
{ BARCODE_C25STANDARD, "c25standard" },
{ BARCODE_CHANNEL, "channel" },
{ BARCODE_CODABAR, "codabar" },
@@ -312,6 +318,8 @@ static int get_barcode_name(const char *barcode_name) {
{ BARCODE_DPIDENT, "dpident" },
{ BARCODE_DPLEIT, "dpleit" },
{ BARCODE_EANX, "ean" }, /* Synonym */
+ { BARCODE_GS1_128, "ean128" }, /* Synonym */
+ { BARCODE_GS1_128_CC, "ean128cc" }, /* Synonym */
{ BARCODE_EAN14, "ean14" },
{ BARCODE_EANX_CC, "eancc" }, /* Synonym */
{ BARCODE_EANX_CHK, "eanchk" }, /* Synonym */
@@ -354,8 +362,10 @@ static int get_barcode_name(const char *barcode_name) {
{ BARCODE_MSI_PLESSEY, "msi" }, /* Synonym */
{ BARCODE_MSI_PLESSEY, "msiplessey" },
{ BARCODE_NVE18, "nve18" },
+ { BARCODE_USPS_IMAIL, "onecode" }, /* Synonym */
{ BARCODE_PDF417, "pdf417" },
{ BARCODE_PDF417COMP, "pdf417comp" },
+ { BARCODE_PDF417COMP, "pdf417trunc" }, /* Synonym */
{ BARCODE_PHARMA, "pharma" },
{ BARCODE_PHARMA_TWO, "pharmatwo" },
{ BARCODE_PLANET, "planet" },
@@ -366,6 +376,18 @@ static int get_barcode_name(const char *barcode_name) {
{ BARCODE_QRCODE, "qrcode" },
{ BARCODE_RM4SCC, "rm4scc" },
{ BARCODE_RMQR, "rmqr" },
+ { BARCODE_DBAR_OMN, "rss14" }, /* Synonym */
+ { BARCODE_DBAR_OMN_CC, "rss14cc" }, /* Synonym */
+ { BARCODE_DBAR_OMNSTK_CC, "rss14omnicc" }, /* Synonym */
+ { BARCODE_DBAR_STK, "rss14stack" }, /* Synonym */
+ { BARCODE_DBAR_STK_CC, "rss14stackcc" }, /* Synonym */
+ { BARCODE_DBAR_OMNSTK, "rss14stackomni" }, /* Synonym */
+ { BARCODE_DBAR_EXP, "rssexp" }, /* Synonym */
+ { BARCODE_DBAR_EXP_CC, "rssexpcc" }, /* Synonym */
+ { BARCODE_DBAR_EXPSTK, "rssexpstack" }, /* Synonym */
+ { BARCODE_DBAR_EXPSTK_CC, "rssexpstackcc" }, /* Synonym */
+ { BARCODE_DBAR_LTD, "rssltd" }, /* Synonym */
+ { BARCODE_DBAR_LTD_CC, "rssltdcc" }, /* Synonym */
{ BARCODE_TELEPEN, "telepen" },
{ BARCODE_TELEPEN_NUM, "telepennum" },
{ BARCODE_ULTRA, "ultra" },
@@ -878,17 +900,18 @@ int main(int argc, char **argv) {
#endif
int no_getopt_error = 1;
- if (argc == 1) {
- usage();
- exit(1);
- }
-
my_symbol = ZBarcode_Create();
if (!my_symbol) {
fprintf(stderr, "Error 151: Memory failure\n");
exit(1);
}
no_png = strcmp(my_symbol->outfile, "out.gif") == 0;
+
+ if (argc == 1) {
+ ZBarcode_Delete(my_symbol);
+ usage(no_png);
+ exit(1);
+ }
my_symbol->input_mode = UNICODE_MODE;
#ifdef _WIN32
@@ -906,7 +929,7 @@ int main(int argc, char **argv) {
OPT_ROTATE, OPT_ROWS, OPT_SCALE, OPT_SCMVV, OPT_SECURE,
OPT_SEG1, OPT_SEG2, OPT_SEG3, OPT_SEG4, OPT_SEG5, OPT_SEG6, OPT_SEG7, OPT_SEG8, OPT_SEG9,
OPT_SEPARATOR, OPT_SMALL, OPT_SQUARE, OPT_STRUCTAPP,
- OPT_VERBOSE, OPT_VERS, OPT_VERSION, OPT_VWHITESP, OPT_WERROR,
+ OPT_VERBOSE, OPT_VERS, OPT_VWHITESP, OPT_WERROR,
};
int option_index = 0;
static const struct option long_options[] = {
@@ -977,13 +1000,13 @@ int main(int argc, char **argv) {
{"types", 0, NULL, 't'},
{"verbose", 0, NULL, OPT_VERBOSE}, // Currently undocumented, output some debug info
{"vers", 1, NULL, OPT_VERS},
- {"version", 0, NULL, OPT_VERSION},
+ {"version", 0, NULL, 'v'},
{"vwhitesp", 1, NULL, OPT_VWHITESP},
{"werror", 0, NULL, OPT_WERROR},
{"whitesp", 1, NULL, 'w'},
{NULL, 0, NULL, 0}
};
- const int c = getopt_long_only(argc, argv, "b:d:ehi:o:rtw:", long_options, &option_index);
+ const int c = getopt_long_only(argc, argv, "b:d:ehi:o:rtvw:", long_options, &option_index);
if (c == -1) break;
switch (c) {
@@ -1366,12 +1389,12 @@ int main(int argc, char **argv) {
break;
case 'h':
- usage();
+ usage(no_png);
help = 1;
break;
- case OPT_VERSION:
- version();
+ case 'v':
+ version(no_png);
help = 1;
break;
@@ -1551,6 +1574,12 @@ int main(int argc, char **argv) {
if (seg_count) {
ret = ZBarcode_Encode_Segs(my_symbol, segs, seg_count);
} else {
+ if (i == 1 && (ZBarcode_Cap(symbology, ZINT_CAP_STACKABLE) & ZINT_CAP_STACKABLE) == 0) {
+ fprintf(stderr, "Error 173: Symbology must be stackable if multiple data arguments given\n");
+ fflush(stderr);
+ error_number = ZINT_ERROR_INVALID_DATA;
+ break;
+ }
ret = ZBarcode_Encode(my_symbol, (unsigned char *) arg_opts[i].arg,
(int) strlen(arg_opts[i].arg));
}
diff --git a/frontend/test.sh b/frontend/test.sh
index 23e53de5..12d26b89 100755
--- a/frontend/test.sh
+++ b/frontend/test.sh
@@ -1,5 +1,5 @@
-mkdir test_out
-cd test_out
+mkdir test_sh_out
+cd test_sh_out
echo testing Code 11
zint -o bar01.txt -b 1 -d 87654321
zint -o bar01.gif -b 1 --height=50 --border=10 -d 87654321
diff --git a/frontend/tests/test_args.c b/frontend/tests/test_args.c
index 077d4295..5020c31f 100644
--- a/frontend/tests/test_args.c
+++ b/frontend/tests/test_args.c
@@ -837,7 +837,7 @@ static void test_barcode_symbology(int index, int debug) {
/* 4*/ { "code12", "1", NULL, 1, "Error 119: Invalid barcode type 'code12'" },
/* 5*/ { "BARCODE_CODE11", "1", NULL, 0, "symbology: 1," },
/* 6*/ { "C25 Standard", "1", NULL, 0, "symbology: 2," },
- /* 7*/ { "c25matrix", "1", NULL, 1, "Error 119: Invalid barcode type 'c25matrix'" }, // Legacy not supported
+ /* 7*/ { "c25matrix", "1", NULL, 0, "symbology: 2," }, // Legacy now supported
/* 8*/ { "C25INTER", "1", NULL, 0, "symbology: 3," },
/* 9*/ { "c25IATA", "1", NULL, 0, "symbology: 4," },
/* 10*/ { "c25 Logic", "1", NULL, 0, "symbology: 6," },
@@ -850,107 +850,124 @@ static void test_barcode_symbology(int index, int debug) {
/* 17*/ { "eanxchk", "1", NULL, 0, "symbology: 14," },
/* 18*/ { "eanchk", "1", NULL, 0, "symbology: 14," },
/* 19*/ { "GS1128", "[01]12345678901231", NULL, 0, "symbology: 16," },
- /* 20*/ { "coda bar", "A1B", NULL, 0, "symbology: 18," },
- /* 21*/ { "DPLEIT", "1", NULL, 0, "symbology: 21," },
- /* 22*/ { "DPIDENT", "1", NULL, 0, "symbology: 22," },
- /* 23*/ { "code16k", "1", NULL, 0, "symbology: 23," },
- /* 24*/ { "CODE49", "1", NULL, 0, "symbology: 24," },
- /* 25*/ { "CODE93", "1", NULL, 0, "symbology: 25," },
- /* 26*/ { "flat", "1", NULL, 0, "symbology: 28," },
- /* 27*/ { "dbar omn", "1", NULL, 0, "symbology: 29," },
- /* 28*/ { "dbar ltd", "1", NULL, 0, "symbology: 30," },
- /* 29*/ { "dbarexp", "[10]12", NULL, 0, "symbology: 31," },
- /* 30*/ { "telepen", "1", NULL, 0, "symbology: 32," },
- /* 31*/ { "upc", "1", NULL, 1, "Error 119: Invalid barcode type 'upc'" },
- /* 32*/ { "upca", "1", NULL, 0, "symbology: 34," },
- /* 33*/ { "upca_chk", "123456789012", NULL, 0, "symbology: 35," },
- /* 34*/ { "upce", "1", NULL, 0, "symbology: 37," },
- /* 35*/ { "upce chk", "12345670", NULL, 0, "symbology: 38," },
- /* 36*/ { "POSTNET ", "12345678901", NULL, 0, "symbology: 40," },
- /* 37*/ { "msi", "1", NULL, 0, "symbology: 47," },
- /* 38*/ { "MSI Plessey ", "1", NULL, 0, "symbology: 47," },
- /* 39*/ { "fim ", "A", NULL, 0, "symbology: 49," },
- /* 40*/ { "LOGMARS", "123456", NULL, 0, "symbology: 50," },
- /* 41*/ { " pharma", "123456", NULL, 0, "symbology: 51," },
- /* 42*/ { " pzn ", "1", NULL, 0, "symbology: 52," },
- /* 43*/ { "pharma two", "4", NULL, 0, "symbology: 53," },
- /* 44*/ { "BARCODE_PDF417", "1", NULL, 0, "symbology: 55," },
- /* 45*/ { "barcodepdf417comp", "1", NULL, 0, "symbology: 56," },
- /* 46*/ { "MaxiCode", "1", NULL, 0, "symbology: 57," },
- /* 47*/ { "QR CODE", "1", NULL, 0, "symbology: 58," },
- /* 48*/ { "qr", "1", NULL, 0, "symbology: 58," }, // Synonym
- /* 49*/ { "Code 128 B", "1", NULL, 0, "symbology: 60," },
- /* 50*/ { "AUS POST", "12345678901234567890123", NULL, 0, "symbology: 63," },
- /* 51*/ { "AusReply", "12345678", NULL, 0, "symbology: 66," },
- /* 52*/ { "AUSROUTE", "12345678", NULL, 0, "symbology: 67," },
- /* 53*/ { "AUS REDIRECT", "12345678", NULL, 0, "symbology: 68," },
- /* 54*/ { "isbnx", "123456789", NULL, 0, "symbology: 69," },
- /* 55*/ { "rm4scc", "1", NULL, 0, "symbology: 70," },
- /* 56*/ { "DataMatrix", "1", NULL, 0, "symbology: 71," },
- /* 57*/ { "EAN14", "1", NULL, 0, "symbology: 72," },
- /* 58*/ { "vin", "12345678701234567", NULL, 0, "symbology: 73," },
- /* 59*/ { "CodaBlock-F", "1", NULL, 0, "symbology: 74," },
- /* 60*/ { "NVE18", "1", NULL, 0, "symbology: 75," },
- /* 61*/ { "Japan Post", "1", NULL, 0, "symbology: 76," },
- /* 62*/ { "Korea Post", "1", NULL, 0, "symbology: 77," },
- /* 63*/ { "DBar Stk", "1", NULL, 0, "symbology: 79," },
- /* 64*/ { "DBar Omn Stk", "1", NULL, 0, "symbology: 80," },
- /* 65*/ { "DBar Exp Stk", "[20]01", NULL, 0, "symbology: 81," },
- /* 66*/ { "planet", "12345678901", NULL, 0, "symbology: 82," },
- /* 67*/ { "MicroPDF417", "1", NULL, 0, "symbology: 84," },
- /* 68*/ { "USPS IMail", "12345678901234567890", NULL, 0, "symbology: 85," },
- /* 69*/ { "plessey", "1", NULL, 0, "symbology: 86," },
- /* 70*/ { "telepen num", "1", NULL, 0, "symbology: 87," },
- /* 71*/ { "ITF14", "1", NULL, 0, "symbology: 89," },
- /* 72*/ { "KIX", "1", NULL, 0, "symbology: 90," },
- /* 73*/ { "Aztec", "1", NULL, 0, "symbology: 92," },
- /* 74*/ { "daft", "D", NULL, 0, "symbology: 93," },
- /* 75*/ { "DPD", "0123456789012345678901234567", NULL, 0, "symbology: 96," },
- /* 76*/ { "Micro QR", "1", NULL, 0, "symbology: 97," },
- /* 77*/ { "hibc128", "1", NULL, 0, "symbology: 98," },
- /* 78*/ { "hibccode128", "1", NULL, 0, "symbology: 98," }, // Synonym
- /* 79*/ { "hibc39", "1", NULL, 0, "symbology: 99," },
- /* 80*/ { "hibccode39", "1", NULL, 0, "symbology: 99," }, // Synonym
- /* 81*/ { "hibcdatamatrix", "1", NULL, 0, "symbology: 102," }, // Synonym
- /* 82*/ { "hibcdm", "1", NULL, 0, "symbology: 102," },
- /* 83*/ { "HIBC qr", "1", NULL, 0, "symbology: 104," },
- /* 84*/ { "HIBC QR Code", "1", NULL, 0, "symbology: 104," }, // Synonym
- /* 85*/ { "HIBCPDF", "1", NULL, 0, "symbology: 106," },
- /* 86*/ { "HIBCPDF417", "1", NULL, 0, "symbology: 106," }, // Synonym
- /* 87*/ { "HIBCMICPDF", "1", NULL, 0, "symbology: 108," },
- /* 88*/ { "HIBC Micro PDF", "1", NULL, 0, "symbology: 108," }, // Synonym
- /* 89*/ { "HIBC Micro PDF417", "1", NULL, 0, "symbology: 108," }, // Synonym
- /* 90*/ { "HIBC BlockF", "1", NULL, 0, "symbology: 110," },
- /* 91*/ { "HIBC CodaBlock-F", "1", NULL, 0, "symbology: 110," }, // Synonym
- /* 92*/ { "HIBC Aztec", "1", NULL, 0, "symbology: 112," },
- /* 93*/ { "DotCode", "1", NULL, 0, "symbology: 115," },
- /* 94*/ { "Han Xin", "1", NULL, 0, "symbology: 116," },
- /* 95*/ { "Mailmark", "01000000000000000AA00AA0A", NULL, 0, "symbology: 121," },
- /* 96*/ { "azrune", "1", NULL, 0, "symbology: 128," },
- /* 97*/ { "aztecrune", "1", NULL, 0, "symbology: 128," }, // Synonym
- /* 98*/ { "aztecrunes", "1", NULL, 0, "symbology: 128," }, // Synonym
- /* 99*/ { "code32", "1", NULL, 0, "symbology: 129," },
- /*100*/ { "eanx cc", "[20]01", "1234567890128", 0, "symbology: 130," },
- /*101*/ { "eancc", "[20]01", "1234567890128", 0, "symbology: 130," },
- /*102*/ { "GS1 128 CC", "[01]12345678901231", "[20]01", 0, "symbology: 131," },
- /*103*/ { "dbaromncc", "[20]01", "1234567890123", 0, "symbology: 132," },
- /*104*/ { "dbarltdcc", "[20]01", "1234567890123", 0, "symbology: 133," },
- /*105*/ { "dbarexpcc", "[20]01", "[01]12345678901231", 0, "symbology: 134," },
- /*106*/ { "upcacc", "[20]01", "12345678901", 0, "symbology: 135," },
- /*107*/ { "upcecc", "[20]01", "1234567", 0, "symbology: 136," },
- /*108*/ { "dbar stk cc", "[20]01", "1234567890123", 0, "symbology: 137," },
- /*109*/ { "dbaromnstkcc", "[20]01", "1234567890123", 0, "symbology: 138," },
- /*110*/ { "dbarexpstkcc", "[20]01", "[01]12345678901231", 0, "symbology: 139," },
- /*111*/ { "Channel", "1", NULL, 0, "symbology: 140," },
- /*112*/ { "CodeOne", "1", NULL, 0, "symbology: 141," },
- /*113*/ { "Grid Matrix", "1", NULL, 0, "symbology: 142," },
- /*114*/ { "UPN QR", "1", NULL, 0, "symbology: 143," },
- /*115*/ { "UPN QR Code", "1", NULL, 0, "symbology: 143," }, // Synonym
- /*116*/ { "ultra", "1", NULL, 0, "symbology: 144," },
- /*117*/ { "ultracode", "1", NULL, 0, "symbology: 144," }, // Synonym
- /*118*/ { "rMQR", "1", NULL, 0, "symbology: 145," },
- /*119*/ { "x", "1", NULL, 1, "Error 119: Invalid barcode type 'x'" },
- /*120*/ { "\177", "1", NULL, 1, "Error 119: Invalid barcode type '\177'" },
+ /* 20*/ { "ean 128", "[01]12345678901231", NULL, 0, "symbology: 16," },
+ /* 21*/ { "coda bar", "A1B", NULL, 0, "symbology: 18," },
+ /* 22*/ { "DPLEIT", "1", NULL, 0, "symbology: 21," },
+ /* 23*/ { "DPIDENT", "1", NULL, 0, "symbology: 22," },
+ /* 24*/ { "code16k", "1", NULL, 0, "symbology: 23," },
+ /* 25*/ { "CODE49", "1", NULL, 0, "symbology: 24," },
+ /* 26*/ { "CODE93", "1", NULL, 0, "symbology: 25," },
+ /* 27*/ { "flat", "1", NULL, 0, "symbology: 28," },
+ /* 28*/ { "dbar omn", "1", NULL, 0, "symbology: 29," },
+ /* 29*/ { "rss14", "1", NULL, 0, "symbology: 29," },
+ /* 30*/ { "dbar ltd", "1", NULL, 0, "symbology: 30," },
+ /* 31*/ { "rss ltd", "1", NULL, 0, "symbology: 30," },
+ /* 32*/ { "dbarexp", "[10]12", NULL, 0, "symbology: 31," },
+ /* 33*/ { "rss exp", "[10]12", NULL, 0, "symbology: 31," },
+ /* 34*/ { "telepen", "1", NULL, 0, "symbology: 32," },
+ /* 35*/ { "upc", "1", NULL, 1, "Error 119: Invalid barcode type 'upc'" },
+ /* 36*/ { "upca", "1", NULL, 0, "symbology: 34," },
+ /* 37*/ { "upca_chk", "123456789012", NULL, 0, "symbology: 35," },
+ /* 38*/ { "upce", "1", NULL, 0, "symbology: 37," },
+ /* 39*/ { "upce chk", "12345670", NULL, 0, "symbology: 38," },
+ /* 40*/ { "POSTNET ", "12345678901", NULL, 0, "symbology: 40," },
+ /* 41*/ { "msi", "1", NULL, 0, "symbology: 47," },
+ /* 42*/ { "MSI Plessey ", "1", NULL, 0, "symbology: 47," },
+ /* 43*/ { "fim ", "A", NULL, 0, "symbology: 49," },
+ /* 44*/ { "LOGMARS", "123456", NULL, 0, "symbology: 50," },
+ /* 45*/ { " pharma", "123456", NULL, 0, "symbology: 51," },
+ /* 46*/ { " pzn ", "1", NULL, 0, "symbology: 52," },
+ /* 47*/ { "pharma two", "4", NULL, 0, "symbology: 53," },
+ /* 48*/ { "BARCODE_PDF417", "1", NULL, 0, "symbology: 55," },
+ /* 49*/ { "pdf", "1", NULL, 1, "Error 119: Invalid barcode type 'pdf'" },
+ /* 50*/ { "barcodepdf417comp", "1", NULL, 0, "symbology: 56," },
+ /* 51*/ { "pdf417trunc", "1", NULL, 0, "symbology: 56," },
+ /* 52*/ { "MaxiCode", "1", NULL, 0, "symbology: 57," },
+ /* 53*/ { "QR CODE", "1", NULL, 0, "symbology: 58," },
+ /* 54*/ { "qr", "1", NULL, 0, "symbology: 58," }, // Synonym
+ /* 55*/ { "Code 128 B", "1", NULL, 0, "symbology: 60," },
+ /* 56*/ { "AUS POST", "12345678901234567890123", NULL, 0, "symbology: 63," },
+ /* 57*/ { "AusReply", "12345678", NULL, 0, "symbology: 66," },
+ /* 58*/ { "AUSROUTE", "12345678", NULL, 0, "symbology: 67," },
+ /* 59*/ { "AUS REDIRECT", "12345678", NULL, 0, "symbology: 68," },
+ /* 60*/ { "isbnx", "123456789", NULL, 0, "symbology: 69," },
+ /* 61*/ { "rm4scc", "1", NULL, 0, "symbology: 70," },
+ /* 62*/ { "DataMatrix", "1", NULL, 0, "symbology: 71," },
+ /* 63*/ { "EAN14", "1", NULL, 0, "symbology: 72," },
+ /* 64*/ { "vin", "12345678701234567", NULL, 0, "symbology: 73," },
+ /* 65*/ { "CodaBlock-F", "1", NULL, 0, "symbology: 74," },
+ /* 66*/ { "NVE18", "1", NULL, 0, "symbology: 75," },
+ /* 67*/ { "Japan Post", "1", NULL, 0, "symbology: 76," },
+ /* 68*/ { "Korea Post", "1", NULL, 0, "symbology: 77," },
+ /* 69*/ { "DBar Stk", "1", NULL, 0, "symbology: 79," },
+ /* 70*/ { "rss14stack", "1", NULL, 0, "symbology: 79," },
+ /* 71*/ { "DBar Omn Stk", "1", NULL, 0, "symbology: 80," },
+ /* 72*/ { "RSS14STACK OMNI", "1", NULL, 0, "symbology: 80," },
+ /* 73*/ { "DBar Exp Stk", "[20]01", NULL, 0, "symbology: 81," },
+ /* 74*/ { "rss_expstack", "[20]01", NULL, 0, "symbology: 81," },
+ /* 75*/ { "planet", "12345678901", NULL, 0, "symbology: 82," },
+ /* 76*/ { "MicroPDF417", "1", NULL, 0, "symbology: 84," },
+ /* 77*/ { "USPS IMail", "12345678901234567890", NULL, 0, "symbology: 85," },
+ /* 78*/ { "OneCode", "12345678901234567890", NULL, 0, "symbology: 85," },
+ /* 79*/ { "plessey", "1", NULL, 0, "symbology: 86," },
+ /* 80*/ { "telepen num", "1", NULL, 0, "symbology: 87," },
+ /* 81*/ { "ITF14", "1", NULL, 0, "symbology: 89," },
+ /* 82*/ { "KIX", "1", NULL, 0, "symbology: 90," },
+ /* 83*/ { "Aztec", "1", NULL, 0, "symbology: 92," },
+ /* 84*/ { "daft", "D", NULL, 0, "symbology: 93," },
+ /* 85*/ { "DPD", "0123456789012345678901234567", NULL, 0, "symbology: 96," },
+ /* 86*/ { "Micro QR", "1", NULL, 0, "symbology: 97," },
+ /* 87*/ { "hibc128", "1", NULL, 0, "symbology: 98," },
+ /* 88*/ { "hibccode128", "1", NULL, 0, "symbology: 98," }, // Synonym
+ /* 89*/ { "hibc39", "1", NULL, 0, "symbology: 99," },
+ /* 90*/ { "hibccode39", "1", NULL, 0, "symbology: 99," }, // Synonym
+ /* 91*/ { "hibcdatamatrix", "1", NULL, 0, "symbology: 102," }, // Synonym
+ /* 92*/ { "hibcdm", "1", NULL, 0, "symbology: 102," },
+ /* 93*/ { "HIBC qr", "1", NULL, 0, "symbology: 104," },
+ /* 94*/ { "HIBC QR Code", "1", NULL, 0, "symbology: 104," }, // Synonym
+ /* 95*/ { "HIBCPDF", "1", NULL, 0, "symbology: 106," },
+ /* 96*/ { "HIBCPDF417", "1", NULL, 0, "symbology: 106," }, // Synonym
+ /* 97*/ { "HIBCMICPDF", "1", NULL, 0, "symbology: 108," },
+ /* 98*/ { "HIBC Micro PDF", "1", NULL, 0, "symbology: 108," }, // Synonym
+ /* 99*/ { "HIBC Micro PDF417", "1", NULL, 0, "symbology: 108," }, // Synonym
+ /*100*/ { "HIBC BlockF", "1", NULL, 0, "symbology: 110," },
+ /*101*/ { "HIBC CodaBlock-F", "1", NULL, 0, "symbology: 110," }, // Synonym
+ /*102*/ { "HIBC Aztec", "1", NULL, 0, "symbology: 112," },
+ /*103*/ { "DotCode", "1", NULL, 0, "symbology: 115," },
+ /*104*/ { "Han Xin", "1", NULL, 0, "symbology: 116," },
+ /*105*/ { "Mailmark", "01000000000000000AA00AA0A", NULL, 0, "symbology: 121," },
+ /*106*/ { "azrune", "1", NULL, 0, "symbology: 128," },
+ /*107*/ { "aztecrune", "1", NULL, 0, "symbology: 128," }, // Synonym
+ /*108*/ { "aztecrunes", "1", NULL, 0, "symbology: 128," }, // Synonym
+ /*109*/ { "code32", "1", NULL, 0, "symbology: 129," },
+ /*110*/ { "eanx cc", "[20]01", "1234567890128", 0, "symbology: 130," },
+ /*111*/ { "eancc", "[20]01", "1234567890128", 0, "symbology: 130," },
+ /*112*/ { "GS1 128 CC", "[01]12345678901231", "[20]01", 0, "symbology: 131," },
+ /*113*/ { "EAN128 CC", "[01]12345678901231", "[20]01", 0, "symbology: 131," },
+ /*114*/ { "dbaromncc", "[20]01", "1234567890123", 0, "symbology: 132," },
+ /*115*/ { "rss14 cc", "[20]01", "1234567890123", 0, "symbology: 132," },
+ /*116*/ { "dbarltdcc", "[20]01", "1234567890123", 0, "symbology: 133," },
+ /*117*/ { "rss ltd cc", "[20]01", "1234567890123", 0, "symbology: 133," },
+ /*118*/ { "dbarexpcc", "[20]01", "[01]12345678901231", 0, "symbology: 134," },
+ /*119*/ { "rss exp cc", "[20]01", "[01]12345678901231", 0, "symbology: 134," },
+ /*120*/ { "upcacc", "[20]01", "12345678901", 0, "symbology: 135," },
+ /*121*/ { "upcecc", "[20]01", "1234567", 0, "symbology: 136," },
+ /*122*/ { "dbar stk cc", "[20]01", "1234567890123", 0, "symbology: 137," },
+ /*123*/ { "rss14stackcc", "[20]01", "1234567890123", 0, "symbology: 137," },
+ /*124*/ { "dbaromnstkcc", "[20]01", "1234567890123", 0, "symbology: 138," },
+ /*125*/ { "BARCODE_RSS14_OMNI_CC", "[20]01", "1234567890123", 0, "symbology: 138," },
+ /*126*/ { "dbarexpstkcc", "[20]01", "[01]12345678901231", 0, "symbology: 139," },
+ /*127*/ { "RSS EXPSTACK CC", "[20]01", "[01]12345678901231", 0, "symbology: 139," },
+ /*128*/ { "Channel", "1", NULL, 0, "symbology: 140," },
+ /*129*/ { "CodeOne", "1", NULL, 0, "symbology: 141," },
+ /*130*/ { "Grid Matrix", "1", NULL, 0, "symbology: 142," },
+ /*131*/ { "UPN QR", "1", NULL, 0, "symbology: 143," },
+ /*132*/ { "UPN QR Code", "1", NULL, 0, "symbology: 143," }, // Synonym
+ /*133*/ { "ultra", "1", NULL, 0, "symbology: 144," },
+ /*134*/ { "ultracode", "1", NULL, 0, "symbology: 144," }, // Synonym
+ /*135*/ { "rMQR", "1", NULL, 0, "symbology: 145," },
+ /*136*/ { "x", "1", NULL, 1, "Error 119: Invalid barcode type 'x'" },
+ /*137*/ { "\177", "1", NULL, 1, "Error 119: Invalid barcode type '\177'" },
};
int data_size = ARRAY_SIZE(data);
int i;
@@ -994,51 +1011,57 @@ static void test_other_opts(int index, int debug) {
char *opt_data;
char *expected;
+ int strstr_cmp;
};
// s/\/\*[ 0-9]*\*\//\=printf("\/*%3d*\/", line(".") - line("'<"))
struct item data[] = {
- /* 0*/ { BARCODE_CODE128, "1", -1, " --bg=", "EF9900", "" },
- /* 1*/ { BARCODE_CODE128, "1", -1, " -bg=", "EF9900", "" },
- /* 2*/ { BARCODE_CODE128, "1", -1, " --bg=", "EF9900AA", "" },
- /* 3*/ { BARCODE_CODE128, "1", -1, " --bg=", "GF9900", "Error 654: Malformed background colour 'GF9900' (hexadecimal only)" },
- /* 4*/ { BARCODE_CODE128, "1", -1, " --fg=", "000000", "" },
- /* 5*/ { BARCODE_CODE128, "1", -1, " --fg=", "00000000", "" },
- /* 6*/ { BARCODE_CODE128, "1", -1, " --fg=", "000000F", "Error 651: Malformed foreground colour (6 or 8 characters only)" },
- /* 7*/ { BARCODE_CODE128, "1", -1, " --fg=", "000000FG", "Error 653: Malformed foreground colour '000000FG' (hexadecimal only)" },
- /* 8*/ { BARCODE_CODE128, "1", -1, " --compliantheight", "", "" },
- /* 9*/ { BARCODE_CODE128, "1", -1, " --fontsize=", "10", "" },
- /* 10*/ { BARCODE_CODE128, "1", -1, " --fontsize=", "101", "Warning 126: Font size out of range (0 to 100), ignoring" },
- /* 11*/ { BARCODE_CODE128, "1", -1, " --nobackground", "", "" },
- /* 12*/ { BARCODE_CODE128, "1", -1, " --noquietzones", "", "" },
- /* 13*/ { BARCODE_CODE128, "1", -1, " --notext", "", "" },
- /* 14*/ { BARCODE_CODE128, "1", -1, " --quietzones", "", "" },
- /* 15*/ { BARCODE_CODE128, "1", -1, " --reverse", "", "" },
- /* 16*/ { BARCODE_CODE128, "1", -1, " --werror", NULL, "" },
- /* 17*/ { 19, "1", -1, " --werror", NULL, "Error 207: Codabar 18 not supported" },
- /* 18*/ { BARCODE_GS1_128, "[01]12345678901231", -1, "", NULL, "" },
- /* 19*/ { BARCODE_GS1_128, "0112345678901231", -1, "", NULL, "Error 252: Data does not start with an AI" },
- /* 20*/ { BARCODE_GS1_128, "0112345678901231", -1, " --gs1nocheck", NULL, "Error 252: Data does not start with an AI" },
- /* 21*/ { BARCODE_GS1_128, "[00]376104250021234569", -1, "", NULL, "" },
- /* 22*/ { BARCODE_GS1_128, "[00]376104250021234568", -1, "", NULL, "Warning 261: AI (00) position 18: Bad checksum '8', expected '9'" },
- /* 23*/ { BARCODE_GS1_128, "[00]376104250021234568", -1, " --gs1nocheck", NULL, "" },
- /* 24*/ { BARCODE_GS1_128, "[00]376104250021234568", -1, " --werror", NULL, "Error 261: AI (00) position 18: Bad checksum '8', expected '9'" },
- /* 25*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "1", "Error 155: Invalid Structured Append argument, expect \"index,count[,ID]\"" },
- /* 26*/ { BARCODE_AZTEC, "1", -1, " --structapp=", ",", "Error 156: Structured Append index too short" },
- /* 27*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "1234567890,", "Error 156: Structured Append index too long" },
- /* 28*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "123456789,", "Error 159: Structured Append count too short" },
- /* 29*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "123456789,1234567890", "Error 159: Structured Append count too long" },
- /* 30*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "123456789,123456789,", "Error 158: Structured Append ID too short" },
- /* 31*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "123456789,1234567890,", "Error 157: Structured Append count too long" },
- /* 32*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "123456789,123456789,123456789012345678901234567890123", "Error 158: Structured Append ID too long" },
- /* 33*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "123456789,123456789,12345678901234567890123456789012", "Error 701: Structured Append count out of range (2-26)" },
- /* 34*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "26,26,12345678901234567890123456789012", "" },
- /* 35*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "A,26,12345678901234567890123456789012", "Error 160: Invalid Structured Append index (digits only)" },
- /* 36*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "26,A,12345678901234567890123456789012", "Error 161: Invalid Structured Append count (digits only)" },
- /* 37*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "26,1,12345678901234567890123456789012", "Error 162: Invalid Structured Append count, must be >= 2" },
- /* 38*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "0,2,12345678901234567890123456789012", "Error 163: Structured Append index out of range (1-2)" },
- /* 39*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "3,2,12345678901234567890123456789012", "Error 163: Structured Append index out of range (1-2)" },
- /* 40*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "2,3,12345678901234567890123456789012", "" },
- /* 41*/ { BARCODE_PDF417, "1", -1, " --heightperrow", "", "" },
+ /* 0*/ { BARCODE_CODE128, "1", -1, " --bg=", "EF9900", "", 0 },
+ /* 1*/ { BARCODE_CODE128, "1", -1, " -bg=", "EF9900", "", 0 },
+ /* 2*/ { BARCODE_CODE128, "1", -1, " --bg=", "EF9900AA", "", 0 },
+ /* 3*/ { BARCODE_CODE128, "1", -1, " --bg=", "GF9900", "Error 654: Malformed background colour 'GF9900' (hexadecimal only)", 0 },
+ /* 4*/ { BARCODE_CODE128, "1", -1, " --fg=", "000000", "", 0 },
+ /* 5*/ { BARCODE_CODE128, "1", -1, " --fg=", "00000000", "", 0 },
+ /* 6*/ { BARCODE_CODE128, "1", -1, " --fg=", "000000F", "Error 651: Malformed foreground colour (6 or 8 characters only)", 0 },
+ /* 7*/ { BARCODE_CODE128, "1", -1, " --fg=", "000000FG", "Error 653: Malformed foreground colour '000000FG' (hexadecimal only)", 0 },
+ /* 8*/ { BARCODE_CODE128, "1", -1, " --compliantheight", "", "", 0 },
+ /* 9*/ { BARCODE_CODE128, "1", -1, " --fontsize=", "10", "", 0 },
+ /* 10*/ { BARCODE_CODE128, "1", -1, " --fontsize=", "101", "Warning 126: Font size out of range (0 to 100), ignoring", 0 },
+ /* 11*/ { BARCODE_CODE128, "1", -1, " --nobackground", "", "", 0 },
+ /* 12*/ { BARCODE_CODE128, "1", -1, " --noquietzones", "", "", 0 },
+ /* 13*/ { BARCODE_CODE128, "1", -1, " --notext", "", "", 0 },
+ /* 14*/ { BARCODE_CODE128, "1", -1, " --quietzones", "", "", 0 },
+ /* 15*/ { BARCODE_CODE128, "1", -1, " --reverse", "", "", 0 },
+ /* 16*/ { BARCODE_CODE128, "1", -1, " --werror", NULL, "", 0 },
+ /* 17*/ { 19, "1", -1, " --werror", NULL, "Error 207: Codabar 18 not supported", 0 },
+ /* 18*/ { BARCODE_GS1_128, "[01]12345678901231", -1, "", NULL, "", 0 },
+ /* 19*/ { BARCODE_GS1_128, "0112345678901231", -1, "", NULL, "Error 252: Data does not start with an AI", 0 },
+ /* 20*/ { BARCODE_GS1_128, "0112345678901231", -1, " --gs1nocheck", NULL, "Error 252: Data does not start with an AI", 0 },
+ /* 21*/ { BARCODE_GS1_128, "[00]376104250021234569", -1, "", NULL, "", 0 },
+ /* 22*/ { BARCODE_GS1_128, "[00]376104250021234568", -1, "", NULL, "Warning 261: AI (00) position 18: Bad checksum '8', expected '9'", 0 },
+ /* 23*/ { BARCODE_GS1_128, "[00]376104250021234568", -1, " --gs1nocheck", NULL, "", 0 },
+ /* 24*/ { BARCODE_GS1_128, "[00]376104250021234568", -1, " --werror", NULL, "Error 261: AI (00) position 18: Bad checksum '8', expected '9'", 0 },
+ /* 25*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "1", "Error 155: Invalid Structured Append argument, expect \"index,count[,ID]\"", 0 },
+ /* 26*/ { BARCODE_AZTEC, "1", -1, " --structapp=", ",", "Error 156: Structured Append index too short", 0 },
+ /* 27*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "1234567890,", "Error 156: Structured Append index too long", 0 },
+ /* 28*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "123456789,", "Error 159: Structured Append count too short", 0 },
+ /* 29*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "123456789,1234567890", "Error 159: Structured Append count too long", 0 },
+ /* 30*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "123456789,123456789,", "Error 158: Structured Append ID too short", 0 },
+ /* 31*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "123456789,1234567890,", "Error 157: Structured Append count too long", 0 },
+ /* 32*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "123456789,123456789,123456789012345678901234567890123", "Error 158: Structured Append ID too long", 0 },
+ /* 33*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "123456789,123456789,12345678901234567890123456789012", "Error 701: Structured Append count out of range (2-26)", 0 },
+ /* 34*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "26,26,12345678901234567890123456789012", "", 0 },
+ /* 35*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "A,26,12345678901234567890123456789012", "Error 160: Invalid Structured Append index (digits only)", 0 },
+ /* 36*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "26,A,12345678901234567890123456789012", "Error 161: Invalid Structured Append count (digits only)", 0 },
+ /* 37*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "26,1,12345678901234567890123456789012", "Error 162: Invalid Structured Append count, must be >= 2", 0 },
+ /* 38*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "0,2,12345678901234567890123456789012", "Error 163: Structured Append index out of range (1-2)", 0 },
+ /* 39*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "3,2,12345678901234567890123456789012", "Error 163: Structured Append index out of range (1-2)", 0 },
+ /* 40*/ { BARCODE_AZTEC, "1", -1, " --structapp=", "2,3,12345678901234567890123456789012", "", 0 },
+ /* 41*/ { BARCODE_PDF417, "1", -1, " --heightperrow", "", "", 0 },
+ /* 42*/ { -1, NULL, -1, " -v", NULL, "Zint version ", 1 },
+ /* 43*/ { -1, NULL, -1, " --version", NULL, "Zint version ", 1 },
+ /* 44*/ { -1, NULL, -1, " -h", NULL, "Encode input data in a barcode ", 1 },
+ /* 45*/ { -1, NULL, -1, " -e", NULL, "3: ISO/IEC 8859-1 ", 1 },
+ /* 46*/ { -1, NULL, -1, " -t", NULL, "1 CODE11 ", 1 },
};
int data_size = ARRAY_SIZE(data);
int i;
@@ -1066,7 +1089,11 @@ static void test_other_opts(int index, int debug) {
strcat(cmd, " 2>&1");
assert_nonnull(exec(cmd, buf, sizeof(buf) - 1, debug, i), "i:%d exec(%s) NULL\n", i, cmd);
- assert_zero(strcmp(buf, data[i].expected), "i:%d buf (%s) != expected (%s) (%s)\n", i, buf, data[i].expected, cmd);
+ if (data[i].strstr_cmp) {
+ assert_nonnull(strstr(buf, data[i].expected), "i:%d strstr buf (%s) != expected (%s) (%s)\n", i, buf, data[i].expected, cmd);
+ } else {
+ assert_zero(strcmp(buf, data[i].expected), "i:%d strcmp buf (%s) != expected (%s) (%s)\n", i, buf, data[i].expected, cmd);
+ }
}
testFinish();
diff --git a/frontend/zint.1.gz b/frontend/zint.1.gz
deleted file mode 100644
index 643482f0..00000000
Binary files a/frontend/zint.1.gz and /dev/null differ
diff --git a/frontend_qt/extCLI.ui b/frontend_qt/extCLI.ui
index f2d782df..5a1ce5a6 100644
--- a/frontend_qt/extCLI.ui
+++ b/frontend_qt/extCLI.ui
@@ -120,7 +120,7 @@
Do not add ".exe" extension to zint command
-(Windows only, ignored is disabled)
+(Windows only, ignored if disabled)
false
diff --git a/frontend_qt/main.cpp b/frontend_qt/main.cpp
index 23f77888..a61f2e28 100644
--- a/frontend_qt/main.cpp
+++ b/frontend_qt/main.cpp
@@ -21,7 +21,7 @@ int main(int argc, char *argv[])
{
Q_INIT_RESOURCE(resources);
-#if QT_VERSION >= 0x50600
+#if QT_VERSION >= 0x50600 && QT_VERSION < 0x60100
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif
#if QT_VERSION >= 0x50400
diff --git a/frontend_qt/mainWindow.ui b/frontend_qt/mainWindow.ui
index 5a674839..7725ead5 100644
--- a/frontend_qt/mainWindow.ui
+++ b/frontend_qt/mainWindow.ui
@@ -391,7 +391,7 @@ or import from file
-
- 27: ISO 646 ASCII
+ 27: ASCII (ISO 646 IRV)
-
@@ -823,7 +823,7 @@ Extended Channel Interpretation (ECI)
-
- 27: ISO 646 ASCII
+ 27: ASCII (ISO 646 IRV)
-
@@ -1068,7 +1068,7 @@ or import from file
-
- 27: ISO 646 ASCII
+ 27: ASCII (ISO 646 IRV)
-
@@ -1313,7 +1313,7 @@ or import from file
-
- 27: ISO 646 ASCII
+ 27: ASCII (ISO 646 IRV)
-
diff --git a/frontend_qt/mainwindow.cpp b/frontend_qt/mainwindow.cpp
index 158373f5..298ee187 100644
--- a/frontend_qt/mainwindow.cpp
+++ b/frontend_qt/mainwindow.cpp
@@ -66,9 +66,9 @@ static const struct bstyle_item bstyle_items[] = {
{ QSL("Australia Post Routing Code"), BARCODE_AUSROUTE },
{ QSL("Australia Post Standard Customer"), BARCODE_AUSPOST },
{ QSL("Aztec Code (ISO 24778) (and HIBC)"), BARCODE_AZTEC },
- { QSL("Aztec Runes"), BARCODE_AZRUNE },
+ { QSL("Aztec Runes (ISO 24778)"), BARCODE_AZRUNE },
{ QSL("Channel Code"), BARCODE_CHANNEL },
- { QSL("Codabar"), BARCODE_CODABAR },
+ { QSL("Codabar (EN 798)"), BARCODE_CODABAR },
{ QSL("Codablock-F (and HIBC)"), BARCODE_CODABLOCKF },
{ QSL("Code 11"), BARCODE_CODE11 },
{ QSL("Code 128 (ISO 15417) (and GS1-128 and HIBC)"), BARCODE_CODE128 },
@@ -92,17 +92,17 @@ static const struct bstyle_item bstyle_items[] = {
{ QSL("DPD Code"), BARCODE_DPD },
{ QSL("Dutch Post KIX"), BARCODE_KIX },
{ QSL("EAN-14"), BARCODE_EAN14 },
- { QSL("European Article Number (EAN)"), BARCODE_EANX },
+ { QSL("European Article Number (EAN) (ISO 15420)"), BARCODE_EANX },
{ QSL("Facing Identification Mark (FIM)"), BARCODE_FIM },
{ QSL("Flattermarken"), BARCODE_FLAT },
{ QSL("Grid Matrix"), BARCODE_GRIDMATRIX },
- { QSL("GS1 DataBar Expanded"), BARCODE_DBAR_EXP },
- { QSL("GS1 DataBar Expanded Stacked"), BARCODE_DBAR_EXPSTK },
- { QSL("GS1 DataBar Limited"), BARCODE_DBAR_LTD },
- { QSL("GS1 DataBar Omnidirectional (and Truncated)"), BARCODE_DBAR_OMN },
- { QSL("GS1 DataBar Stacked"), BARCODE_DBAR_STK },
- { QSL("GS1 DataBar Stacked Omnidirectional"), BARCODE_DBAR_OMNSTK },
- { QSL("Han Xin (Chinese Sensible) Code"), BARCODE_HANXIN },
+ { QSL("GS1 DataBar Expanded (ISO 24724)"), BARCODE_DBAR_EXP },
+ { QSL("GS1 DataBar Expanded Stacked (ISO 24724)"), BARCODE_DBAR_EXPSTK },
+ { QSL("GS1 DataBar Limited (ISO 24724)"), BARCODE_DBAR_LTD },
+ { QSL("GS1 DataBar Omnidirectional (and Truncated) (ISO 24724)"), BARCODE_DBAR_OMN },
+ { QSL("GS1 DataBar Stacked (ISO 24724)"), BARCODE_DBAR_STK },
+ { QSL("GS1 DataBar Stacked Omnidirectional (ISO 24724)"), BARCODE_DBAR_OMNSTK },
+ { QSL("Han Xin (Chinese Sensible) Code (ISO 20830)"), BARCODE_HANXIN },
{ QSL("International Standard Book Number (ISBN)"), BARCODE_ISBNX },
{ QSL("ITF-14"), BARCODE_ITF14 },
{ QSL("Japanese Postal Barcode"), BARCODE_JAPANPOST },
@@ -110,7 +110,7 @@ static const struct bstyle_item bstyle_items[] = {
{ QSL("LOGMARS"), BARCODE_LOGMARS },
{ QSL("MaxiCode (ISO 16023)"), BARCODE_MAXICODE },
{ QSL("MicroPDF417 (ISO 24728) (and HIBC)"), BARCODE_MICROPDF417 },
- { QSL("Micro QR Code"), BARCODE_MICROQR },
+ { QSL("Micro QR Code (ISO 18004)"), BARCODE_MICROQR },
{ QSL("MSI Plessey"), BARCODE_MSI_PLESSEY },
{ QSL("NVE-18 (SSCC-18)"), BARCODE_NVE18 },
{ QSL("PDF417 (ISO 15438) (and Compact and HIBC)"), BARCODE_PDF417 },
@@ -127,8 +127,8 @@ static const struct bstyle_item bstyle_items[] = {
{ QSL("Telepen Numeric"), BARCODE_TELEPEN_NUM },
{ QSL("UK Plessey"), BARCODE_PLESSEY },
{ QSL("Ultracode"), BARCODE_ULTRA },
- { QSL("Universal Product Code (UPC-A)"), BARCODE_UPCA },
- { QSL("Universal Product Code (UPC-E)"), BARCODE_UPCE },
+ { QSL("Universal Product Code (UPC-A) (ISO 15420)"), BARCODE_UPCA },
+ { QSL("Universal Product Code (UPC-E) (ISO 15420)"), BARCODE_UPCE },
{ QSL("UPNQR"), BARCODE_UPNQR },
{ QSL("USPS Intelligent Mail (OneCode)"), BARCODE_USPS_IMAIL },
{ QSL("VIN (Vehicle Identification Number)"), BARCODE_VIN },
@@ -532,7 +532,7 @@ void MainWindow::about()
"\"QR Code\" is a Registered Trademark of Denso Corp.
"
"\"Telepen\" is a Registered Trademark of SB Electronics.
"
"Currently supported standards include: "
- "EN 797:1996, EN 798:1996, EN 12323:2005, ISO/IEC 15417:2007, "
+ "EN 798:1996, EN 12323:2005, ISO/IEC 15420:2009, ISO/IEC 15417:2007, "
"ISO/IEC 15438:2015, ISO/IEC 16022:2006, ISO/IEC 16023:2000, "
"ISO/IEC 16388:2007, ISO/IEC 18004:2015, ISO/IEC 20830:2021, "
"ISO/IEC 24723:2010, ISO/IEC 24724:2011, ISO/IEC 24728:2006, "
@@ -2272,10 +2272,7 @@ void MainWindow::update_preview()
case BARCODE_UPNQR:
m_bc.bc.setSymbol(BARCODE_UPNQR);
- //eci_not_set = false;
cmbECI->setCurrentIndex(2 /*ECI 4*/);
- //cmbECI->setEnabled(false);
- //lblECI->setEnabled(false);
if ((item_val = get_cmb_index(QSL("cmbUPNQRMask"))) != 0) {
m_bc.bc.setOption3((item_val << 8) | m_bc.bc.option3());
}
diff --git a/tools/update_version.php b/tools/update_version.php
index b98ae7d1..2f3f6dcc 100644
--- a/tools/update_version.php
+++ b/tools/update_version.php
@@ -10,8 +10,10 @@
*
* e.g. before release
* php tools/update_version.php 3 4 5
+ * cd docs; make
* after release
* php tools/update_version.php 3 4 5 9
+ * cd docs; make
*/
/* vim: set ts=4 sw=4 et : */
@@ -232,9 +234,17 @@ version_replace(1, $data_dirname . 'backend_qt/backend_vc8.pro', '/^VERSION[ \t]
version_replace(1, $data_dirname . 'backend_qt/backend_qt.pro', '/ZINT_VERSION="/', '/[0-9.]+/', $v_str);
version_replace(1, $data_dirname . 'backend_qt/backend_qt.pro', '/^VERSION[ \t]*=/', '/[0-9.]+/', $v_str);
-// docs/manual.txt
+// docs/manual.pmd
-version_replace(1, $data_dirname . 'docs/manual.txt', '/^The current version of Zint/', '/[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?/', $v_str);
+version_replace(1, $data_dirname . 'docs/manual.pmd', '/^% Version /', '/[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?( \(dev\))?/', $v_str);
+if ($build !== 9) { // Don't update if marking version as dev
+ version_replace(1, $data_dirname . 'docs/manual.pmd', '/^The current stable version of Zint/', '/[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?/', $v_str);
+}
+version_replace(1, $data_dirname . 'docs/manual.pmd', '/^Zint version /', '/[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?( \(dev\))?/', $v_str);
+
+// docs/zint.1.pmd
+
+version_replace(1, $data_dirname . 'docs/zint.1.pmd', '/^% zint\(1\) Version /', '/[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?( \(dev\))?/', $v_str);
// frontend_qt/res/qtZint.rc
@@ -290,6 +300,7 @@ version_replace(2, $data_dirname . 'win32/vs2019/zint.vcxproj', '/ZINT_VERSION="
print PHP_EOL;
print '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' . PHP_EOL;
+print '!!! REMEMBER: cd docs; make !!!' . PHP_EOL;
print '!!! REMEMBER: run "autoconf" and "./configure" in "backend_tcl/" !!!' . PHP_EOL;
print '!!! REMEMBER: update version and date in "ChangeLog" !!!' . PHP_EOL;
print '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' . PHP_EOL;
|