Mercurial > hgrepos > Python2 > PyMuPDF
diff mupdf-source/thirdparty/zint/docs/manual.html @ 2:b50eed0cc0ef upstream
ADD: MuPDF v1.26.7: the MuPDF source as downloaded by a default build of PyMuPDF 1.26.4.
The directory name has changed: no version number in the expanded directory now.
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Mon, 15 Sep 2025 11:43:07 +0200 |
| parents | |
| children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mupdf-source/thirdparty/zint/docs/manual.html Mon Sep 15 11:43:07 2025 +0200 @@ -0,0 +1,9545 @@ +<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang=""> +<head> + <meta charset="utf-8" /> + <meta name="generator" content="pandoc" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" /> + <meta name="author" content="Version 2.13.0.9" /> + <title>Zint Barcode Generator and Zint Barcode Studio User Manual</title> + <style> + html { + font-family: TeX Gyre Pagella; + color: #1a1a1a; + background-color: #ffffff; + } + body { + line-height: 1.2; + margin: 0 auto; + max-width: 50em; + padding-left: 50px; + padding-right: 50px; + padding-top: 50px; + padding-bottom: 50px; + hyphens: auto; + overflow-wrap: break-word; + text-rendering: optimizeLegibility; + font-kerning: normal; + } + @media (max-width: 600px) { + body { + font-size: 0.9em; + padding: 12px; + } + h1 { + font-size: 1.8em; + } + } + @media print { + html { + background-color: white; + } + body { + background-color: transparent; + color: black; + font-size: 12pt; + } + p, h2, h3 { + orphans: 3; + widows: 3; + } + h2, h3, h4 { + page-break-after: avoid; + } + } + p { + margin: 1em 0; + } + a { + color: #800000; + } + a:visited { + color: #800000; + } + a:not(:hover) { + text-decoration: none; + } + figure { + margin-left: 0; + margin-right: 0; + text-align: center; + } + img { + max-width: 100%; + } + img.btn { + height: 0.9em; + } + img.win { + max-width: 80%; + } + img.pop { + max-width: 60%; + } + img[src*="gui_set_printing_scale.png"] { + max-width: 50%; + } + img.lin { + max-height: 10em; + } + img[src*="code128_rotate90.svg"] { + max-height: 20em; + } + img.i2d { + max-height: 10em; + } + img[src*="upnqr.svg"] { + max-height: 20em; + } + img.i2dbig { + } + img.trk { + max-height: 3em; + } + img[src*="fim.svg"] { + max-height: 10em; + } + img.dotty { + max-height: 7em; + } + img.ultra { + max-height: 12em; + } + img.upcean { + max-height: 12em; + } + h1, h2, h3, h4, h5, h6 { + margin-top: 1.4em; + } + h5, h6 { + font-size: 1em; + font-style: italic; + } + h6 { + font-weight: normal; + } + ol, ul { + padding-left: 1.7em; + margin-top: 1em; + } + li > ol, li > ul { + margin-top: 0; + } + dt { + font-weight:bold; + } + blockquote { + margin: 1em 0 1em 1.7em; + padding-left: 1em; + border-left: 2px solid #e6e6e6; + color: #606060; + } + code { + font-family: Liberation Mono; + font-size: 90%; + margin: 0; + hyphens: manual; + color: #000000; + } + pre { + margin: 1em 0; + overflow: auto; + } + pre code { + padding: 0; + overflow: visible; + overflow-wrap: normal; + } + .sourceCode { + background-color: transparent; + overflow: visible; + } + div.sourceCode { + background-color: #f7f7f7; + padding: 0.3em 0; + } + aside.footnotes { + font-size:90%; + } + hr { + background-color: #1a1a1a; + border: none; + height: 1px; + margin: 1em 0; + } + table { + margin: 0 auto 0.4em auto; + border-collapse: collapse; + overflow-x: auto; + font-variant-numeric: lining-nums tabular-nums; + } + #tbl\:gridmatrix_eccs { + margin-top: 1em; + } + table caption { + margin-bottom: 0.75em; + } + tbody { + margin-top: 0.5em; + border-top: 1px solid #1a1a1a; + border-bottom: 1px solid #1a1a1a; + } + th { + border-top: 1px solid #1a1a1a; + padding: 0.25em 0.5em 0.25em 0.5em; + } + td { + padding: 0.125em 0.5em 0.25em 0.5em; + vertical-align: top; + } + tbody tr:first-child td { + padding-top: 0.5em; + } + thead > tr { + margin-bottom: 4em; + text-align: center; + } + #banner { + text-align: center; + } + #banner img.img_hdr { + height: 7em; + } + #TOC { + font-size: 115%; + } + #TOC li { + list-style: none; + margin-bottom: 0.1em; + margin-top: 0.2em; + } + #TOC ul { + padding-left: 1.3em; + } + #TOC > ul { + padding-left: 0; + } + #TOC > ul > li { + margin-top: 0.5em; + } + #TOC > ul > li > a { + font-weight: bold; + } + #TOC a:not(:hover) { + color: #1a1a1a; + text-decoration: none; + } + dd > p { + margin-bottom:1.5em; + margin-top:0.5em; + } + #exit-status + dl > dt { + float: left; + } + #exit-status + dl > dd { + margin-bottom: 1em; + } + + code{white-space: pre-wrap;} + span.smallcaps{font-variant: small-caps;} + div.columns{display: flex; gap: min(4vw, 1.5em);} + div.column{flex: auto; overflow-x: auto;} + div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} + /* The extra [class] is a hack that increases specificity enough to + override a similar rule in reveal.js */ + ul.task-list[class]{list-style: none;} + ul.task-list li input[type="checkbox"] { + font-size: inherit; + width: 0.8em; + margin: 0 0.8em 0.2em -1.6em; + vertical-align: middle; + } + .display.math{display: block; text-align: center; margin: 0.5rem auto;} + /* CSS for syntax highlighting */ + html { -webkit-text-size-adjust: 100%; } + pre > code.sourceCode { white-space: pre; position: relative; } + pre > code.sourceCode > span { display: inline-block; line-height: 1.25; } + pre > code.sourceCode > span:empty { height: 1.2em; } + .sourceCode { overflow: visible; } + code.sourceCode > span { color: inherit; text-decoration: inherit; } + div.sourceCode { margin: 1em 0; } + pre.sourceCode { margin: 0; } + @media screen { + div.sourceCode { overflow: auto; } + } + @media print { + pre > code.sourceCode { white-space: pre-wrap; } + pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; } + } + pre.numberSource code + { counter-reset: source-line 0; } + pre.numberSource code > span + { position: relative; left: -4em; counter-increment: source-line; } + pre.numberSource code > span > a:first-child::before + { content: counter(source-line); + position: relative; left: -1em; text-align: right; vertical-align: baseline; + border: none; display: inline-block; + -webkit-touch-callout: none; -webkit-user-select: none; + -khtml-user-select: none; -moz-user-select: none; + -ms-user-select: none; user-select: none; + padding: 0 4px; width: 4em; + color: #aaaaaa; + } + pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; } + div.sourceCode + { } + @media screen { + pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; } + } + code span.al { color: #ff0000; } /* Alert */ + code span.an { color: #008000; } /* Annotation */ + code span.at { } /* Attribute */ + code span.bu { } /* BuiltIn */ + code span.cf { color: #0000ff; } /* ControlFlow */ + code span.ch { color: #008080; } /* Char */ + code span.cn { } /* Constant */ + code span.co { color: #008000; } /* Comment */ + code span.cv { color: #008000; } /* CommentVar */ + code span.do { color: #008000; } /* Documentation */ + code span.er { color: #ff0000; font-weight: bold; } /* Error */ + code span.ex { } /* Extension */ + code span.im { } /* Import */ + code span.in { color: #008000; } /* Information */ + code span.kw { color: #0000ff; } /* Keyword */ + code span.op { } /* Operator */ + code span.ot { color: #ff4000; } /* Other */ + code span.pp { color: #ff4000; } /* Preprocessor */ + code span.sc { color: #008080; } /* SpecialChar */ + code span.ss { color: #008080; } /* SpecialString */ + code span.st { color: #008080; } /* String */ + code span.va { } /* Variable */ + code span.vs { color: #008080; } /* VerbatimString */ + code span.wa { color: #008000; font-weight: bold; } /* Warning */ + </style> + <!--[if lt IE 9]> + <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script> + <![endif]--> +</head> +<body> +<div id="banner"> +<img src="images/zint.png" class="img_hdr"> +<img src="images/zint-qt.png" class="img_hdr"> +</div> +<header id="title-block-header"> +<h1 class="title">Zint Barcode Generator and Zint Barcode Studio User +Manual</h1> +<p class="author">Version 2.13.0.9</p> +<p class="date">December 2024</p> +</header> +<nav id="TOC" role="doc-toc"> +<ul> +<li><a href="#introduction" id="toc-introduction">1. Introduction</a> +<ul> +<li><a href="#glossary" id="toc-glossary">1.1 Glossary</a></li> +</ul></li> +<li><a href="#installing-zint" id="toc-installing-zint">2. Installing +Zint</a> +<ul> +<li><a href="#linux" id="toc-linux">2.1 Linux</a></li> +<li><a href="#bsd" id="toc-bsd">2.2 BSD</a></li> +<li><a href="#microsoft-windows" id="toc-microsoft-windows">2.3 +Microsoft Windows</a></li> +<li><a href="#apple-macos" id="toc-apple-macos">2.4 Apple macOS</a></li> +<li><a href="#zint-tcl-backend" id="toc-zint-tcl-backend">2.5 Zint Tcl +Backend</a></li> +</ul></li> +<li><a href="#using-zint-barcode-studio" +id="toc-using-zint-barcode-studio">3. Using Zint Barcode Studio</a> +<ul> +<li><a href="#main-window-and-data-tab" +id="toc-main-window-and-data-tab">3.1 Main Window and Data Tab</a></li> +<li><a href="#gs1-composite-groupbox" +id="toc-gs1-composite-groupbox">3.2 GS1 Composite Groupbox</a></li> +<li><a href="#additional-ecidata-segments-groupbox" +id="toc-additional-ecidata-segments-groupbox">3.3 Additional ECI/Data +Segments Groupbox</a></li> +<li><a href="#symbology-specific-groupbox" +id="toc-symbology-specific-groupbox">3.4 Symbology-specific +Groupbox</a></li> +<li><a href="#symbology-specific-tab" +id="toc-symbology-specific-tab">3.5 Symbology-specific Tab</a></li> +<li><a href="#appearance-tab" id="toc-appearance-tab">3.6 Appearance +Tab</a></li> +<li><a href="#data-dialog" id="toc-data-dialog">3.7 Data Dialog</a></li> +<li><a href="#sequence-dialog" id="toc-sequence-dialog">3.8 Sequence +Dialog</a></li> +<li><a href="#export-dialog" id="toc-export-dialog">3.9 Export +Dialog</a></li> +<li><a href="#cli-equivalent-dialog" id="toc-cli-equivalent-dialog">3.10 +CLI Equivalent Dialog</a></li> +</ul></li> +<li><a href="#using-the-command-line" id="toc-using-the-command-line">4. +Using the Command Line</a> +<ul> +<li><a href="#inputting-data" id="toc-inputting-data">4.1 Inputting +Data</a></li> +<li><a href="#directing-output" id="toc-directing-output">4.2 Directing +Output</a></li> +<li><a href="#selecting-barcode-type" +id="toc-selecting-barcode-type">4.3 Selecting Barcode Type</a></li> +<li><a href="#adjusting-height" id="toc-adjusting-height">4.4 Adjusting +Height</a></li> +<li><a href="#adjusting-whitespace" id="toc-adjusting-whitespace">4.5 +Adjusting Whitespace</a></li> +<li><a href="#adding-boundary-bars-and-boxes" +id="toc-adding-boundary-bars-and-boxes">4.6 Adding Boundary Bars and +Boxes</a></li> +<li><a href="#using-colour" id="toc-using-colour">4.7 Using +Colour</a></li> +<li><a href="#rotating-the-symbol" id="toc-rotating-the-symbol">4.8 +Rotating the Symbol</a></li> +<li><a href="#adjusting-image-size-x-dimension" +id="toc-adjusting-image-size-x-dimension">4.9 Adjusting Image Size +(X-dimension)</a> +<ul> +<li><a href="#scaling-by-x-dimension-and-resolution" +id="toc-scaling-by-x-dimension-and-resolution">4.9.1 Scaling by +X-dimension and Resolution</a></li> +<li><a href="#scaling-example" id="toc-scaling-example">4.9.2 Scaling +Example</a></li> +<li><a href="#maxicode-raster-scaling" +id="toc-maxicode-raster-scaling">4.9.3 MaxiCode Raster Scaling</a></li> +</ul></li> +<li><a href="#human-readable-text-hrt-options" +id="toc-human-readable-text-hrt-options">4.10 Human Readable Text (HRT) +Options</a></li> +<li><a href="#input-modes" id="toc-input-modes">4.11 Input Modes</a> +<ul> +<li><a href="#unicode-data-and-gs1-modes" +id="toc-unicode-data-and-gs1-modes">4.11.1 Unicode, Data, and GS1 +Modes</a></li> +<li><a href="#input-modes-and-eci" id="toc-input-modes-and-eci">4.11.2 +Input Modes and ECI</a> +<ul> +<li><a href="#input-modes-and-eci-example-1" +id="toc-input-modes-and-eci-example-1">4.11.2.1 Input Modes and ECI +Example 1</a></li> +<li><a href="#input-modes-and-eci-example-2" +id="toc-input-modes-and-eci-example-2">4.11.2.2 Input Modes and ECI +Example 2</a></li> +<li><a href="#input-modes-and-eci-example-3" +id="toc-input-modes-and-eci-example-3">4.11.2.3 Input Modes and ECI +Example 3</a></li> +</ul></li> +</ul></li> +<li><a href="#batch-processing" id="toc-batch-processing">4.12 Batch +Processing</a></li> +<li><a href="#direct-output-to-stdout" +id="toc-direct-output-to-stdout">4.13 Direct Output to stdout</a></li> +<li><a href="#automatic-filenames" id="toc-automatic-filenames">4.14 +Automatic Filenames</a></li> +<li><a href="#working-with-dots" id="toc-working-with-dots">4.15 Working +with Dots</a></li> +<li><a href="#multiple-segments" id="toc-multiple-segments">4.16 +Multiple Segments</a></li> +<li><a href="#structured-append" id="toc-structured-append">4.17 +Structured Append</a></li> +<li><a href="#help-options" id="toc-help-options">4.18 Help +Options</a></li> +<li><a href="#other-options" id="toc-other-options">4.19 Other +Options</a></li> +</ul></li> +<li><a href="#using-the-api" id="toc-using-the-api">5. Using the API</a> +<ul> +<li><a href="#creating-and-deleting-symbols" +id="toc-creating-and-deleting-symbols">5.1 Creating and Deleting +Symbols</a></li> +<li><a href="#encoding-and-saving-to-file" +id="toc-encoding-and-saving-to-file">5.2 Encoding and Saving to +File</a></li> +<li><a href="#encoding-and-printing-functions-in-depth" +id="toc-encoding-and-printing-functions-in-depth">5.3 Encoding and +Printing Functions in Depth</a></li> +<li><a href="#buffering-symbols-in-memory-raster" +id="toc-buffering-symbols-in-memory-raster">5.4 Buffering Symbols in +Memory (raster)</a></li> +<li><a href="#buffering-symbols-in-memory-vector" +id="toc-buffering-symbols-in-memory-vector">5.5 Buffering Symbols in +Memory (vector)</a></li> +<li><a href="#buffering-symbols-in-memory-memfile" +id="toc-buffering-symbols-in-memory-memfile">5.6 Buffering Symbols in +Memory (memfile)</a></li> +<li><a href="#setting-options" id="toc-setting-options">5.7 Setting +Options</a></li> +<li><a href="#handling-errors" id="toc-handling-errors">5.8 Handling +Errors</a></li> +<li><a href="#specifying-a-symbology" +id="toc-specifying-a-symbology">5.9 Specifying a Symbology</a></li> +<li><a href="#adjusting-output-options" +id="toc-adjusting-output-options">5.10 Adjusting Output Options</a></li> +<li><a href="#setting-the-input-mode" +id="toc-setting-the-input-mode">5.11 Setting the Input Mode</a></li> +<li><a href="#multiple-segments-1" id="toc-multiple-segments-1">5.12 +Multiple Segments</a></li> +<li><a href="#scaling-helpers" id="toc-scaling-helpers">5.13 Scaling +Helpers</a></li> +<li><a href="#verifying-symbology-availability" +id="toc-verifying-symbology-availability">5.14 Verifying Symbology +Availability</a></li> +<li><a href="#checking-symbology-capabilities" +id="toc-checking-symbology-capabilities">5.15 Checking Symbology +Capabilities</a></li> +<li><a href="#zint-version" id="toc-zint-version">5.16 Zint +Version</a></li> +</ul></li> +<li><a href="#types-of-symbology" id="toc-types-of-symbology">6. Types +of Symbology</a> +<ul> +<li><a href="#one-dimensional-symbols" +id="toc-one-dimensional-symbols">6.1 One-Dimensional Symbols</a> +<ul> +<li><a href="#code-11" id="toc-code-11">6.1.1 Code 11</a></li> +<li><a href="#code-2-of-5" id="toc-code-2-of-5">6.1.2 Code 2 of 5</a> +<ul> +<li><a href="#standard-code-2-of-5" +id="toc-standard-code-2-of-5">6.1.2.1 Standard Code 2 of 5</a></li> +<li><a href="#iata-code-2-of-5" id="toc-iata-code-2-of-5">6.1.2.2 IATA +Code 2 of 5</a></li> +<li><a href="#industrial-code-2-of-5" +id="toc-industrial-code-2-of-5">6.1.2.3 Industrial Code 2 of 5</a></li> +<li><a href="#interleaved-code-2-of-5-iso-16390" +id="toc-interleaved-code-2-of-5-iso-16390">6.1.2.4 Interleaved Code 2 of +5 (ISO 16390)</a></li> +<li><a href="#code-2-of-5-data-logic" +id="toc-code-2-of-5-data-logic">6.1.2.5 Code 2 of 5 Data Logic</a></li> +<li><a href="#itf-14" id="toc-itf-14">6.1.2.6 ITF-14</a></li> +<li><a href="#deutsche-post-leitcode" +id="toc-deutsche-post-leitcode">6.1.2.7 Deutsche Post Leitcode</a></li> +<li><a href="#deutsche-post-identcode" +id="toc-deutsche-post-identcode">6.1.2.8 Deutsche Post +Identcode</a></li> +</ul></li> +<li><a href="#upc-universal-product-code-iso-15420" +id="toc-upc-universal-product-code-iso-15420">6.1.3 UPC (Universal +Product Code) (ISO 15420)</a> +<ul> +<li><a href="#upc-version-a" id="toc-upc-version-a">6.1.3.1 UPC Version +A</a></li> +<li><a href="#upc-version-e" id="toc-upc-version-e">6.1.3.2 UPC Version +E</a></li> +</ul></li> +<li><a href="#ean-european-article-number-iso-15420" +id="toc-ean-european-article-number-iso-15420">6.1.4 EAN (European +Article Number) (ISO 15420)</a> +<ul> +<li><a href="#ean-2-ean-5-ean-8-and-ean-13" +id="toc-ean-2-ean-5-ean-8-and-ean-13">6.1.4.1 EAN-2, EAN-5, EAN-8 and +EAN-13</a></li> +<li><a href="#sbn-isbn-and-isbn-13" +id="toc-sbn-isbn-and-isbn-13">6.1.4.2 SBN, ISBN and ISBN-13</a></li> +</ul></li> +<li><a href="#plessey" id="toc-plessey">6.1.5 Plessey</a> +<ul> +<li><a href="#uk-plessey" id="toc-uk-plessey">6.1.5.1 UK +Plessey</a></li> +<li><a href="#msi-plessey" id="toc-msi-plessey">6.1.5.2 MSI +Plessey</a></li> +</ul></li> +<li><a href="#telepen" id="toc-telepen">6.1.6 Telepen</a> +<ul> +<li><a href="#telepen-alpha" id="toc-telepen-alpha">6.1.6.1 Telepen +Alpha</a></li> +<li><a href="#telepen-numeric" id="toc-telepen-numeric">6.1.6.2 Telepen +Numeric</a></li> +</ul></li> +<li><a href="#code-39" id="toc-code-39">6.1.7 Code 39</a> +<ul> +<li><a href="#standard-code-39-iso-16388" +id="toc-standard-code-39-iso-16388">6.1.7.1 Standard Code 39 (ISO +16388)</a></li> +<li><a href="#extended-code-39" id="toc-extended-code-39">6.1.7.2 +Extended Code 39</a></li> +<li><a href="#code-93" id="toc-code-93">6.1.7.3 Code 93</a></li> +<li><a href="#pzn-pharmazentralnummer" +id="toc-pzn-pharmazentralnummer">6.1.7.4 PZN +(Pharmazentralnummer)</a></li> +<li><a href="#logmars" id="toc-logmars">6.1.7.5 LOGMARS</a></li> +<li><a href="#code-32" id="toc-code-32">6.1.7.6 Code 32</a></li> +<li><a href="#hibc-code-39" id="toc-hibc-code-39">6.1.7.7 HIBC Code +39</a></li> +<li><a href="#vehicle-identification-number-vin" +id="toc-vehicle-identification-number-vin">6.1.7.8 Vehicle +Identification Number (VIN)</a></li> +</ul></li> +<li><a href="#codabar-en-798" id="toc-codabar-en-798">6.1.8 Codabar (EN +798)</a></li> +<li><a href="#pharmacode" id="toc-pharmacode">6.1.9 Pharmacode</a></li> +<li><a href="#code-128" id="toc-code-128">6.1.10 Code 128</a> +<ul> +<li><a href="#standard-code-128-iso-15417" +id="toc-standard-code-128-iso-15417">6.1.10.1 Standard Code 128 (ISO +15417)</a></li> +<li><a href="#code-128-suppress-code-set-c-code-sets-a-and-b-only" +id="toc-code-128-suppress-code-set-c-code-sets-a-and-b-only">6.1.10.2 +Code 128 Suppress Code Set C (Code Sets A and B only)</a></li> +<li><a href="#gs1-128" id="toc-gs1-128">6.1.10.3 GS1-128</a></li> +<li><a href="#ean-14" id="toc-ean-14">6.1.10.4 EAN-14</a></li> +<li><a href="#nve-18-sscc-18" id="toc-nve-18-sscc-18">6.1.10.5 NVE-18 +(SSCC-18)</a></li> +<li><a href="#hibc-code-128" id="toc-hibc-code-128">6.1.10.6 HIBC Code +128</a></li> +<li><a href="#dpd-code" id="toc-dpd-code">6.1.10.7 DPD Code</a></li> +<li><a href="#upu-s10" id="toc-upu-s10">6.1.10.8 UPU S10</a></li> +</ul></li> +<li><a href="#gs1-databar-iso-24724" +id="toc-gs1-databar-iso-24724">6.1.11 GS1 DataBar (ISO 24724)</a> +<ul> +<li><a href="#gs1-databar-omnidirectional-and-gs1-databar-truncated" +id="toc-gs1-databar-omnidirectional-and-gs1-databar-truncated">6.1.11.1 +GS1 DataBar Omnidirectional and GS1 DataBar Truncated</a></li> +<li><a href="#gs1-databar-limited" id="toc-gs1-databar-limited">6.1.11.2 +GS1 DataBar Limited</a></li> +<li><a href="#gs1-databar-expanded" +id="toc-gs1-databar-expanded">6.1.11.3 GS1 DataBar Expanded</a></li> +</ul></li> +<li><a href="#korea-post-barcode" id="toc-korea-post-barcode">6.1.12 +Korea Post Barcode</a></li> +<li><a href="#channel-code" id="toc-channel-code">6.1.13 Channel +Code</a></li> +<li><a href="#bc412-semi-t1-95" id="toc-bc412-semi-t1-95">6.1.14 BC412 +(SEMI T1-95)</a></li> +</ul></li> +<li><a href="#stacked-symbologies" id="toc-stacked-symbologies">6.2 +Stacked Symbologies</a> +<ul> +<li><a href="#basic-symbol-stacking" +id="toc-basic-symbol-stacking">6.2.1 Basic Symbol Stacking</a></li> +<li><a href="#codablock-f" id="toc-codablock-f">6.2.2 +Codablock-F</a></li> +<li><a href="#code-16k-en-12323" id="toc-code-16k-en-12323">6.2.3 Code +16K (EN 12323)</a></li> +<li><a href="#pdf417-iso-15438" id="toc-pdf417-iso-15438">6.2.4 PDF417 +(ISO 15438)</a></li> +<li><a href="#compact-pdf417-iso-15438" +id="toc-compact-pdf417-iso-15438">6.2.5 Compact PDF417 (ISO +15438)</a></li> +<li><a href="#micropdf417-iso-24728" +id="toc-micropdf417-iso-24728">6.2.6 MicroPDF417 (ISO 24728)</a></li> +<li><a href="#gs1-databar-stacked-iso-24724" +id="toc-gs1-databar-stacked-iso-24724">6.2.7 GS1 DataBar Stacked (ISO +24724)</a> +<ul> +<li><a href="#gs1-databar-stacked" id="toc-gs1-databar-stacked">6.2.7.1 +GS1 DataBar Stacked</a></li> +<li><a href="#gs1-databar-stacked-omnidirectional" +id="toc-gs1-databar-stacked-omnidirectional">6.2.7.2 GS1 DataBar Stacked +Omnidirectional</a></li> +<li><a href="#gs1-databar-expanded-stacked" +id="toc-gs1-databar-expanded-stacked">6.2.7.3 GS1 DataBar Expanded +Stacked</a></li> +</ul></li> +<li><a href="#code-49" id="toc-code-49">6.2.8 Code 49</a></li> +</ul></li> +<li><a href="#gs1-composite-symbols-iso-24723" +id="toc-gs1-composite-symbols-iso-24723">6.3 GS1 Composite Symbols (ISO +24723)</a> +<ul> +<li><a href="#cc-a" id="toc-cc-a">6.3.1 CC-A</a></li> +<li><a href="#cc-b" id="toc-cc-b">6.3.2 CC-B</a></li> +<li><a href="#cc-c" id="toc-cc-c">6.3.3 CC-C</a></li> +</ul></li> +<li><a href="#two-track-symbols" id="toc-two-track-symbols">6.4 +Two-Track Symbols</a> +<ul> +<li><a href="#two-track-pharmacode" id="toc-two-track-pharmacode">6.4.1 +Two-Track Pharmacode</a></li> +<li><a href="#postnet" id="toc-postnet">6.4.2 POSTNET</a></li> +<li><a href="#planet" id="toc-planet">6.4.3 PLANET</a></li> +<li><a href="#brazilian-cepnet" id="toc-brazilian-cepnet">6.4.4 +Brazilian CEPNet</a></li> +<li><a href="#dx-film-edge-barcode" id="toc-dx-film-edge-barcode">6.4.5 +DX Film Edge Barcode</a></li> +</ul></li> +<li><a href="#state-postal-codes" id="toc-state-postal-codes">6.5 +4-State Postal Codes</a> +<ul> +<li><a href="#australia-post-4-state-symbols" +id="toc-australia-post-4-state-symbols">6.5.1 Australia Post 4-State +Symbols</a> +<ul> +<li><a href="#customer-barcodes" id="toc-customer-barcodes">6.5.1.1 +Customer Barcodes</a></li> +<li><a href="#reply-paid-barcode" id="toc-reply-paid-barcode">6.5.1.2 +Reply Paid Barcode</a></li> +<li><a href="#routing-barcode" id="toc-routing-barcode">6.5.1.3 Routing +Barcode</a></li> +<li><a href="#redirect-barcode" id="toc-redirect-barcode">6.5.1.4 +Redirect Barcode</a></li> +</ul></li> +<li><a href="#dutch-post-kix-code" id="toc-dutch-post-kix-code">6.5.2 +Dutch Post KIX Code</a></li> +<li><a href="#royal-mail-4-state-customer-code-rm4scc" +id="toc-royal-mail-4-state-customer-code-rm4scc">6.5.3 Royal Mail +4-State Customer Code (RM4SCC)</a></li> +<li><a href="#royal-mail-4-state-mailmark" +id="toc-royal-mail-4-state-mailmark">6.5.4 Royal Mail 4-State +Mailmark</a></li> +<li><a href="#usps-intelligent-mail" +id="toc-usps-intelligent-mail">6.5.5 USPS Intelligent Mail</a></li> +<li><a href="#japanese-postal-code" id="toc-japanese-postal-code">6.5.6 +Japanese Postal Code</a></li> +<li><a href="#daft-code" id="toc-daft-code">6.5.7 DAFT Code</a></li> +</ul></li> +<li><a href="#matrix-symbols" id="toc-matrix-symbols">6.6 Matrix +Symbols</a> +<ul> +<li><a href="#data-matrix-iso-16022" +id="toc-data-matrix-iso-16022">6.6.1 Data Matrix (ISO 16022)</a></li> +<li><a href="#royal-mail-2d-mailmark-cmdm-data-matrix" +id="toc-royal-mail-2d-mailmark-cmdm-data-matrix">6.6.2 Royal Mail 2D +Mailmark (CMDM) (Data Matrix)</a></li> +<li><a href="#qr-code-iso-18004" id="toc-qr-code-iso-18004">6.6.3 QR +Code (ISO 18004)</a></li> +<li><a href="#micro-qr-code-iso-18004" +id="toc-micro-qr-code-iso-18004">6.6.4 Micro QR Code (ISO +18004)</a></li> +<li><a href="#rectangular-micro-qr-code-rmqr-iso-23941" +id="toc-rectangular-micro-qr-code-rmqr-iso-23941">6.6.5 Rectangular +Micro QR Code (rMQR) (ISO 23941)</a></li> +<li><a href="#upnqr-univerzalnega-plačilnega-naloga-qr" +id="toc-upnqr-univerzalnega-plačilnega-naloga-qr">6.6.6 UPNQR +(Univerzalnega Plačilnega Naloga QR)</a></li> +<li><a href="#maxicode-iso-16023" id="toc-maxicode-iso-16023">6.6.7 +MaxiCode (ISO 16023)</a></li> +<li><a href="#aztec-code-iso-24778" id="toc-aztec-code-iso-24778">6.6.8 +Aztec Code (ISO 24778)</a></li> +<li><a href="#aztec-runes-iso-24778" +id="toc-aztec-runes-iso-24778">6.6.9 Aztec Runes (ISO 24778)</a></li> +<li><a href="#code-one" id="toc-code-one">6.6.10 Code One</a></li> +<li><a href="#grid-matrix" id="toc-grid-matrix">6.6.11 Grid +Matrix</a></li> +<li><a href="#dotcode" id="toc-dotcode">6.6.12 DotCode</a></li> +<li><a href="#han-xin-code-iso-20830" +id="toc-han-xin-code-iso-20830">6.6.13 Han Xin Code (ISO 20830)</a></li> +<li><a href="#ultracode" id="toc-ultracode">6.6.14 Ultracode</a></li> +</ul></li> +<li><a href="#other-barcode-like-markings" +id="toc-other-barcode-like-markings">6.7 Other Barcode-Like Markings</a> +<ul> +<li><a href="#facing-identification-mark-fim" +id="toc-facing-identification-mark-fim">6.7.1 Facing Identification Mark +(FIM)</a></li> +<li><a href="#flattermarken" id="toc-flattermarken">6.7.2 +Flattermarken</a></li> +</ul></li> +</ul></li> +<li><a href="#legal-and-version-information" +id="toc-legal-and-version-information">7. Legal and Version +Information</a> +<ul> +<li><a href="#license" id="toc-license">7.1 License</a></li> +<li><a href="#patent-issues" id="toc-patent-issues">7.2 Patent +Issues</a></li> +<li><a href="#version-information" id="toc-version-information">7.3 +Version Information</a></li> +<li><a href="#sources-of-information" +id="toc-sources-of-information">7.4 Sources of Information</a></li> +<li><a href="#standards-compliance" id="toc-standards-compliance">7.5 +Standards Compliance</a> +<ul> +<li><a href="#symbology-standards" id="toc-symbology-standards">7.5.1 +Symbology Standards</a></li> +<li><a href="#general-standards" id="toc-general-standards">7.5.2 +General Standards</a></li> +</ul></li> +</ul></li> +<li><a href="#annex-a.-character-encoding" +id="toc-annex-a.-character-encoding">Annex A. Character Encoding</a> +<ul> +<li><a href="#a.1-ascii-standard" id="toc-a.1-ascii-standard">A.1 ASCII +Standard</a></li> +<li><a href="#a.2-latin-alphabet-no.-1-isoiec-8859-1" +id="toc-a.2-latin-alphabet-no.-1-isoiec-8859-1">A.2 Latin Alphabet No. 1 +(ISO/IEC 8859-1)</a></li> +</ul></li> +<li><a href="#annex-b.-qt-backend-qzint" +id="toc-annex-b.-qt-backend-qzint">Annex B. Qt Backend QZint</a></li> +<li><a href="#annex-c.-tcl-backend-binding" +id="toc-annex-c.-tcl-backend-binding">Annex C. Tcl Backend +Binding</a></li> +<li><a href="#annex-d.-man-page-zint1" +id="toc-annex-d.-man-page-zint1">Annex D. Man Page ZINT(1)</a><ul> +<li><a href="#name" id="toc-name">NAME</a></li> +<li><a href="#synopsis" id="toc-synopsis">SYNOPSIS</a></li> +<li><a href="#description" id="toc-description">DESCRIPTION</a></li> +<li><a href="#options" id="toc-options">OPTIONS</a></li> +<li><a href="#exit-status" id="toc-exit-status">EXIT STATUS</a></li> +<li><a href="#examples" id="toc-examples">EXAMPLES</a></li> +<li><a href="#bugs" id="toc-bugs">BUGS</a></li> +<li><a href="#see-also" id="toc-see-also">SEE ALSO</a></li> +<li><a href="#conforming-to" id="toc-conforming-to">CONFORMING +TO</a></li> +<li><a href="#copyright" id="toc-copyright">COPYRIGHT</a></li> +<li><a href="#author" id="toc-author">AUTHOR</a></li> +</ul> +</nav> +<h1 id="introduction">1. Introduction</h1> +<p>The Zint project aims to provide a complete cross-platform open +source barcode generating solution. The package currently consists of a +Qt-based GUI, a CLI command line executable and a library with an API to +allow developers access to the capabilities of Zint. It is hoped that +Zint provides a solution which is flexible enough for professional users +while at the same time takes care of as much of the processing as +possible to allow easy translation from input data to barcode image.</p> +<p>The library which forms the main component of the Zint project is +currently able to encode data in over 50 barcode symbologies (types of +barcode), for each of which it is possible to translate that data from +either UTF-8 (Unicode) or a raw 8-bit data stream. The image can be +rendered as a</p> +<ul> +<li>Windows Bitmap (BMP),</li> +<li>Enhanced Metafile Format (EMF),</li> +<li>Encapsulated PostScript (EPS),</li> +<li>Graphics Interchange Format (GIF),</li> +<li>ZSoft Paintbrush (PCX) image,</li> +<li>Portable Network Graphic (PNG) image,</li> +<li>Tagged Image File Format (TIF), or a</li> +<li>Scalable Vector Graphic (SVG).</li> +</ul> +<p>Many options are available for setting the characteristics of the +output image including the size and colour of the image, the amount of +error correction used in the symbol and the orientation of the +image.</p> +<h2 id="glossary">1.1 Glossary</h2> +<p>Some of the words and phrases used in this document are specific to +barcoding, and so a brief explanation is given to help +understanding:</p> +<dl> +<dt>symbol</dt> +<dd> +<p>A symbol is an image which encodes data according to one of the +standards. This encompasses barcodes (linear symbols) as well as any of +the other methods of representing data used in this program.</p> +</dd> +<dt>symbology</dt> +<dd> +<p>A method of encoding data to create a certain type of symbol.</p> +</dd> +<dt>linear</dt> +<dd> +<p>A linear or one-dimensional symbol is one which consists of bars and +spaces, and is what most people associate with the term ‘barcode’. +Examples include Code 128.</p> +</dd> +<dt>stacked</dt> +<dd> +<p>A stacked symbol consists of multiple linear symbols placed one above +another and which together hold the message, usually alongside some +error correction data. Examples include PDF417.</p> +</dd> +<dt>matrix</dt> +<dd> +<p>A matrix symbol is one based on a (usually square) grid of elements +called modules. Examples include Data Matrix, but MaxiCode and DotCode +are also considered matrix symbologies.</p> +</dd> +<dt>composite</dt> +<dd> +<p>A composite symbology is one which is made up of elements which are +both linear and stacked. Those currently supported are made up of a +linear ‘primary’ message above which is printed a stacked component +based on the PDF417 symbology. These symbols also have a separator which +separates the linear and the stacked components. The stacked component +is most often referred to as the 2D (two-dimensional) component.</p> +</dd> +<dt>X-dimension</dt> +<dd> +<p>The X-dimension of a symbol is the size (usually the width) of the +smallest element. For a linear symbology this is the width of the +smallest bar. For matrix symbologies it is the width of the smallest +module (usually a square). Barcode widths and heights are expressed in +X-dimensions. Most linear symbologies can have their height varied +whereas most matrix symbologies have a fixed width-to-height ratio where +the height is determined by the width.</p> +</dd> +<dt>GS1 data</dt> +<dd> +<p>This is a structured way of representing information which consists +of ‘chunks’ of data, each of which starts with an Application Identifier +(AI). The AI identifies what type of information is being encoded.</p> +</dd> +<dt>Reader Initialisation (Programming)</dt> +<dd> +<p>Some symbologies allow a special character to be included which can +be detected by the scanning equipment as signifying that the data is +used to program or change settings in that equipment. This data is +usually not passed on to the software which handles normal input data. +This feature should only be used if you are familiar with the +programming codes relevant to your scanner.</p> +</dd> +<dt>ECI</dt> +<dd> +<p>The Extended Channel Interpretations (ECI) mechanism allows for +multi-language data to be encoded in symbols which would usually support +only Latin-1 (ISO/IEC 8859-1 plus ASCII) characters. This can be useful, +for example, if you need to encode Cyrillic characters, but should be +used with caution as not all scanners support this method.</p> +</dd> +</dl> +<p>Two other concepts that are important are raster and vector.</p> +<dl> +<dt>raster</dt> +<dd> +<p>A low level bitmap representation of an image. BMP, GIF, PCX, PNG and +TIF are raster file formats.</p> +</dd> +<dt>vector</dt> +<dd> +<p>A high level command- or data-based representation of an image. EMF, +EPS and SVG are vector file formats. They require renderers to turn them +into bitmaps.</p> +</dd> +</dl> +<h1 id="installing-zint">2. Installing Zint</h1> +<h2 id="linux">2.1 Linux</h2> +<p>The easiest way to configure compilation is to take advantage of the +CMake utilities. You will need to install CMake and +<code>libpng-dev</code> first. For instance on <code>apt</code> +systems:</p> +<div class="sourceCode" id="cb1"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">sudo</span> apt install git cmake build-essential libpng-dev</span></code></pre></div> +<p>If you want to take advantage of Zint Barcode Studio you will also +need to have Qt and its component <code>"Desktop gcc 64-bit"</code> +installed, as well as <code>mesa</code>. For details see +<code>"README.linux"</code> in the project root directory.</p> +<p>Once you have fulfilled these requirements unzip the source code +tarball or clone the latest source</p> +<div class="sourceCode" id="cb2"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="fu">git</span> clone https://git.code.sf.net/p/zint/code zint</span></code></pre></div> +<p>and follow these steps in the top directory:</p> +<div class="sourceCode" id="cb3"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="fu">mkdir</span> build</span> +<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a><span class="bu">cd</span> build</span> +<span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a><span class="fu">cmake</span> ..</span> +<span id="cb3-4"><a href="#cb3-4" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></span> +<span id="cb3-5"><a href="#cb3-5" aria-hidden="true" tabindex="-1"></a><span class="fu">sudo</span> make install</span></code></pre></div> +<p>The CLI command line program can be accessed by typing</p> +<div class="sourceCode" id="cb4"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="pp">[</span><span class="ss">options</span><span class="pp">]</span></span></code></pre></div> +<p>The GUI can be accessed by typing</p> +<div class="sourceCode" id="cb5"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint-qt</span></span></code></pre></div> +<p>To test that the installation has been successful a shell script is +included in the <code>"frontend"</code> sub-directory. To run the test +type</p> +<div class="sourceCode" id="cb6"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a><span class="ex">./test.sh</span></span></code></pre></div> +<p>This should create numerous files in the sub-directory +<code>"frontend/test_sh_out"</code> showing the many modes of operation +which are available from Zint.</p> +<h2 id="bsd">2.2 BSD</h2> +<p>The latest Zint CLI, <code>libzint</code> library and GUI can be +installed from the <code>zint</code> package on FreeBSD:</p> +<div class="sourceCode" id="cb7"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a><span class="fu">su</span></span> +<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a><span class="ex">pkg</span> install zint</span> +<span id="cb7-3"><a href="#cb7-3" aria-hidden="true" tabindex="-1"></a><span class="bu">exit</span></span></code></pre></div> +<p>and on OpenBSD (where the GUI is in a separate <code>zint-gui</code> +package):</p> +<div class="sourceCode" id="cb8"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a><span class="fu">su</span></span> +<span id="cb8-2"><a href="#cb8-2" aria-hidden="true" tabindex="-1"></a><span class="ex">pkg_add</span> zint zint-gui</span> +<span id="cb8-3"><a href="#cb8-3" aria-hidden="true" tabindex="-1"></a><span class="bu">exit</span></span></code></pre></div> +<p>To build from source (including for NetBSD) see +<code>"README.bsd"</code> in the project root directory.</p> +<h2 id="microsoft-windows">2.3 Microsoft Windows</h2> +<p>For Microsoft Windows, Zint is distributed as a binary executable. +Simply download the ZIP file, then right-click on the ZIP file and +<code>"Extract All"</code>. A new folder will be created within which +are two binary files:</p> +<ul> +<li><code>qtZint.exe</code> - Zint Barcode Studio</li> +<li><code>zint.exe</code> - Command Line Interface</li> +</ul> +<p>For fresh releases you will get a warning message from Microsoft +Defender SmartScreen that this is an ‘unrecognised app’. This happens +because Zint is a free and open-source software project with no +advertising and hence no income, meaning we are not able to afford the +$664 per year to have the application digitally signed by Microsoft.</p> +<p>To build Zint on Windows from source, see +<code>"win32/README"</code>.</p> +<h2 id="apple-macos">2.4 Apple macOS</h2> +<p>The latest Zint CLI and <code>libzint</code> can be installed using +Homebrew.<a href="#fn1" class="footnote-ref" id="fnref1" +role="doc-noteref"><sup>1</sup></a> To install Homebrew input the +following line into the macOS terminal</p> +<div class="sourceCode" id="cb9"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a><span class="ex">/bin/bash</span> <span class="at">-c</span> <span class="st">"</span><span class="va">$(</span><span class="ex">curl</span> <span class="at">-fsSL</span> <span class="dt">\</span></span> +<span id="cb9-2"><a href="#cb9-2" aria-hidden="true" tabindex="-1"></a> https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh<span class="va">)</span><span class="st">"</span></span></code></pre></div> +<p>Once Homebrew is installed use the following command to install the +CLI and library</p> +<div class="sourceCode" id="cb10"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a><span class="ex">brew</span> install zint</span></code></pre></div> +<p>To build from source (and install the GUI) see +<code>"README.macos"</code> in the project root directory.</p> +<h2 id="zint-tcl-backend">2.5 Zint Tcl Backend</h2> +<p>The Tcl backend in the <code>"backend_tcl"</code> sub-directory may +be built using the provided TEA (Tcl Extension Architecture) build on +Linux, Windows, macOS and Android. For Windows, an MSVC6 makefile is +also available. See <a href="#annex-c.-tcl-backend-binding">Annex C. Tcl +Backend Binding</a> for further details.</p> +<h1 id="using-zint-barcode-studio">3. Using Zint Barcode Studio</h1> +<p>Zint Barcode Studio is the graphical user interface for Zint. If you +are starting from a command line interface you can start the GUI by +typing</p> +<div class="sourceCode" id="cb11"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint-qt</span></span></code></pre></div> +<p>or on Windows</p> +<div class="sourceCode" id="cb12"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb12-1"><a href="#cb12-1" aria-hidden="true" tabindex="-1"></a><span class="ex">qtZint.exe</span></span></code></pre></div> +<p>See the note in section <a href="#microsoft-windows">2.3 Microsoft +Windows</a> about Microsoft Defender SmartScreen.</p> +<p>Below is a brief guide to Zint Barcode Studio.</p> +<h2 id="main-window-and-data-tab">3.1 Main Window and Data Tab</h2> +<figure> +<img src="images/gui_main.png" title="fig:" class="win" +alt="Zint Barcode Studio on startup - main window with Data tab" /> +<figcaption aria-hidden="true">Zint Barcode Studio on startup - main +window with Data tab</figcaption> +</figure> +<p>This is the main window of Zint Barcode Studio. The top of the window +shows a preview of the barcode that the current settings would create. +These settings can be changed using the controls below. The text box in +the <code>"Data to Encode"</code> groupbox on this first Data tab allows +you to enter the data to be encoded. When you are happy with your +settings you can use the <code>"Save..."</code> button to save the +resulting image to a file.</p> +<p>The <code>"Symbology"</code> drop-down box gives access to all of the +symbologies supported by Zint shown in alphabetical order. The text box +to its right can filter the drop-down to only show matching symbologies. +For instance typing <code>"mail"</code> will only show barcodes in the +drop-down whose names contain the word <code>"mail"</code>. Each word +entered will match. So typing <code>"mail post"</code> will show +barcodes whose names contain <code>"mail"</code> or <code>"post"</code> +(or both).</p> +<p>The ellipsis button <code>"..."</code> to the right of the data text +box invokes the Data Dialog - see <a href="#data-dialog">3.7 Data +Dialog</a> for details. The delete button <img +src="images/gui_delete.png" class="btn" alt="delete" /> next to it will +clear the data text box and the ECI (Extended Channel Interpretations) +drop-down if set.</p> +<p>To set the barcode as a Programming Initialisation symbol click the +<code>"Reader Init"</code> checkbox. The <code>"1234.."</code> button to +its right invokes the Sequence Dialog - see <a +href="#sequence-dialog">3.8 Sequence Dialog</a>. The zap button <img +src="images/gui_zap.png" class="btn" alt="zap" /> will clear all data +and reset all settings for the barcode to defaults.</p> +<p>The <code>"BMP"</code> and <code>"SVG"</code> buttons at the bottom +will copy the image to the clipboard in BMP format and SVG format +respectively. Further copy-to-clipboard formats are available by +clicking the <code>"Menu"</code> button, along with +<code>"CLI Equivalent..."</code>, <code>"Save As..."</code>, +<code>"Factory Reset..."</code>, <code>"Help"</code>, +<code>"About..."</code> and <code>"Quit"</code> options. Most of the +options are also available in a context menu by right-clicking the +preview.</p> +<figure> +<img src="images/gui_menus.png" title="fig:" class="win" +alt="Zint Barcode Studio main menu (left) and context menu (right)" /> +<figcaption aria-hidden="true">Zint Barcode Studio main menu (left) and +context menu (right)</figcaption> +</figure> +<h2 id="gs1-composite-groupbox">3.2 GS1 Composite Groupbox</h2> +<figure> +<img src="images/gui_composite.png" title="fig:" class="win" +alt="Zint Barcode Studio encoding GS1 Composite data" /> +<figcaption aria-hidden="true">Zint Barcode Studio encoding GS1 +Composite data</figcaption> +</figure> +<p>In the middle of the Data tab is an area for creating composite +symbologies which appears when the currently selected symbology is +supported by the GS1 Composite symbology standard. GS1 data can then be +entered with square brackets used to separate Application Identifier +(AI) information from data as shown here. For details, see <a +href="#gs1-composite-symbols-iso-24723">6.3 GS1 Composite Symbols (ISO +24723)</a>.</p> +<h2 id="additional-ecidata-segments-groupbox">3.3 Additional ECI/Data +Segments Groupbox</h2> +<figure> +<img src="images/gui_segs.png" title="fig:" class="win" +alt="Zint Barcode Studio encoding multiple segments" /> +<figcaption aria-hidden="true">Zint Barcode Studio encoding multiple +segments</figcaption> +</figure> +<p>For symbologies that support ECIs (Extended Channel Interpretations) +the middle of the Data tab is an area for entering additional data +segments with their own ECIs. Up to 4 segments (including the main +<code>"Data to Encode"</code> as segment 0) may be specified. See <a +href="#multiple-segments">4.16 Multiple Segments</a> for details.</p> +<h2 id="symbology-specific-groupbox">3.4 Symbology-specific +Groupbox</h2> +<figure> +<img src="images/gui_c25inter.png" title="fig:" class="win" +alt="Zint Barcode Studio showing Code 2 of 5 Interleaved settings" /> +<figcaption aria-hidden="true">Zint Barcode Studio showing Code 2 of 5 +Interleaved settings</figcaption> +</figure> +<p>Many symbologies have extra options to change the content, format and +appearance of the symbol generated. For those with few additional +options (and no support for GS1 data or ECIs), the middle of the Data +tab is an area for setting those options.</p> +<p>Here is shown the check digit options for an Interleaved Code 2 of 5 +symbol (see <a href="#interleaved-code-2-of-5-iso-16390">6.1.2.4 +Interleaved Code 2 of 5 (ISO 16390)</a>).</p> +<p>Symbologies with more than a few options (or support for GS1 data or +ECIs) have a second Symbology-specific tab, shown next.</p> +<h2 id="symbology-specific-tab">3.5 Symbology-specific Tab</h2> +<figure> +<img src="images/gui_aztec.png" title="fig:" class="win" +alt="Zint Barcode Studio showing Aztec Code options" /> +<figcaption aria-hidden="true">Zint Barcode Studio showing Aztec Code +options</figcaption> +</figure> +<p>A second tab appears for those symbologies with more than a few extra +options.</p> +<p>Here is shown the options available for an Aztec Code symbol.</p> +<p>You can adjust its size or error correction level (see <a +href="#aztec-code-iso-24778">6.6.8 Aztec Code (ISO 24778)</a>), select +how its data is to be treated (see <a href="#input-modes">4.11 Input +Modes</a>), and set it as part of a Structured Append sequence of +symbols (see <a href="#structured-append">4.17 Structured +Append</a>).</p> +<h2 id="appearance-tab">3.6 Appearance Tab</h2> +<figure> +<img src="images/gui_appearance.png" title="fig:" class="win" +alt="Zint Barcode Studio showing Appearance tab options" /> +<figcaption aria-hidden="true">Zint Barcode Studio showing Appearance +tab options</figcaption> +</figure> +<p>The Appearance tab can be used to adjust the dimensions and other +properties of the symbol.</p> +<p>The <code>"Height"</code> value affects the height of symbologies +which do not have a fixed width-to-height ratio, i.e. those other than +matrix symbologies. For such symbologies the +<code>"Automatic Height"</code> checkbox will be enabled - uncheck this +to manually adjust the height. The <code>"Compliant Height"</code> +checkbox applies to symbologies that define a standard height - see <a +href="#adjusting-height">4.4 Adjusting Height</a>.</p> +<p>Boundary bars can be added with the <code>"Border Type"</code> +drop-down and their size adjusted with <code>"Border Width"</code>, and +whitespace can be adjusted both horizontally (first spinbox) and +vertically (second spinbox), and also through the +<code>"Quiet Zones"</code> checkbox if standard quiet zones are defined +for the symbology.</p> +<p>The size of the saved image can be specified with +<code>"Printing Scale"</code>, and also by clicking the <img +src="images/gui_scaling.png" class="btn" alt="scaling" /> icon to invoke +the Set Printing Scale Dialog - see <a +href="#adjusting-image-size-x-dimension">4.9 Adjusting Image Size +(X-dimension)</a> for further details.</p> +<figure> +<img src="images/gui_set_printing_scale.png" title="fig:" class="pop" +alt="Adjusting the Print Size" /> +<figcaption aria-hidden="true">Adjusting the Print Size</figcaption> +</figure> +<p>The foreground and background colours can be set either using the +text boxes which accept <code>"RRGGBBAA"</code> hexadecimal values and +<code>"C,M,Y,K"</code> decimal percentage values, or by clicking the +foreground eye <img src="images/gui_black_eye.png" class="btn" +alt="eye" /> and background eye <img src="images/gui_white_eye.png" +class="btn" alt="eye" /> buttons which invoke a colour picker.</p> +<figure> +<img src="images/gui_colour.png" title="fig:" class="pop" +alt="The colour picker tool" /> +<figcaption aria-hidden="true">The colour picker tool</figcaption> +</figure> +<p>(Note that to change the colours visually, the luminence slider, the +long narrow column on the right, must be adjusted.) The color picker +only deals in RGB(A), and will overwrite any CMYK values with RGB(A) +values once <code>"OK"</code> is selected.</p> +<p>Back in the Appearance tab, the colours can be reset to +black-on-white using the <code>"Reset"</code> button, and exchanged one +for the other using the swap <img src="images/gui_swap.png" class="btn" +alt="swap" /> button next to it.</p> +<h2 id="data-dialog">3.7 Data Dialog</h2> +<figure> +<img src="images/gui_data_dialog.png" title="fig:" class="pop" +alt="Entering longer text input" /> +<figcaption aria-hidden="true">Entering longer text input</figcaption> +</figure> +<p>Clicking on the ellipsis <code>"..."</code> button next to the +<code>"Data to Encode"</code> text box in the Data tab opens a larger +window which can be used to enter longer strings of text. You can also +use this window to load data from a file.</p> +<p>The dialog is also available for additional ECI/Data segments by +clicking the ellipsis button to the right of their data text boxes.</p> +<p>Note that if your data contains line feeds (<code>LF</code>) then the +data will be split into separate lines in the dialog box. On saving the +data back to the main text box any separate lines in the data will be +escaped as <code>'\n'</code> and the <code>"Parse Escapes"</code> +checkbox will be set. This only affects line feeds, not carriage returns +(<code>CR</code>) or <code>CR+LF</code> pairs, and behaves the same on +both Windows and Unix. (For details on escape sequences, see <a +href="#inputting-data">4.1 Inputting Data</a>.)</p> +<h2 id="sequence-dialog">3.8 Sequence Dialog</h2> +<figure> +<img src="images/gui_sequence.png" title="fig:" class="pop" +alt="Creating a sequence of barcode symbols" /> +<figcaption aria-hidden="true">Creating a sequence of barcode +symbols</figcaption> +</figure> +<p>Clicking on the sequence button (labelled <code>"1234.."</code>) in +the Data tab opens the Sequence Dialog. This allows you to create +multiple barcode images by entering a sequence of data inputs in the +right hand panel. Sequences can also be automatically generated by +entering parameters on the left hand side or by importing the data from +a file. Zint will generate a separate barcode image for each line of +text in the right hand panel. The format field determines the format of +the automatically generated sequence where characters have the meanings +as given below:</p> +<div id="tbl:sequence_format_characters" class="tablenos"> +<table id="tbl:sequence_format_characters" +data-tag=": Sequence Format Characters"> +<caption><span>Table : Sequence Format Characters</span> </caption> +<thead> +<tr> +<th style="text-align: left;">Character</th> +<th style="text-align: left;">Effect</th> +</tr> +</thead> +<tbody> +<tr> +<td style="text-align: left;"><code>$</code></td> +<td style="text-align: left;">Insert leading zeroes</td> +</tr> +<tr> +<td style="text-align: left;"><code>#</code></td> +<td style="text-align: left;">Insert leading spaces</td> +</tr> +<tr> +<td style="text-align: left;"><code>*</code></td> +<td style="text-align: left;">Insert leading asterisks</td> +</tr> +<tr> +<td style="text-align: left;">Any other character</td> +<td style="text-align: left;">Interpreted literally</td> +</tr> +</tbody> +</table> +</div> +<p>Once you’re happy with the Sequence Data, click the +<code>"Export..."</code> button to bring up the Export Dialog, discussed +next.</p> +<h2 id="export-dialog">3.9 Export Dialog</h2> +<figure> +<img src="images/gui_export.png" title="fig:" class="pop" +alt="Setting filenames for an exported sequence of barcode symbols" /> +<figcaption aria-hidden="true">Setting filenames for an exported +sequence of barcode symbols</figcaption> +</figure> +<p>The Export Dialog invoked by pressing the <code>"Export..."</code> +button in the Sequence Dialog sets the parameters for exporting the +sequence of barcode images. Here you can set the output directory, the +format of the output filenames and what their image type will be. Note +that the symbology, colour and other formatting information are taken +from the main window.</p> +<h2 id="cli-equivalent-dialog">3.10 CLI Equivalent Dialog</h2> +<figure> +<img src="images/gui_cli_equivalent.png" title="fig:" class="pop" +alt="CLI Equivalent Dialog" /> +<figcaption aria-hidden="true">CLI Equivalent Dialog</figcaption> +</figure> +<p>The CLI Equivalent Dialog can be invoked from the main menu or the +context menu and displays the CLI command that will reproduce the +barcode as currently configured in the GUI. Press the +<code>"Copy"</code> button to copy the command to the clipboard, which +can then be pasted into the command line.</p> +<h1 id="using-the-command-line">4. Using the Command Line</h1> +<p>This section describes how to encode data using the command line +frontend (CLI) program. The examples given are for the Unix platform, +but the same options are available for Windows - just remember to +include the executable file extension if <code>".EXE"</code> is not in +your <code>PATHEXT</code> environment variable, i.e.:</p> +<div class="sourceCode" id="cb13"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb13-1"><a href="#cb13-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint.exe</span> <span class="at">-d</span> <span class="st">"This Text"</span></span></code></pre></div> +<p>For compatibility with Windows the examples use double quotes to +delimit data, though on Unix single quotes are generally preferable as +they stop the shell from processing any characters such as backslash or +dollar. A single quote itself is dealt with by terminating the +single-quoted text, backslashing the single quote, and then +continuing:</p> +<div class="sourceCode" id="cb14"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb14-1"><a href="#cb14-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-d</span> <span class="st">'Text containing a single quote '</span><span class="dt">\'</span><span class="st">' in the middle'</span></span></code></pre></div> +<p>Some examples use backslash (<code>\</code>) to continue commands +onto the next line. For Windows, use caret (<code>^</code>) instead.</p> +<p>Certain options that take values have short names as well as long +ones, namely <code>-b</code> (<code>--barcode</code>), <code>-d</code> +(<code>--data</code>), <code>-i</code> (<code>--input</code>), +<code>-o</code> (<code>--output</code>) and <code>-w</code> +(<code>--whitesp</code>). For these a space should be used to separate +the short name from its value, to avoid ambiguity. For long names a +space or an equals sign may be used. For instance:</p> +<div class="sourceCode" id="cb15"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb15-1"><a href="#cb15-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-d</span> <span class="st">"This Text"</span></span> +<span id="cb15-2"><a href="#cb15-2" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">--data</span><span class="op">=</span><span class="st">"This Text"</span></span> +<span id="cb15-3"><a href="#cb15-3" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">--data</span> <span class="st">"This Text"</span></span></code></pre></div> +<p>The examples use a space separator for short option names, and an +equals sign for long option names.</p> +<h2 id="inputting-data">4.1 Inputting Data</h2> +<p>The data to encode can be entered at the command line using the +<code>-d</code> or <code>--data</code> option, for example</p> +<div class="sourceCode" id="cb16"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb16-1"><a href="#cb16-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-d</span> <span class="st">"This Text"</span></span></code></pre></div> +<p>This will encode the text <code>"This Text"</code>. Zint will use the +default symbology, Code 128, and output to the default file +<code>"out.png"</code> in the current directory. Alternatively, if +<code>libpng</code> was not present when Zint was built, the default +output file will be <code>"out.gif"</code>.</p> +<p>The data input to the Zint CLI is assumed to be encoded in UTF-8 +(Unicode) format (Zint will correctly handle UTF-8 data on Windows). If +you are encoding characters beyond the 7-bit ASCII set using a scheme +other than UTF-8 then you will need to set the appropriate input options +as shown in <a href="#input-modes">4.11 Input Modes</a> below.</p> +<p>Non-printing characters can be entered on the command line using +backslash (<code>\</code>) as an escape character in combination with +the <code>--esc</code> switch. Permissible sequences are shown in the +table below.</p> +<div id="tbl:escape_sequences" class="tablenos"> +<table id="tbl:escape_sequences" data-tag=": Escape Sequences"> +<caption><span>Table : Escape Sequences</span> </caption> +<colgroup> +<col style="width: 15%" /> +<col style="width: 15%" /> +<col style="width: 10%" /> +<col style="width: 57%" /> +</colgroup> +<thead> +<tr> +<th style="text-align: left;">Escape Sequence</th> +<th style="text-align: left;">ASCII Equivalent</th> +<th style="text-align: left;">Name</th> +<th style="text-align: left;">Interpretation</th> +</tr> +</thead> +<tbody> +<tr> +<td style="text-align: left;"><code>\0</code></td> +<td style="text-align: left;">0x00</td> +<td style="text-align: left;"><code>NUL</code></td> +<td style="text-align: left;">Null character</td> +</tr> +<tr> +<td style="text-align: left;"><code>\E</code></td> +<td style="text-align: left;">0x04</td> +<td style="text-align: left;"><code>EOT</code></td> +<td style="text-align: left;">End of Transmission</td> +</tr> +<tr> +<td style="text-align: left;"><code>\a</code></td> +<td style="text-align: left;">0x07</td> +<td style="text-align: left;"><code>BEL</code></td> +<td style="text-align: left;">Bell</td> +</tr> +<tr> +<td style="text-align: left;"><code>\b</code></td> +<td style="text-align: left;">0x08</td> +<td style="text-align: left;"><code>BS</code></td> +<td style="text-align: left;">Backspace</td> +</tr> +<tr> +<td style="text-align: left;"><code>\t</code></td> +<td style="text-align: left;">0x09</td> +<td style="text-align: left;"><code>HT</code></td> +<td style="text-align: left;">Horizontal Tab</td> +</tr> +<tr> +<td style="text-align: left;"><code>\n</code></td> +<td style="text-align: left;">0x0A</td> +<td style="text-align: left;"><code>LF</code></td> +<td style="text-align: left;">Line Feed</td> +</tr> +<tr> +<td style="text-align: left;"><code>\v</code></td> +<td style="text-align: left;">0x0B</td> +<td style="text-align: left;"><code>VT</code></td> +<td style="text-align: left;">Vertical Tab</td> +</tr> +<tr> +<td style="text-align: left;"><code>\f</code></td> +<td style="text-align: left;">0x0C</td> +<td style="text-align: left;"><code>FF</code></td> +<td style="text-align: left;">Form Feed</td> +</tr> +<tr> +<td style="text-align: left;"><code>\r</code></td> +<td style="text-align: left;">0x0D</td> +<td style="text-align: left;"><code>CR</code></td> +<td style="text-align: left;">Carriage Return</td> +</tr> +<tr> +<td style="text-align: left;"><code>\e</code></td> +<td style="text-align: left;">0x1B</td> +<td style="text-align: left;"><code>ESC</code></td> +<td style="text-align: left;">Escape</td> +</tr> +<tr> +<td style="text-align: left;"><code>\G</code></td> +<td style="text-align: left;">0x1D</td> +<td style="text-align: left;"><code>GS</code></td> +<td style="text-align: left;">Group Separator</td> +</tr> +<tr> +<td style="text-align: left;"><code>\R</code></td> +<td style="text-align: left;">0x1E</td> +<td style="text-align: left;"><code>RS</code></td> +<td style="text-align: left;">Record Separator</td> +</tr> +<tr> +<td style="text-align: left;"><code>\\</code></td> +<td style="text-align: left;">0x5C</td> +<td style="text-align: left;"><code>\</code></td> +<td style="text-align: left;">Backslash</td> +</tr> +<tr> +<td style="text-align: left;"><code>\dNNN</code></td> +<td style="text-align: left;">NNN</td> +<td style="text-align: left;"></td> +<td style="text-align: left;">Any 8-bit character where NNN is decimal +(000-255)</td> +</tr> +<tr> +<td style="text-align: left;"><code>\oNNN</code></td> +<td style="text-align: left;">0oNNN</td> +<td style="text-align: left;"></td> +<td style="text-align: left;">Any 8-bit character where NNN is octal +(000-377)</td> +</tr> +<tr> +<td style="text-align: left;"><code>\xNN</code></td> +<td style="text-align: left;">0xNN</td> +<td style="text-align: left;"></td> +<td style="text-align: left;">Any 8-bit character where NN is +hexadecimal (00-FF)</td> +</tr> +<tr> +<td style="text-align: left;"><code>\uNNNN</code></td> +<td style="text-align: left;"></td> +<td style="text-align: left;"></td> +<td style="text-align: left;">Any 16-bit Unicode BMP<a href="#fn2" +class="footnote-ref" id="fnref2" role="doc-noteref"><sup>2</sup></a> +character where NNNN is hexadecimal (0000-FFFF)</td> +</tr> +<tr> +<td style="text-align: left;"><code>\UNNNNNN</code></td> +<td style="text-align: left;"></td> +<td style="text-align: left;"></td> +<td style="text-align: left;">Any 21-bit Unicode character where NNNNNN +is hexadecimal (000000-10FFFF)</td> +</tr> +</tbody> +</table> +</div> +<p>(Special escape sequences are available for Code 128 only to manually +switch Code Sets and insert special FNC1 characters - see <a +href="#standard-code-128-iso-15417">6.1.10.1 Standard Code 128 (ISO +15417)</a> for details.)</p> +<p>Input data can be read directly from file using the <code>-i</code> +or <code>--input</code> switch as shown below. The input file is assumed +to be UTF-8 formatted unless an alternative mode is selected. This +option replaces the use of the <code>-d</code> switch.</p> +<div class="sourceCode" id="cb17"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb17-1"><a href="#cb17-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-i</span> somefile.txt</span></code></pre></div> +<p>To read from stdin specify a single hyphen <code>"-"</code> as the +input file.</p> +<p>Note that except when batch processing (see <a +href="#batch-processing">4.12 Batch Processing</a> below), the file (or +stdin) should not end with a newline (<code>LF</code> on Unix, +<code>CR+LF</code> on Windows) unless you want the newline to be encoded +in the symbol.</p> +<h2 id="directing-output">4.2 Directing Output</h2> +<p>Output can be directed to a file other than the default using the +<code>-o</code> or <code>--output</code> switch. For example:</p> +<div class="sourceCode" id="cb18"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb18-1"><a href="#cb18-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-o</span> here.png <span class="at">-d</span> <span class="st">"This Text"</span></span></code></pre></div> +<p>This draws a Code 128 barcode in the file <code>"here.png"</code>. If +an Encapsulated PostScript file is needed simply append the filename +with <code>".eps"</code>, and so on for the other supported file +types:</p> +<div class="sourceCode" id="cb19"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb19-1"><a href="#cb19-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-o</span> there.eps <span class="at">-d</span> <span class="st">"This Text"</span></span></code></pre></div> +<p>The currently supported output file formats are shown in the +following table.</p> +<div id="tbl:output_file_formats" class="tablenos"> +<table id="tbl:output_file_formats" data-tag=": Output File Formats"> +<caption><span>Table : Output File Formats</span> </caption> +<thead> +<tr> +<th>Extension</th> +<th style="text-align: left;">File format</th> +</tr> +</thead> +<tbody> +<tr> +<td>bmp</td> +<td style="text-align: left;">Windows Bitmap</td> +</tr> +<tr> +<td>emf</td> +<td style="text-align: left;">Enhanced Metafile Format</td> +</tr> +<tr> +<td>eps</td> +<td style="text-align: left;">Encapsulated PostScript</td> +</tr> +<tr> +<td>gif</td> +<td style="text-align: left;">Graphics Interchange Format</td> +</tr> +<tr> +<td>pcx</td> +<td style="text-align: left;">ZSoft Paintbrush image</td> +</tr> +<tr> +<td>png</td> +<td style="text-align: left;">Portable Network Graphic</td> +</tr> +<tr> +<td>svg</td> +<td style="text-align: left;">Scalable Vector Graphic</td> +</tr> +<tr> +<td>tif</td> +<td style="text-align: left;">Tagged Image File Format</td> +</tr> +<tr> +<td>txt</td> +<td style="text-align: left;">Text file (see <a +href="#other-options">4.19 Other Options</a>)</td> +</tr> +</tbody> +</table> +</div> +<p>The filename can contain directories and sub-directories also, which +will be created if they don’t already exist:</p> +<div class="sourceCode" id="cb20"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb20-1"><a href="#cb20-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-o</span> <span class="st">"dir/subdir/filename.eps"</span> <span class="at">-d</span> <span class="st">"This Text"</span></span></code></pre></div> +<p>Note that on Windows, filenames are assumed to be UTF-8 encoded.</p> +<h2 id="selecting-barcode-type">4.3 Selecting Barcode Type</h2> +<p>Selecting which type of barcode you wish to produce (i.e. which +symbology to use) can be done at the command line using the +<code>-b</code> or <code>--barcode</code> switch followed by the +appropriate integer value or name in the following table. For example to +create a Data Matrix symbol you could use:</p> +<div class="sourceCode" id="cb21"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb21-1"><a href="#cb21-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> 71 <span class="at">-o</span> datamatrix.png <span class="at">-d</span> <span class="st">"Data to encode"</span></span></code></pre></div> +<p>or</p> +<div class="sourceCode" id="cb22"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb22-1"><a href="#cb22-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> DATAMATRIX <span class="at">-o</span> datamatrix.png <span class="at">-d</span> <span class="st">"Data to encode"</span></span></code></pre></div> +<p>Names are treated case-insensitively by the CLI, and the +<code>BARCODE_</code> prefix and any underscores are optional.</p> +<div id="tbl:barcode_types" class="tablenos"> +<table id="tbl:barcode_types" data-tag=": Barcode Types (Symbologies)"> +<caption><span>Table : Barcode Types (Symbologies)</span> </caption> +<colgroup> +<col style="width: 11%" /> +<col style="width: 33%" /> +<col style="width: 55%" /> +</colgroup> +<thead> +<tr> +<th style="text-align: left;">Numeric Value</th> +<th style="text-align: left;">Name<a href="#fn3" class="footnote-ref" +id="fnref3" role="doc-noteref"><sup>3</sup></a></th> +<th style="text-align: left;">Barcode Name</th> +</tr> +</thead> +<tbody> +<tr> +<td style="text-align: left;">1</td> +<td style="text-align: left;"><code>BARCODE_CODE11</code></td> +<td style="text-align: left;">Code 11</td> +</tr> +<tr> +<td style="text-align: left;">2<code>*</code></td> +<td style="text-align: left;"><code>BARCODE_C25STANDARD</code></td> +<td style="text-align: left;">Standard Code 2 of 5</td> +</tr> +<tr> +<td style="text-align: left;">3</td> +<td style="text-align: left;"><code>BARCODE_C25INTER</code></td> +<td style="text-align: left;">Interleaved 2 of 5</td> +</tr> +<tr> +<td style="text-align: left;">4</td> +<td style="text-align: left;"><code>BARCODE_C25IATA</code></td> +<td style="text-align: left;">Code 2 of 5 IATA</td> +</tr> +<tr> +<td style="text-align: left;">6</td> +<td style="text-align: left;"><code>BARCODE_C25LOGIC</code></td> +<td style="text-align: left;">Code 2 of 5 Data Logic</td> +</tr> +<tr> +<td style="text-align: left;">7</td> +<td style="text-align: left;"><code>BARCODE_C25IND</code></td> +<td style="text-align: left;">Code 2 of 5 Industrial</td> +</tr> +<tr> +<td style="text-align: left;">8</td> +<td style="text-align: left;"><code>BARCODE_CODE39</code></td> +<td style="text-align: left;">Code 3 of 9 (Code 39)</td> +</tr> +<tr> +<td style="text-align: left;">9</td> +<td style="text-align: left;"><code>BARCODE_EXCODE39</code></td> +<td style="text-align: left;">Extended Code 3 of 9 (Code 39+)</td> +</tr> +<tr> +<td style="text-align: left;">13</td> +<td style="text-align: left;"><code>BARCODE_EANX</code></td> +<td style="text-align: left;">EAN (EAN-2, EAN-5, EAN-8 and EAN-13)</td> +</tr> +<tr> +<td style="text-align: left;">14</td> +<td style="text-align: left;"><code>BARCODE_EANX_CHK</code></td> +<td style="text-align: left;">EAN + Check Digit</td> +</tr> +<tr> +<td style="text-align: left;">16<code>*</code></td> +<td style="text-align: left;"><code>BARCODE_GS1_128</code></td> +<td style="text-align: left;">GS1-128 (UCC.EAN-128)</td> +</tr> +<tr> +<td style="text-align: left;">18</td> +<td style="text-align: left;"><code>BARCODE_CODABAR</code></td> +<td style="text-align: left;">Codabar</td> +</tr> +<tr> +<td style="text-align: left;">20</td> +<td style="text-align: left;"><code>BARCODE_CODE128</code></td> +<td style="text-align: left;">Code 128 (automatic Code Set +switching)</td> +</tr> +<tr> +<td style="text-align: left;">21</td> +<td style="text-align: left;"><code>BARCODE_DPLEIT</code></td> +<td style="text-align: left;">Deutsche Post Leitcode</td> +</tr> +<tr> +<td style="text-align: left;">22</td> +<td style="text-align: left;"><code>BARCODE_DPIDENT</code></td> +<td style="text-align: left;">Deutsche Post Identcode</td> +</tr> +<tr> +<td style="text-align: left;">23</td> +<td style="text-align: left;"><code>BARCODE_CODE16K</code></td> +<td style="text-align: left;">Code 16K</td> +</tr> +<tr> +<td style="text-align: left;">24</td> +<td style="text-align: left;"><code>BARCODE_CODE49</code></td> +<td style="text-align: left;">Code 49</td> +</tr> +<tr> +<td style="text-align: left;">25</td> +<td style="text-align: left;"><code>BARCODE_CODE93</code></td> +<td style="text-align: left;">Code 93</td> +</tr> +<tr> +<td style="text-align: left;">28</td> +<td style="text-align: left;"><code>BARCODE_FLAT</code></td> +<td style="text-align: left;">Flattermarken</td> +</tr> +<tr> +<td style="text-align: left;">29<code>*</code></td> +<td style="text-align: left;"><code>BARCODE_DBAR_OMN</code></td> +<td style="text-align: left;">GS1 DataBar Omnidirectional (including GS1 +DataBar Truncated)</td> +</tr> +<tr> +<td style="text-align: left;">30<code>*</code></td> +<td style="text-align: left;"><code>BARCODE_DBAR_LTD</code></td> +<td style="text-align: left;">GS1 DataBar Limited</td> +</tr> +<tr> +<td style="text-align: left;">31<code>*</code></td> +<td style="text-align: left;"><code>BARCODE_DBAR_EXP</code></td> +<td style="text-align: left;">GS1 DataBar Expanded</td> +</tr> +<tr> +<td style="text-align: left;">32</td> +<td style="text-align: left;"><code>BARCODE_TELEPEN</code></td> +<td style="text-align: left;">Telepen Alpha</td> +</tr> +<tr> +<td style="text-align: left;">34</td> +<td style="text-align: left;"><code>BARCODE_UPCA</code></td> +<td style="text-align: left;">UPC-A</td> +</tr> +<tr> +<td style="text-align: left;">35</td> +<td style="text-align: left;"><code>BARCODE_UPCA_CHK</code></td> +<td style="text-align: left;">UPC-A + Check Digit</td> +</tr> +<tr> +<td style="text-align: left;">37</td> +<td style="text-align: left;"><code>BARCODE_UPCE</code></td> +<td style="text-align: left;">UPC-E</td> +</tr> +<tr> +<td style="text-align: left;">38</td> +<td style="text-align: left;"><code>BARCODE_UPCE_CHK</code></td> +<td style="text-align: left;">UPC-E + Check Digit</td> +</tr> +<tr> +<td style="text-align: left;">40</td> +<td style="text-align: left;"><code>BARCODE_POSTNET</code></td> +<td style="text-align: left;">POSTNET</td> +</tr> +<tr> +<td style="text-align: left;">47</td> +<td style="text-align: left;"><code>BARCODE_MSI_PLESSEY</code></td> +<td style="text-align: left;">MSI Plessey</td> +</tr> +<tr> +<td style="text-align: left;">49</td> +<td style="text-align: left;"><code>BARCODE_FIM</code></td> +<td style="text-align: left;">FIM</td> +</tr> +<tr> +<td style="text-align: left;">50</td> +<td style="text-align: left;"><code>BARCODE_LOGMARS</code></td> +<td style="text-align: left;">LOGMARS</td> +</tr> +<tr> +<td style="text-align: left;">51</td> +<td style="text-align: left;"><code>BARCODE_PHARMA</code></td> +<td style="text-align: left;">Pharmacode One-Track</td> +</tr> +<tr> +<td style="text-align: left;">52</td> +<td style="text-align: left;"><code>BARCODE_PZN</code></td> +<td style="text-align: left;">PZN</td> +</tr> +<tr> +<td style="text-align: left;">53</td> +<td style="text-align: left;"><code>BARCODE_PHARMA_TWO</code></td> +<td style="text-align: left;">Pharmacode Two-Track</td> +</tr> +<tr> +<td style="text-align: left;">54</td> +<td style="text-align: left;"><code>BARCODE_CEPNET</code></td> +<td style="text-align: left;">Brazilian CEPNet</td> +</tr> +<tr> +<td style="text-align: left;">55</td> +<td style="text-align: left;"><code>BARCODE_PDF417</code></td> +<td style="text-align: left;">PDF417</td> +</tr> +<tr> +<td style="text-align: left;">56<code>*</code></td> +<td style="text-align: left;"><code>BARCODE_PDF417COMP</code></td> +<td style="text-align: left;">Compact PDF417 (Truncated PDF417)</td> +</tr> +<tr> +<td style="text-align: left;">57</td> +<td style="text-align: left;"><code>BARCODE_MAXICODE</code></td> +<td style="text-align: left;">MaxiCode</td> +</tr> +<tr> +<td style="text-align: left;">58</td> +<td style="text-align: left;"><code>BARCODE_QRCODE</code></td> +<td style="text-align: left;">QR Code</td> +</tr> +<tr> +<td style="text-align: left;">60</td> +<td style="text-align: left;"><code>BARCODE_CODE128AB</code></td> +<td style="text-align: left;">Code 128 (Suppress Code Set C)</td> +</tr> +<tr> +<td style="text-align: left;">63</td> +<td style="text-align: left;"><code>BARCODE_AUSPOST</code></td> +<td style="text-align: left;">Australia Post Standard Customer</td> +</tr> +<tr> +<td style="text-align: left;">66</td> +<td style="text-align: left;"><code>BARCODE_AUSREPLY</code></td> +<td style="text-align: left;">Australia Post Reply Paid</td> +</tr> +<tr> +<td style="text-align: left;">67</td> +<td style="text-align: left;"><code>BARCODE_AUSROUTE</code></td> +<td style="text-align: left;">Australia Post Routing</td> +</tr> +<tr> +<td style="text-align: left;">68</td> +<td style="text-align: left;"><code>BARCODE_AUSDIRECT</code></td> +<td style="text-align: left;">Australia Post Redirection</td> +</tr> +<tr> +<td style="text-align: left;">69</td> +<td style="text-align: left;"><code>BARCODE_ISBNX</code></td> +<td style="text-align: left;">ISBN (EAN-13 with verification stage)</td> +</tr> +<tr> +<td style="text-align: left;">70</td> +<td style="text-align: left;"><code>BARCODE_RM4SCC</code></td> +<td style="text-align: left;">Royal Mail 4-State Customer Code +(RM4SCC)</td> +</tr> +<tr> +<td style="text-align: left;">71</td> +<td style="text-align: left;"><code>BARCODE_DATAMATRIX</code></td> +<td style="text-align: left;">Data Matrix (ECC200)</td> +</tr> +<tr> +<td style="text-align: left;">72</td> +<td style="text-align: left;"><code>BARCODE_EAN14</code></td> +<td style="text-align: left;">EAN-14</td> +</tr> +<tr> +<td style="text-align: left;">73</td> +<td style="text-align: left;"><code>BARCODE_VIN</code></td> +<td style="text-align: left;">Vehicle Identification Number</td> +</tr> +<tr> +<td style="text-align: left;">74</td> +<td style="text-align: left;"><code>BARCODE_CODABLOCKF</code></td> +<td style="text-align: left;">Codablock-F</td> +</tr> +<tr> +<td style="text-align: left;">75</td> +<td style="text-align: left;"><code>BARCODE_NVE18</code></td> +<td style="text-align: left;">NVE-18 (SSCC-18)</td> +</tr> +<tr> +<td style="text-align: left;">76</td> +<td style="text-align: left;"><code>BARCODE_JAPANPOST</code></td> +<td style="text-align: left;">Japanese Postal Code</td> +</tr> +<tr> +<td style="text-align: left;">77</td> +<td style="text-align: left;"><code>BARCODE_KOREAPOST</code></td> +<td style="text-align: left;">Korea Post</td> +</tr> +<tr> +<td style="text-align: left;">79<code>*</code></td> +<td style="text-align: left;"><code>BARCODE_DBAR_STK</code></td> +<td style="text-align: left;">GS1 DataBar Stacked</td> +</tr> +<tr> +<td style="text-align: left;">80<code>*</code></td> +<td style="text-align: left;"><code>BARCODE_DBAR_OMNSTK</code></td> +<td style="text-align: left;">GS1 DataBar Stacked Omnidirectional</td> +</tr> +<tr> +<td style="text-align: left;">81<code>*</code></td> +<td style="text-align: left;"><code>BARCODE_DBAR_EXPSTK</code></td> +<td style="text-align: left;">GS1 DataBar Expanded Stacked</td> +</tr> +<tr> +<td style="text-align: left;">82</td> +<td style="text-align: left;"><code>BARCODE_PLANET</code></td> +<td style="text-align: left;">PLANET</td> +</tr> +<tr> +<td style="text-align: left;">84</td> +<td style="text-align: left;"><code>BARCODE_MICROPDF417</code></td> +<td style="text-align: left;">MicroPDF417</td> +</tr> +<tr> +<td style="text-align: left;">85<code>*</code></td> +<td style="text-align: left;"><code>BARCODE_USPS_IMAIL</code></td> +<td style="text-align: left;">USPS Intelligent Mail (OneCode)</td> +</tr> +<tr> +<td style="text-align: left;">86</td> +<td style="text-align: left;"><code>BARCODE_PLESSEY</code></td> +<td style="text-align: left;">UK Plessey</td> +</tr> +<tr> +<td style="text-align: left;">87</td> +<td style="text-align: left;"><code>BARCODE_TELEPEN_NUM</code></td> +<td style="text-align: left;">Telepen Numeric</td> +</tr> +<tr> +<td style="text-align: left;">89</td> +<td style="text-align: left;"><code>BARCODE_ITF14</code></td> +<td style="text-align: left;">ITF-14</td> +</tr> +<tr> +<td style="text-align: left;">90</td> +<td style="text-align: left;"><code>BARCODE_KIX</code></td> +<td style="text-align: left;">Dutch Post KIX Code</td> +</tr> +<tr> +<td style="text-align: left;">92</td> +<td style="text-align: left;"><code>BARCODE_AZTEC</code></td> +<td style="text-align: left;">Aztec Code</td> +</tr> +<tr> +<td style="text-align: left;">93</td> +<td style="text-align: left;"><code>BARCODE_DAFT</code></td> +<td style="text-align: left;">DAFT Code</td> +</tr> +<tr> +<td style="text-align: left;">96</td> +<td style="text-align: left;"><code>BARCODE_DPD</code></td> +<td style="text-align: left;">DPD Code</td> +</tr> +<tr> +<td style="text-align: left;">97</td> +<td style="text-align: left;"><code>BARCODE_MICROQR</code></td> +<td style="text-align: left;">Micro QR Code</td> +</tr> +<tr> +<td style="text-align: left;">98</td> +<td style="text-align: left;"><code>BARCODE_HIBC_128</code></td> +<td style="text-align: left;">HIBC Code 128</td> +</tr> +<tr> +<td style="text-align: left;">99</td> +<td style="text-align: left;"><code>BARCODE_HIBC_39</code></td> +<td style="text-align: left;">HIBC Code 39</td> +</tr> +<tr> +<td style="text-align: left;">102</td> +<td style="text-align: left;"><code>BARCODE_HIBC_DM</code></td> +<td style="text-align: left;">HIBC Data Matrix ECC200</td> +</tr> +<tr> +<td style="text-align: left;">104</td> +<td style="text-align: left;"><code>BARCODE_HIBC_QR</code></td> +<td style="text-align: left;">HIBC QR Code</td> +</tr> +<tr> +<td style="text-align: left;">106</td> +<td style="text-align: left;"><code>BARCODE_HIBC_PDF</code></td> +<td style="text-align: left;">HIBC PDF417</td> +</tr> +<tr> +<td style="text-align: left;">108</td> +<td style="text-align: left;"><code>BARCODE_HIBC_MICPDF</code></td> +<td style="text-align: left;">HIBC MicroPDF417</td> +</tr> +<tr> +<td style="text-align: left;">110</td> +<td style="text-align: left;"><code>BARCODE_HIBC_BLOCKF</code></td> +<td style="text-align: left;">HIBC Codablock-F</td> +</tr> +<tr> +<td style="text-align: left;">112</td> +<td style="text-align: left;"><code>BARCODE_HIBC_AZTEC</code></td> +<td style="text-align: left;">HIBC Aztec Code</td> +</tr> +<tr> +<td style="text-align: left;">115</td> +<td style="text-align: left;"><code>BARCODE_DOTCODE</code></td> +<td style="text-align: left;">DotCode</td> +</tr> +<tr> +<td style="text-align: left;">116</td> +<td style="text-align: left;"><code>BARCODE_HANXIN</code></td> +<td style="text-align: left;">Han Xin (Chinese Sensible) Code</td> +</tr> +<tr> +<td style="text-align: left;">119</td> +<td style="text-align: left;"><code>BARCODE_MAILMARK_2D</code></td> +<td style="text-align: left;">Royal Mail 2D Mailmark (CMDM) (Data +Matrix)</td> +</tr> +<tr> +<td style="text-align: left;">121</td> +<td style="text-align: left;"><code>BARCODE_MAILMARK_4S</code></td> +<td style="text-align: left;">Royal Mail 4-State Mailmark</td> +</tr> +<tr> +<td style="text-align: left;">128</td> +<td style="text-align: left;"><code>BARCODE_AZRUNE</code></td> +<td style="text-align: left;">Aztec Runes</td> +</tr> +<tr> +<td style="text-align: left;">129</td> +<td style="text-align: left;"><code>BARCODE_CODE32</code></td> +<td style="text-align: left;">Code 32</td> +</tr> +<tr> +<td style="text-align: left;">130</td> +<td style="text-align: left;"><code>BARCODE_EANX_CC</code></td> +<td style="text-align: left;">GS1 Composite Symbol with EAN linear +component</td> +</tr> +<tr> +<td style="text-align: left;">131<code>*</code></td> +<td style="text-align: left;"><code>BARCODE_GS1_128_CC</code></td> +<td style="text-align: left;">GS1 Composite Symbol with GS1-128 linear +component</td> +</tr> +<tr> +<td style="text-align: left;">132<code>*</code></td> +<td style="text-align: left;"><code>BARCODE_DBAR_OMN_CC</code></td> +<td style="text-align: left;">GS1 Composite Symbol with GS1 DataBar +Omnidirectional linear component</td> +</tr> +<tr> +<td style="text-align: left;">133<code>*</code></td> +<td style="text-align: left;"><code>BARCODE_DBAR_LTD_CC</code></td> +<td style="text-align: left;">GS1 Composite Symbol with GS1 DataBar +Limited linear component</td> +</tr> +<tr> +<td style="text-align: left;">134<code>*</code></td> +<td style="text-align: left;"><code>BARCODE_DBAR_EXP_CC</code></td> +<td style="text-align: left;">GS1 Composite Symbol with GS1 DataBar +Expanded linear component</td> +</tr> +<tr> +<td style="text-align: left;">135</td> +<td style="text-align: left;"><code>BARCODE_UPCA_CC</code></td> +<td style="text-align: left;">GS1 Composite Symbol with UPC-A linear +component</td> +</tr> +<tr> +<td style="text-align: left;">136</td> +<td style="text-align: left;"><code>BARCODE_UPCE_CC</code></td> +<td style="text-align: left;">GS1 Composite Symbol with UPC-E linear +component</td> +</tr> +<tr> +<td style="text-align: left;">137<code>*</code></td> +<td style="text-align: left;"><code>BARCODE_DBAR_STK_CC</code></td> +<td style="text-align: left;">GS1 Composite Symbol with GS1 DataBar +Stacked component</td> +</tr> +<tr> +<td style="text-align: left;">138<code>*</code></td> +<td style="text-align: left;"><code>BARCODE_DBAR_OMNSTK_CC</code></td> +<td style="text-align: left;">GS1 Composite Symbol with GS1 DataBar +Stacked Omnidirectional component</td> +</tr> +<tr> +<td style="text-align: left;">139<code>*</code></td> +<td style="text-align: left;"><code>BARCODE_DBAR_EXPSTK_CC</code></td> +<td style="text-align: left;">GS1 Composite Symbol with GS1 DataBar +Expanded Stacked component</td> +</tr> +<tr> +<td style="text-align: left;">140</td> +<td style="text-align: left;"><code>BARCODE_CHANNEL</code></td> +<td style="text-align: left;">Channel Code</td> +</tr> +<tr> +<td style="text-align: left;">141</td> +<td style="text-align: left;"><code>BARCODE_CODEONE</code></td> +<td style="text-align: left;">Code One</td> +</tr> +<tr> +<td style="text-align: left;">142</td> +<td style="text-align: left;"><code>BARCODE_GRIDMATRIX</code></td> +<td style="text-align: left;">Grid Matrix</td> +</tr> +<tr> +<td style="text-align: left;">143</td> +<td style="text-align: left;"><code>BARCODE_UPNQR</code></td> +<td style="text-align: left;">UPNQR (Univerzalnega Plačilnega Naloga +QR)</td> +</tr> +<tr> +<td style="text-align: left;">144</td> +<td style="text-align: left;"><code>BARCODE_ULTRA</code></td> +<td style="text-align: left;">Ultracode</td> +</tr> +<tr> +<td style="text-align: left;">145</td> +<td style="text-align: left;"><code>BARCODE_RMQR</code></td> +<td style="text-align: left;">Rectangular Micro QR Code (rMQR)</td> +</tr> +<tr> +<td style="text-align: left;">146</td> +<td style="text-align: left;"><code>BARCODE_BC412</code></td> +<td style="text-align: left;">IBM BC412 (SEMI T1-95)</td> +</tr> +<tr> +<td style="text-align: left;">147</td> +<td style="text-align: left;"><code>BARCODE_DXFILMEDGE</code></td> +<td style="text-align: left;">DX Film Edge Barcode</td> +</tr> +</tbody> +</table> +</div> +<h2 id="adjusting-height">4.4 Adjusting Height</h2> +<p>The height of a symbol (except those with a fixed width-to-height +ratio) can be adjusted using the <code>--height</code> switch. For +example:</p> +<div class="sourceCode" id="cb23"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb23-1"><a href="#cb23-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">--height</span><span class="op">=</span>100 <span class="at">-d</span> <span class="st">"This Text"</span></span></code></pre></div> +<p>This specifies a symbol height of 100 times the X-dimension of the +symbol.</p> +<p>The default height of most linear barcodes is 50.0X, but this can be +changed for barcodes whose specifications give a standard height by +using the switch <code>--compliantheight</code>. For instance</p> +<div class="sourceCode" id="cb24"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb24-1"><a href="#cb24-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> LOGMARS <span class="at">-d</span> <span class="st">"This Text"</span> <span class="at">--compliantheight</span></span></code></pre></div> +<p>will produce a barcode of height 45.455X instead of the normal +default of 50.0X. The flag also causes Zint to return a warning if a +non-compliant height is given:</p> +<div class="sourceCode" id="cb25"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb25-1"><a href="#cb25-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> LOGMARS <span class="at">-d</span> <span class="st">"This Text"</span> <span class="at">--compliantheight</span> <span class="at">--height</span><span class="op">=</span>6.2</span> +<span id="cb25-2"><a href="#cb25-2" aria-hidden="true" tabindex="-1"></a><span class="ex">Warning</span> 247: Height not compliant with standards</span></code></pre></div> +<p>Another switch is <code>--heightperrow</code>, which can be useful +for symbologies that have a variable number of linear rows, namely +Codablock-F, Code 16K, Code 49, GS1 DataBar Expanded Stacked, +MicroPDF417 and PDF417, as it changes the treatment of the height value +from overall height to per-row height, allowing you to specify a +consistent height for each linear row without having to know how many +there are. For instance</p> +<div class="sourceCode" id="cb26"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb26-1"><a href="#cb26-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> PDF417 <span class="at">-d</span> <span class="st">"This Text"</span> <span class="at">--height</span><span class="op">=</span>4 <span class="at">--heightperrow</span></span></code></pre></div> +<figure> +<img src="images/pdf417_heightperrow.svg" title="fig:" class="lin" +alt="zint -b PDF417 -d "This Text" --height=4 --heightperrow" /> +<figcaption +aria-hidden="true"><code>zint -b PDF417 -d "This Text" --height=4 --heightperrow</code></figcaption> +</figure> +<p>will produce a barcode of height 32X, with each of the 8 rows 4X +high.</p> +<h2 id="adjusting-whitespace">4.5 Adjusting Whitespace</h2> +<p>The amount of horizontal whitespace to the left and right of the +generated barcode can be altered using the <code>-w</code> or +<code>--whitesp</code> switch, in integral multiples of the X-dimension. +For example:</p> +<div class="sourceCode" id="cb27"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb27-1"><a href="#cb27-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-w</span> 10 <span class="at">-d</span> <span class="st">"This Text"</span></span></code></pre></div> +<p>This specifies a whitespace width of 10 times the X-dimension of the +symbol both to the left and to the right of the barcode.</p> +<p>The amount of vertical whitespace above and below the barcode can be +altered using the <code>--vwhitesp</code> switch, in integral multiples +of the X-dimension. For example for 3 times the X-dimension:</p> +<div class="sourceCode" id="cb28"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb28-1"><a href="#cb28-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">--vwhitesp</span><span class="op">=</span>3 <span class="at">-d</span> <span class="st">"This Text"</span></span></code></pre></div> +<p>Note that the whitespace at the bottom appears below the text, if +any.</p> +<p>Horizontal and vertical whitespace can of course be used +together:</p> +<div class="sourceCode" id="cb29"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb29-1"><a href="#cb29-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> DATAMATRIX <span class="at">--whitesp</span><span class="op">=</span>1 <span class="at">--vwhitesp</span><span class="op">=</span>1 <span class="at">-d</span> <span class="st">"This Text"</span></span></code></pre></div> +<p>A <code>--quietzones</code> option is also available which adds quiet +zones compliant with the symbology’s specification. This is in addition +to any whitespace specified with the <code>--whitesp</code> or +<code>--vwhitesp</code> switches.</p> +<p>Note that Codablock-F, Code 16K, Code 49, ITF-14, EAN-2 to EAN-13, +ISBN, UPC-A and UPC-E have compliant quiet zones added by default. This +can be disabled with the option <code>--noquietzones</code>.</p> +<h2 id="adding-boundary-bars-and-boxes">4.6 Adding Boundary Bars and +Boxes</h2> +<p>Zint allows the symbol to be bound with ‘boundary bars’ (also known +as ‘bearer bars’) using the option <code>--bind</code>. These bars help +to prevent misreading of the symbol by corrupting a scan if the scanning +beam strays off the top or bottom of the symbol. Zint can also put a +border right around the symbol and its horizontal whitespace with the +<code>--box</code> option.</p> +<p>The width of the boundary bars or box borders, in integral multiples +of the X-dimension, must be specified using the <code>--border</code> +switch. For example:</p> +<div class="sourceCode" id="cb30"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb30-1"><a href="#cb30-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">--box</span> <span class="at">--border</span><span class="op">=</span>10 <span class="at">-w</span> 10 <span class="at">-d</span> <span class="st">"This Text"</span></span></code></pre></div> +<figure> +<img src="images/code128_box.svg" title="fig:" class="lin" +alt="zint --border=10 --box -d "This Text" -w 10" /> +<figcaption +aria-hidden="true"><code>zint --border=10 --box -d "This Text" -w 10</code></figcaption> +</figure> +<p>gives a box with a width 10 times the X-dimension of the symbol. Note +that when specifying a box, horizontal whitespace is usually required in +order to create a quiet zone between the barcode and the sides of the +box. To add a boundary bar to the top only use +<code>--bindtop</code>.</p> +<p>For linear symbols, horizontal boundary bars appear tight against the +barcode, inside any vertical whitespace (or text). For matrix symbols, +however, where they are decorative rather than functional, boundary bars +appear outside any whitespace.</p> +<figure> +<img src="images/qrcode_box.svg" title="fig:" class="i2d" +alt="zint -b QRCODE --border=1 --box -d "This Text" --quietzones" /> +<figcaption +aria-hidden="true"><code>zint -b QRCODE --border=1 --box -d "This Text" --quietzones</code></figcaption> +</figure> +<p>Codablock-F, Code 16K and Code 49 always have boundary bars, and +default to particular horizontal whitespace values. Special +considerations apply to ITF-14 and DPD - see <a href="#itf-14">6.1.2.6 +ITF-14</a> and <a href="#dpd-code">6.1.10.7 DPD Code</a> for those +symbologies.</p> +<h2 id="using-colour">4.7 Using Colour</h2> +<p>The default colours of a symbol are a black symbol on a white +background. Zint allows you to change this. The <code>-r</code> or +<code>--reverse</code> switch allows the default colours to be inverted +so that a white symbol is shown on a black background (known as +“reflectance reversal” or “reversed reflectance”). For example the +command</p> +<div class="sourceCode" id="cb31"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb31-1"><a href="#cb31-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-r</span> <span class="at">-d</span> <span class="st">"This Text"</span></span></code></pre></div> +<p>gives an inverted Code 128 symbol. This is not practical for most +symbologies but white-on-black is allowed by the Aztec Code, Data +Matrix, DotCode, Han Xin Code, Grid Matrix and QR Code symbology +specifications.</p> +<p>For more specific needs the foreground (ink) and background (paper) +colours can be specified using the <code>--fg</code> and +<code>--bg</code> options followed by a number in <code>"RRGGBB"</code> +hexadecimal notation (the same system used in HTML) or in +<code>"C,M,Y,K"</code> decimal percentages format (the latter normally +used with the <code>--cmyk</code> option - see below). For example the +command</p> +<div class="sourceCode" id="cb32"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb32-1"><a href="#cb32-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">--fg</span><span class="op">=</span>00FF00 <span class="at">-d</span> <span class="st">"This Text"</span></span></code></pre></div> +<p>alters the symbol to a bright green.</p> +<figure> +<img src="images/code128_green.svg" title="fig:" class="lin" +alt="zint -d "This Text" --fg=00FF00" /> +<figcaption +aria-hidden="true"><code>zint -d "This Text" --fg=00FF00</code></figcaption> +</figure> +<p>Zint also supports RGBA colour information for those output file +formats which support alpha channels (currently only GIF, PCX, PNG, SVG +and TIF, with GIF supporting either a background or foreground alpha but +not both) in a <code>"RRGGBBAA"</code> format. For example:</p> +<div class="sourceCode" id="cb33"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb33-1"><a href="#cb33-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">--fg</span><span class="op">=</span>00ff0055 <span class="at">-d</span> <span class="st">"This Text"</span></span></code></pre></div> +<figure> +<img src="images/code128_green_alpha.svg" title="fig:" class="lin" +alt="zint -d "This Text" --fg=00FF0055" /> +<figcaption +aria-hidden="true"><code>zint -d "This Text" --fg=00FF0055</code></figcaption> +</figure> +<p>will produce a semi-transparent green foreground with a standard +(white) background. Note that transparency is treated differently by +raster and vector (SVG) output formats, as for vector output the +background will “shine through” a transparent foreground. For +instance</p> +<div class="sourceCode" id="cb34"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb34-1"><a href="#cb34-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">--bg</span><span class="op">=</span>ff0000 <span class="at">--fg</span><span class="op">=</span>ffffff00 ...</span></code></pre></div> +<p>will give different results for PNG and SVG. Experimentation is +advised!</p> +<p>In addition the <code>--nobackground</code> option will remove the +background from all output formats except BMP.<a href="#fn4" +class="footnote-ref" id="fnref4" role="doc-noteref"><sup>4</sup></a></p> +<p>The <code>--cmyk</code> option is specific to output in Encapsulated +PostScript (EPS) and TIF, and selects the CMYK colour space. Custom +colours should then usually be given in the comma-separated +<code>"C,M,Y,K"</code> format, where <code>C</code>, <code>M</code>, +<code>Y</code> and <code>K</code> are expressed as decimal percentage +values from 0 to 100. RGB values may still be used, in which case they +will be converted formulaically to CMYK approximations.</p> +<h2 id="rotating-the-symbol">4.8 Rotating the Symbol</h2> +<p>The symbol can be rotated through four orientations using the +<code>--rotate</code> option followed by the angle of rotation as shown +below.</p> +<pre><code>--rotate=0 (default) +--rotate=90 +--rotate=180 +--rotate=270</code></pre> +<figure> +<img src="images/code128_rotate90.svg" title="fig:" class="lin" +alt="zint -d "This Text" --rotate=90" /> +<figcaption +aria-hidden="true"><code>zint -d "This Text" --rotate=90</code></figcaption> +</figure> +<h2 id="adjusting-image-size-x-dimension">4.9 Adjusting Image Size +(X-dimension)</h2> +<p>The size of the image can be altered using the <code>--scale</code> +option, which sets the X-dimension. The default scale is 1.0.</p> +<p>The scale is multiplied by 2 (with the exception of MaxiCode) before +being applied to the X-dimension. For MaxiCode, it is multiplied by 10 +for raster output, by 40 for EMF vector output, and by 2 otherwise +(non-EMF vector output).</p> +<p>For non-MaxiCode raster output, the default scale of 1 results in an +X-dimension of 2 pixels. For example for non-MaxiCode PNG images a scale +of 5 will increase the X-dimension to 10 pixels. For MaxiCode, see <a +href="#maxicode-raster-scaling">4.9.3 MaxiCode Raster Scaling</a> +below.</p> +<p>Scales for non-MaxiCode raster output should be given in increments +of 0.5, i.e. 0.5, 1, 1.5, 2, 2.5, 3, 3.5, etc., to avoid the X-dimension +varying across the symbol due to interpolation. 0.5 increments are also +faster to render.</p> +<p>The minimum scale for non-MaxiCode raster output in non-dotty mode is +0.5, giving a minimum X-dimension of 1 pixel. For MaxiCode, it is 0.2. +The minimum scale for raster output in dotty mode is 1 (see <a +href="#working-with-dots">4.15 Working with Dots</a>). For raster +output, text will not be printed for scales less than 1.</p> +<p>The minimum scale for vector output is 0.1, giving a minimum +X-dimension of 0.2 (or for MaxiCode EMF output, 4). The maximum scale +for both raster and vector is 200.</p> +<p>To summarize the more intricate details:</p> +<div id="tbl:scaling_multiplers" class="tablenos"> +<table id="tbl:scaling_multiplers" style="width:92%;" +data-tag=": Scaling Multipliers and Minima"> +<caption><span>Table : Scaling Multipliers and Minima</span> </caption> +<colgroup> +<col style="width: 15%" /> +<col style="width: 25%" /> +<col style="width: 16%" /> +<col style="width: 19%" /> +<col style="width: 15%" /> +</colgroup> +<thead> +<tr> +<th>MaxiCode?</th> +<th style="text-align: left;">Output</th> +<th>Multiplier</th> +<th style="text-align: left;">Min. Scale (non-dotty)</th> +<th style="text-align: left;">Min. Scale (dotty)</th> +</tr> +</thead> +<tbody> +<tr> +<td>No</td> +<td style="text-align: left;">Raster</td> +<td>2</td> +<td style="text-align: left;">0.5</td> +<td style="text-align: left;">1</td> +</tr> +<tr> +<td>No</td> +<td style="text-align: left;">Vector</td> +<td>2</td> +<td style="text-align: left;">0.1</td> +<td style="text-align: left;">0.1</td> +</tr> +<tr> +<td>Yes</td> +<td style="text-align: left;">Raster</td> +<td>10</td> +<td style="text-align: left;">0.2</td> +<td style="text-align: left;">N/A</td> +</tr> +<tr> +<td>Yes</td> +<td style="text-align: left;">Vector (non-EMF)</td> +<td>2</td> +<td style="text-align: left;">0.1</td> +<td style="text-align: left;">N/A</td> +</tr> +<tr> +<td>Yes</td> +<td style="text-align: left;">EMF</td> +<td>40</td> +<td style="text-align: left;">0.1</td> +<td style="text-align: left;">N/A</td> +</tr> +</tbody> +</table> +</div> +<h3 id="scaling-by-x-dimension-and-resolution">4.9.1 Scaling by +X-dimension and Resolution</h3> +<p>An alternative way to specify the scale, which takes the above +details into account, is to specify measurable units using the +<code>--scalexdimdp</code> option, which has the format</p> +<pre><code>--scalexdimdp=X[,R]</code></pre> +<p>where <code>X</code> is the X-dimension (in mm by default) and +<code>R</code> is the resolution (in dpmm, dots per mm, by default). +<code>R</code> is optional, and defaults to 12 dpmm, and <code>X</code> +may be zero, in which case it uses a symbology-specific default. The +units may be given in inches for <code>X</code> by appending +<code>"in"</code>, and in dpi (dots per inch) for <code>R</code> by +appending <code>"dpi"</code>. For example</p> +<div class="sourceCode" id="cb37"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb37-1"><a href="#cb37-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-d</span> <span class="st">"1234"</span> <span class="at">--scalexdimdp</span><span class="op">=</span>0.013in,300dpi</span></code></pre></div> +<p>Explicit metric units may also be given by appending +<code>"mm"</code> and <code>"dpmm"</code> as appropriate, and may be +mixed with U.S. units:</p> +<div class="sourceCode" id="cb38"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb38-1"><a href="#cb38-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-d</span> <span class="st">"1234"</span> <span class="at">--scalexdimdp</span><span class="op">=</span>0.33mm,300dpi</span></code></pre></div> +<h3 id="scaling-example">4.9.2 Scaling Example</h3> +<p>The GS1 General Specifications Section 5.2.6.6 ‘Symbol dimensions at +nominal size’ gives an example of an EAN-13 barcode using the +X-dimension of 0.33mm. To print that example as a PNG at 12 dpmm, the +approximate equivalent of 300 dpi (<code>dpi = dpmm * 25.4</code>), +specify a scale of 2, since <code>0.33 * 12 = 3.96</code> pixels, or 4 +pixels rounding to the nearest pixel:</p> +<div class="sourceCode" id="cb39"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb39-1"><a href="#cb39-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> EANX <span class="at">-d</span> <span class="st">"501234567890"</span> <span class="at">--compliantheight</span> <span class="at">--scale</span><span class="op">=</span>2</span></code></pre></div> +<p>This will result in output of 37.29mm x 25.56mm (WxH) at 12 dpmm. The +same result can be achieved using the <code>--scalexdimdp</code> option +with</p> +<div class="sourceCode" id="cb40"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb40-1"><a href="#cb40-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> EANX <span class="at">-d</span> <span class="st">"501234567890"</span> <span class="at">--compliantheight</span> <span class="at">--scalexdimdp</span><span class="op">=</span>0</span></code></pre></div> +<p>as 0.33mm is the default X-dimension for EAN, and 12 dpmm the default +resolution.</p> +<h3 id="maxicode-raster-scaling">4.9.3 MaxiCode Raster Scaling</h3> +<p>For MaxiCode symbols, which use hexagons, the scale for raster output +is multiplied by 10 before being applied. The 0.5 increment recommended +for normal raster output does not apply.</p> +<p>The minimum scale is 0.2, so the minimum X-dimension is 2 pixels. +However scales below 0.5 are not recommended and may produce symbols +that are not within the following size ranges.</p> +<p>MaxiCode symbols have fixed size ranges of 24.82mm to 27.93mm in +width, and 23.71mm to 26.69mm in height, excluding quiet zones. The +default X-dimension is 0.88mm. For example, to output at the default +X-dimension at 600 dpi specify:</p> +<div class="sourceCode" id="cb41"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb41-1"><a href="#cb41-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> MAXICODE <span class="at">-d</span> <span class="st">"MaxiCode (19 chars)"</span> <span class="at">--scalexdimdp</span><span class="op">=</span>0,600dpi</span></code></pre></div> +<h2 id="human-readable-text-hrt-options">4.10 Human Readable Text (HRT) +Options</h2> +<p>For linear barcodes the text present in the output image can be +removed by using the <code>--notext</code> option. Note also that for +raster output text will not be printed for scales less than 1 (see <a +href="#adjusting-image-size-x-dimension">4.9 Adjusting Image Size +(X-dimension)</a>).</p> +<p>Text can be set to bold using the <code>--bold</code> option, or a +smaller font can be substituted using the <code>--small</code> option. +The <code>--bold</code> and <code>--small</code> options can be used +together if required, but only for vector output.</p> +<figure> +<img src="images/code128_small_bold.svg" title="fig:" class="lin" +alt="zint --bold -d "This Text" --small" /> +<figcaption +aria-hidden="true"><code>zint --bold -d "This Text" --small</code></figcaption> +</figure> +<p>The gap between the barcode and the text can be adjusted using the +<code>--textgap</code> option, where the gap is given in X-dimensions, +and may be negative (minimum -5.0X, maximum 10.0X). The default gap is +1X. Note that a very small gap may cause accented texts to overlap with +the barcode:</p> +<figure> +<img src="images/code128_textgap.svg" title="fig:" class="lin" +alt="zint -d "Áccent" --textgap=0.1" /> +<figcaption +aria-hidden="true"><code>zint -d "Áccent" --textgap=0.1</code></figcaption> +</figure> +<p>For SVG output, the font preferred by Zint (monospaced “OCR-B” for +EAN/UPC, “Arimo” - a proportional sans-serif font metrically compatible +with “Arial” - for all others) can be embedded in the file for +portability using the <code>--embedfont</code> option:</p> +<figure> +<img src="images/code128_embedfont.svg" title="fig:" class="lin" +alt="zint -d "Áccent" --embedfont" /> +<figcaption +aria-hidden="true"><code>zint -d "Áccent" --embedfont</code></figcaption> +</figure> +<h2 id="input-modes">4.11 Input Modes</h2> +<h3 id="unicode-data-and-gs1-modes">4.11.1 Unicode, Data, and GS1 +Modes</h3> +<p>By default all CLI input data is assumed to be encoded in UTF-8 +format. Many barcode symbologies encode data using the Latin-1 (ISO/IEC +8859-1 plus ASCII) character set, so input is converted from UTF-8 to +Latin-1 before being put in the symbol. In addition QR Code and its +variants and Han Xin Code can by default encode Japanese (Kanji) or +Chinese (Hanzi) characters which are also converted from UTF-8.</p> +<p>There are two exceptions to the Latin-1 default: Grid Matrix, whose +default character set is GB 2312 (Chinese); and UPNQR, whose default +character set is Latin-2 (ISO/IEC 8859-2 plus ASCII).</p> +<div id="tbl:default_character_sets" class="tablenos"> +<table id="tbl:default_character_sets" +data-tag=": Default Character Sets"> +<caption><span>Table : Default Character Sets</span> </caption> +<thead> +<tr> +<th style="text-align: left;">Symbology</th> +<th style="text-align: left;">Default character sets</th> +<th>Alternate if input not Latin-1</th> +</tr> +</thead> +<tbody> +<tr> +<td style="text-align: left;">Aztec Code</td> +<td style="text-align: left;">Latin-1</td> +<td>None</td> +</tr> +<tr> +<td style="text-align: left;">Codablock-F</td> +<td style="text-align: left;">Latin-1</td> +<td>None</td> +</tr> +<tr> +<td style="text-align: left;">Code 128</td> +<td style="text-align: left;">Latin-1</td> +<td>None</td> +</tr> +<tr> +<td style="text-align: left;">Code 16K</td> +<td style="text-align: left;">Latin-1</td> +<td>None</td> +</tr> +<tr> +<td style="text-align: left;">Code One</td> +<td style="text-align: left;">Latin-1</td> +<td>None</td> +</tr> +<tr> +<td style="text-align: left;">Data Matrix</td> +<td style="text-align: left;">Latin-1</td> +<td>None</td> +</tr> +<tr> +<td style="text-align: left;">DotCode</td> +<td style="text-align: left;">Latin-1</td> +<td>None</td> +</tr> +<tr> +<td style="text-align: left;">Grid Matrix</td> +<td style="text-align: left;">GB 2312 (includes ASCII)</td> +<td>N/A</td> +</tr> +<tr> +<td style="text-align: left;">Han Xin</td> +<td style="text-align: left;">Latin-1</td> +<td>GB 18030 (includes ASCII)</td> +</tr> +<tr> +<td style="text-align: left;">MaxiCode</td> +<td style="text-align: left;">Latin-1</td> +<td>None</td> +</tr> +<tr> +<td style="text-align: left;">MicroPDF417</td> +<td style="text-align: left;">Latin-1</td> +<td>None</td> +</tr> +<tr> +<td style="text-align: left;">Micro QR Code</td> +<td style="text-align: left;">Latin-1</td> +<td>Shift JIS (includes ASCII<a href="#fn5" class="footnote-ref" +id="fnref5" role="doc-noteref"><sup>5</sup></a>)</td> +</tr> +<tr> +<td style="text-align: left;">PDF417</td> +<td style="text-align: left;">Latin-1</td> +<td>None</td> +</tr> +<tr> +<td style="text-align: left;">QR Code</td> +<td style="text-align: left;">Latin-1</td> +<td>Shift JIS (see above)</td> +</tr> +<tr> +<td style="text-align: left;">rMQR</td> +<td style="text-align: left;">Latin-1</td> +<td>Shift JIS (see above)</td> +</tr> +<tr> +<td style="text-align: left;">Ultracode</td> +<td style="text-align: left;">Latin-1</td> +<td>None</td> +</tr> +<tr> +<td style="text-align: left;">UPNQR</td> +<td style="text-align: left;">Latin-2</td> +<td>N/A</td> +</tr> +<tr> +<td style="text-align: left;">All others</td> +<td style="text-align: left;">ASCII</td> +<td>N/A</td> +</tr> +</tbody> +</table> +</div> +<p>If Zint encounters characters which can not be encoded using the +default character encoding then it will take advantage of the ECI +(Extended Channel Interpretations) mechanism to encode the data if the +symbology supports it - see <a href="#input-modes-and-eci">4.11.2 Input +Modes and ECI</a> below.</p> +<p>GS1 data can be encoded in a number of symbologies. Application +Identifiers (AIs) should be enclosed in <code>[square brackets]</code> +followed by the data to be encoded (see <a href="#gs1-128">6.1.10.3 +GS1-128</a>). To encode GS1 data use the <code>--gs1</code> option. GS1 +mode is assumed (and doesn’t need to be set) for GS1-128, EAN-14, GS1 +DataBar and GS1 Composite symbologies but is also available for Aztec +Code, Code 16K, Code 49, Code One, Data Matrix, DotCode, QR Code and +Ultracode.</p> +<p>Health Industry Barcode (HIBC) data may also be encoded in the +symbologies Aztec Code, Codablock-F, Code 128, Code 39, Data Matrix, +MicroPDF417, PDF417 and QR Code. Within this mode, the leading +<code>'+'</code> and the check character are automatically added by +Zint, conforming to HIBC Labeler Identification Code (HIBC LIC). For +HIBC Provider Applications Standard (HIBC PAS), preface the data with a +slash <code>'/'</code>.</p> +<p>The <code>--binary</code> option encodes the input data as given. +Automatic code page translation to an ECI page is disabled, and no +validation of the data’s encoding takes place. This may be used for raw +binary or binary encrypted data. This switch plays together with the +built-in ECI logic and examples may be found below.</p> +<p>The <code>--fullmultibyte</code> option uses the multibyte modes of +QR Code, Micro QR Code, Rectangular Micro QR Code, Han Xin Code and Grid +Matrix for non-ASCII data, maximizing density. This is achieved by using +compression designed for Kanji/Hanzi characters; however some decoders +take blocks which are encoded this way and interpret them as Kanji/Hanzi +characters, thus causing data corruption. Symbols encoded with this +option should be checked against decoders before they are used. The +popular open-source ZXing decoder is known to exhibit this +behaviour.</p> +<h3 id="input-modes-and-eci">4.11.2 Input Modes and ECI</h3> +<p>If your data contains characters that are not in the default +character set, you may encode it using an ECI-aware symbology and an ECI +value from Table <a href="#tbl:eci_codes">: ECI Codes</a> below. The ECI +information is added to your code symbol as prefix data. The symbologies +that support ECI are</p> +<div id="tbl:eci_aware_symbologies" class="tablenos"> +<table id="tbl:eci_aware_symbologies" +data-tag=": ECI-Aware Symbologies"> +<caption><span>Table : ECI-Aware Symbologies</span> </caption> +<tbody> +<tr> +<td style="text-align: left;">Aztec Code</td> +<td style="text-align: left;">Grid Matrix</td> +<td style="text-align: left;">PDF417</td> +</tr> +<tr> +<td style="text-align: left;">Code One</td> +<td style="text-align: left;">Han Xin Code</td> +<td style="text-align: left;">QR Code</td> +</tr> +<tr> +<td style="text-align: left;">Data Matrix</td> +<td style="text-align: left;">MaxiCode</td> +<td style="text-align: left;">rMQR</td> +</tr> +<tr> +<td style="text-align: left;">DotCode</td> +<td style="text-align: left;">MicroPDF417</td> +<td style="text-align: left;">Ultracode</td> +</tr> +</tbody> +</table> +</div> +<p>Be aware that not all barcode readers support ECI mode, so this can +sometimes lead to unreadable barcodes. If you are using characters +beyond those supported by the default character set then you should +check that the resulting barcode can be understood by your target +barcode reader.</p> +<p>The ECI value may be specified with the <code>--eci</code> switch, +followed by the value in the column <code>"ECI Code"</code> in the table +below. The input data should be UTF-8 formatted. Zint automatically +translates the data into the target encoding.</p> +<div id="tbl:eci_codes" class="tablenos"> +<table id="tbl:eci_codes" data-tag=": ECI Codes"> +<caption><span>Table : ECI Codes</span> </caption> +<thead> +<tr> +<th>ECI Code</th> +<th>Character Encoding Scheme (ISO/IEC 8859 schemes include ASCII)</th> +</tr> +</thead> +<tbody> +<tr> +<td>3</td> +<td>ISO/IEC 8859-1 - Latin alphabet No. 1</td> +</tr> +<tr> +<td>4</td> +<td>ISO/IEC 8859-2 - Latin alphabet No. 2</td> +</tr> +<tr> +<td>5</td> +<td>ISO/IEC 8859-3 - Latin alphabet No. 3</td> +</tr> +<tr> +<td>6</td> +<td>ISO/IEC 8859-4 - Latin alphabet No. 4</td> +</tr> +<tr> +<td>7</td> +<td>ISO/IEC 8859-5 - Latin/Cyrillic alphabet</td> +</tr> +<tr> +<td>8</td> +<td>ISO/IEC 8859-6 - Latin/Arabic alphabet</td> +</tr> +<tr> +<td>9</td> +<td>ISO/IEC 8859-7 - Latin/Greek alphabet</td> +</tr> +<tr> +<td>10</td> +<td>ISO/IEC 8859-8 - Latin/Hebrew alphabet</td> +</tr> +<tr> +<td>11</td> +<td>ISO/IEC 8859-9 - Latin alphabet No. 5 (Turkish)</td> +</tr> +<tr> +<td>12</td> +<td>ISO/IEC 8859-10 - Latin alphabet No. 6 (Nordic)</td> +</tr> +<tr> +<td>13</td> +<td>ISO/IEC 8859-11 - Latin/Thai alphabet</td> +</tr> +<tr> +<td>15</td> +<td>ISO/IEC 8859-13 - Latin alphabet No. 7 (Baltic)</td> +</tr> +<tr> +<td>16</td> +<td>ISO/IEC 8859-14 - Latin alphabet No. 8 (Celtic)</td> +</tr> +<tr> +<td>17</td> +<td>ISO/IEC 8859-15 - Latin alphabet No. 9</td> +</tr> +<tr> +<td>18</td> +<td>ISO/IEC 8859-16 - Latin alphabet No. 10</td> +</tr> +<tr> +<td>20</td> +<td>Shift JIS (JIS X 0208 and JIS X 0201)</td> +</tr> +<tr> +<td>21</td> +<td>Windows 1250 - Latin 2 (Central Europe)</td> +</tr> +<tr> +<td>22</td> +<td>Windows 1251 - Cyrillic</td> +</tr> +<tr> +<td>23</td> +<td>Windows 1252 - Latin 1</td> +</tr> +<tr> +<td>24</td> +<td>Windows 1256 - Arabic</td> +</tr> +<tr> +<td>25</td> +<td>UTF-16BE (High order byte first)</td> +</tr> +<tr> +<td>26</td> +<td>UTF-8</td> +</tr> +<tr> +<td>27</td> +<td>ASCII (ISO/IEC 646 IRV)</td> +</tr> +<tr> +<td>28</td> +<td>Big5 (Taiwan) Chinese Character Set</td> +</tr> +<tr> +<td>29</td> +<td>GB 2312 (PRC) Chinese Character Set</td> +</tr> +<tr> +<td>30</td> +<td>Korean Character Set EUC-KR (KS X 1001:2002)</td> +</tr> +<tr> +<td>31</td> +<td>GBK Chinese Character Set</td> +</tr> +<tr> +<td>32</td> +<td>GB 18030 Chinese Character Set</td> +</tr> +<tr> +<td>33</td> +<td>UTF-16LE (Low order byte first)</td> +</tr> +<tr> +<td>34</td> +<td>UTF-32BE (High order bytes first)</td> +</tr> +<tr> +<td>35</td> +<td>UTF-32LE (Low order bytes first)</td> +</tr> +<tr> +<td>170</td> +<td>ISO/IEC 646 Invariant<a href="#fn6" class="footnote-ref" id="fnref6" +role="doc-noteref"><sup>6</sup></a></td> +</tr> +<tr> +<td>899</td> +<td>8-bit binary data</td> +</tr> +</tbody> +</table> +</div> +<p>An ECI value of 0 does not encode any ECI information in the code +symbol (unless the data contains non-default character set characters). +In this case, the default character set applies (see Table <a +href="#tbl:default_character_sets">: Default Character Sets</a> +above).</p> +<p>If no ECI is specified or a value of 0 is given, and the data does +contain characters other than in the default character set, then Zint +will automatically insert the appropriate single-byte ECI if possible +(ECIs 3 to 24, excluding ECI 20), or failing that ECI 26 (UTF-8). A +warning will be generated. This mechanism is not applied if the +<code>--binary</code> option is given.</p> +<p>Multiple ECIs can be specified using the <code>--segN</code> options +- see <a href="#multiple-segments">4.16 Multiple Segments</a>.</p> +<p>Note: the <code>--eci=3</code> specification should only be used for +special purposes. Using this parameter, the ECI information is +explicitly added to the symbol. Nevertheless, for ECI Code 3, this is +not usually required, as this is the default encoding for most barcodes, +which is also active without any ECI information.</p> +<h4 id="input-modes-and-eci-example-1">4.11.2.1 Input Modes and ECI +Example 1</h4> +<p>The Euro sign U+20AC can be encoded in ISO/IEC 8859-15. The Euro sign +has the ISO/IEC 8859-15 codepoint hex <code>"A4"</code>. It is encoded +in UTF-8 as the hex sequence: <code>"E2 82 AC"</code>. Those 3 bytes are +contained in the file <code>"utf8euro.txt"</code>. This command will +generate the corresponding code:</p> +<div class="sourceCode" id="cb42"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb42-1"><a href="#cb42-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> 71 <span class="at">--scale</span><span class="op">=</span>10 <span class="at">--eci</span><span class="op">=</span>17 <span class="at">-i</span> utf8euro.txt</span></code></pre></div> +<p>This is equivalent to the commands (using the <code>--esc</code> +switch):</p> +<div class="sourceCode" id="cb43"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb43-1"><a href="#cb43-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> 71 <span class="at">--scale</span><span class="op">=</span>10 <span class="at">--eci</span><span class="op">=</span>17 <span class="at">--esc</span> <span class="at">-d</span> <span class="st">"\xE2\x82\xAC"</span></span> +<span id="cb43-2"><a href="#cb43-2" aria-hidden="true" tabindex="-1"></a></span> +<span id="cb43-3"><a href="#cb43-3" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> 71 <span class="at">--scale</span><span class="op">=</span>10 <span class="at">--eci</span><span class="op">=</span>17 <span class="at">--esc</span> <span class="at">-d</span> <span class="st">"\u20AC"</span></span></code></pre></div> +<p>and to the command:</p> +<div class="sourceCode" id="cb44"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb44-1"><a href="#cb44-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> 71 <span class="at">--scale</span><span class="op">=</span>10 <span class="at">--eci</span><span class="op">=</span>17 <span class="at">-d</span> <span class="st">"€"</span></span></code></pre></div> +<figure> +<img src="images/datamatrix_euro.svg" title="fig:" class="i2d" +alt="zint -b DATAMATRIX --eci=17 -d "€"" /> +<figcaption +aria-hidden="true"><code>zint -b DATAMATRIX --eci=17 -d "€"</code></figcaption> +</figure> +<h4 id="input-modes-and-eci-example-2">4.11.2.2 Input Modes and ECI +Example 2</h4> +<p>The Chinese character with the Unicode codepoint U+5E38 can be +encoded in Big5 encoding. The Big5 representation of this character is +the two hex bytes: <code>"B1 60"</code> (contained in the file +<code>"big5char.txt"</code>). The generation command for Data Matrix +is:</p> +<div class="sourceCode" id="cb45"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb45-1"><a href="#cb45-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> 71 <span class="at">--scale</span><span class="op">=</span>10 <span class="at">--eci</span><span class="op">=</span>28 <span class="at">--binary</span> <span class="at">-i</span> big5char.txt</span></code></pre></div> +<p>This is equivalent to the command (using the <code>--esc</code> +switch):</p> +<div class="sourceCode" id="cb46"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb46-1"><a href="#cb46-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> 71 <span class="at">--scale</span><span class="op">=</span>10 <span class="at">--eci</span><span class="op">=</span>28 <span class="at">--binary</span> <span class="at">--esc</span> <span class="at">-d</span> <span class="st">"\xB1\x60"</span></span></code></pre></div> +<p>and to the commands (no <code>--binary</code> switch so conversion +occurs):</p> +<div class="sourceCode" id="cb47"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb47-1"><a href="#cb47-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> 71 <span class="at">--scale</span><span class="op">=</span>10 <span class="at">--eci</span><span class="op">=</span>28 <span class="at">--esc</span> <span class="at">-d</span> <span class="st">"\xE5\xB8\xB8"</span></span> +<span id="cb47-2"><a href="#cb47-2" aria-hidden="true" tabindex="-1"></a></span> +<span id="cb47-3"><a href="#cb47-3" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> 71 <span class="at">--scale</span><span class="op">=</span>10 <span class="at">--eci</span><span class="op">=</span>28 <span class="at">--esc</span> <span class="at">-d</span> <span class="st">"\u5E38"</span></span> +<span id="cb47-4"><a href="#cb47-4" aria-hidden="true" tabindex="-1"></a></span> +<span id="cb47-5"><a href="#cb47-5" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> 71 <span class="at">--scale</span><span class="op">=</span>10 <span class="at">--eci</span><span class="op">=</span>28 <span class="at">-d</span> <span class="st">"常"</span></span></code></pre></div> +<figure> +<img src="images/datamatrix_big5.svg" title="fig:" class="i2d" +alt="zint -b DATAMATRIX --eci=28 -d "\u5E38" --esc" /> +<figcaption +aria-hidden="true"><code>zint -b DATAMATRIX --eci=28 -d "\u5E38" --esc</code></figcaption> +</figure> +<h4 id="input-modes-and-eci-example-3">4.11.2.3 Input Modes and ECI +Example 3</h4> +<p>Some decoders (in particular mobile app ones) for QR Code assume +UTF-8 encoding by default and do not support ECI. In this case supply +UTF-8 data and use the <code>--binary</code> switch so that the data +will be encoded as UTF-8 without conversion:</p> +<div class="sourceCode" id="cb48"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb48-1"><a href="#cb48-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> 58 <span class="at">--binary</span> <span class="at">-d</span> <span class="st">"UTF-8 data"</span></span></code></pre></div> +<figure> +<img src="images/qrcode_binary_utf8.svg" title="fig:" class="i2d" +alt="zint -b QRCODE --binary -d "\xE2\x82\xAC\xE5\xB8\xB8" --esc" /> +<figcaption +aria-hidden="true"><code>zint -b QRCODE --binary -d "\xE2\x82\xAC\xE5\xB8\xB8" --esc</code></figcaption> +</figure> +<h2 id="batch-processing">4.12 Batch Processing</h2> +<p>Data can be batch processed by reading from a text file and producing +a separate barcode image for each line of text in that file. To do this +use the <code>--batch</code> switch together with <code>-i</code> to +select the input file from which to read data. For example</p> +<div class="sourceCode" id="cb49"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb49-1"><a href="#cb49-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> EANX <span class="at">--batch</span> <span class="at">-i</span> ean13nos.txt</span></code></pre></div> +<p>where <code>"ean13nos.txt"</code> contains a list of EAN-13 numbers +(GTINs), each on its own line. Zint will automatically detect the end of +a line of text (in either Unix or Windows formatted text files) and +produce a symbol each time it finds this.</p> +<p>Input files should end with a line feed character - if this is not +present then Zint will not encode the last line of text, and will warn +you that there is a problem.</p> +<p>By default Zint will output numbered filenames starting with +<code>00001.png</code>, <code>00002.png</code> etc. To change this +behaviour specify the <code>-o</code> option using special characters in +the output filename as shown in the table below:</p> +<div id="tbl:batch_filename_formatting" class="tablenos"> +<table id="tbl:batch_filename_formatting" +data-tag=": Batch Filename Formatting"> +<caption><span>Table : Batch Filename Formatting</span> </caption> +<thead> +<tr> +<th>Input Character</th> +<th style="text-align: left;">Interpretation</th> +</tr> +</thead> +<tbody> +<tr> +<td><code>~</code></td> +<td style="text-align: left;">Insert a number or 0</td> +</tr> +<tr> +<td><code>#</code></td> +<td style="text-align: left;">Insert a number or space</td> +</tr> +<tr> +<td><code>@</code></td> +<td style="text-align: left;">Insert a number or <code>*</code> (or +<code>+</code> on Windows)</td> +</tr> +<tr> +<td>Any other</td> +<td style="text-align: left;">Insert literally</td> +</tr> +</tbody> +</table> +</div> +<p>For instance</p> +<div class="sourceCode" id="cb50"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb50-1"><a href="#cb50-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> EANX <span class="at">--batch</span> <span class="at">-i</span> ean13nos.txt <span class="at">-o</span> file~~~.svg</span></code></pre></div> +<p>The following table shows some examples to clarify this method:</p> +<div id="tbl:batch_filename_examples" class="tablenos"> +<table id="tbl:batch_filename_examples" +data-tag=": Batch Filename Examples"> +<caption><span>Table : Batch Filename Examples</span> </caption> +<thead> +<tr> +<th style="text-align: left;">Input</th> +<th style="text-align: left;">Filenames Generated</th> +</tr> +</thead> +<tbody> +<tr> +<td style="text-align: left;"><code>-o file~~~.svg</code></td> +<td style="text-align: left;"><code>"file001.svg"</code>, +<code>"file002.svg"</code>, <code>"file003.svg"</code></td> +</tr> +<tr> +<td style="text-align: left;"><code>-o @@@@bar.png</code></td> +<td style="text-align: left;"><code>"***1.png"</code>, +<code>"***2.png"</code>, <code>"***3.png"</code> (except Windows)</td> +</tr> +<tr> +<td style="text-align: left;"><code>-o @@@@bar.png</code></td> +<td style="text-align: left;"><code>"+++1.png"</code>, +<code>"+++2.png"</code>, <code>"+++3.png"</code> (on Windows)</td> +</tr> +<tr> +<td style="text-align: left;"><code>-o my~~~bar.eps</code></td> +<td style="text-align: left;"><code>"my001bar.eps"</code>, +<code>"my002bar.eps"</code>, <code>"my003bar.eps"</code></td> +</tr> +<tr> +<td style="text-align: left;"><code>-o t#es~t~.png</code></td> +<td style="text-align: left;"><code>"t es0t1.png"</code>, +<code>"t es0t2.png"</code>, <code>"t es0t3.png"</code></td> +</tr> +</tbody> +</table> +</div> +<p>The special characters can span directories also, which is useful +when creating a large number of barcodes:</p> +<div id="tbl:batch_dir_examples" class="tablenos"> +<table id="tbl:batch_dir_examples" +data-tag=": Batch Directory Examples"> +<caption><span>Table : Batch Directory Examples</span> </caption> +<thead> +<tr> +<th style="text-align: left;">Input</th> +<th style="text-align: left;">Filenames Generated</th> +</tr> +</thead> +<tbody> +<tr> +<td style="text-align: left;"><code>-o dir~/file~~~.svg</code></td> +<td style="text-align: left;"><code>"dir0/file001.svg"</code>, +<code>"dir0/file002.svg"</code>, …</td> +</tr> +<tr> +<td style="text-align: left;"></td> +<td style="text-align: left;">, <code>"dir0/file999.svg"</code>, +<code>"dir1/file000.svg"</code>, …</td> +</tr> +</tbody> +</table> +</div> +<p>For an alternative method of naming output files see the +<code>--mirror</code> option in <a href="#automatic-filenames">4.14 +Automatic Filenames</a> below.</p> +<h2 id="direct-output-to-stdout">4.13 Direct Output to stdout</h2> +<p>The finished image files can be output directly to stdout for use as +part of a pipe by using the <code>--direct</code> option. By default +<code>--direct</code> will output data as a PNG image (or GIF image if +<code>libpng</code> is not present), but this can be altered by +supplementing the <code>--direct</code> option with a +<code>--filetype</code> option followed by the suffix of the file type +required. For example:</p> +<div class="sourceCode" id="cb51"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb51-1"><a href="#cb51-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> 84 <span class="at">--direct</span> <span class="at">--filetype</span><span class="op">=</span>pcx <span class="at">-d</span> <span class="st">"Data to encode"</span></span></code></pre></div> +<p>This command will output the symbol as a PCX file to stdout. For the +supported output file formats see Table <a +href="#tbl:output_file_formats">: Output File Formats</a>.</p> +<hr /> +<p>CAUTION: Outputting binary files to the command shell without +catching that data in a pipe can have unpredictable results. Use with +care!</p> +<hr /> +<h2 id="automatic-filenames">4.14 Automatic Filenames</h2> +<p>The <code>--mirror</code> option instructs Zint to use the data to be +encoded as an indicator of the filename to be used. This is particularly +useful if you are processing batch data. For example the input data +<code>"1234567"</code> will result in a file named +<code>"1234567.png"</code>.</p> +<p>There are restrictions, however, on what characters can be stored in +a filename, so the filename may vary from the data if the data includes +non-printable characters, for example, and may be shortened if the data +input is long.</p> +<p>To set the output file format use the <code>--filetype</code> option +as detailed above in <a href="#direct-output-to-stdout">4.13 Direct +Output to stdout</a>. To output to a specific directory use the +<code>-o</code> option giving the name of the directory (any filename +will be ignored, unless <code>--filetype</code> is not specified, in +which case the filename’s extension will be used).</p> +<h2 id="working-with-dots">4.15 Working with Dots</h2> +<p>Matrix codes can be rendered as a series of dots or circles rather +than the normal squares by using the <code>--dotty</code> option. This +option is only available for matrix symbologies, and is automatically +selected for DotCode. The size of the dots can be adjusted using the +<code>--dotsize</code> option followed by the diameter of the dot, where +that diameter is in X-dimensions. The minimum dot size is 0.01, the +maximum is 20. The default size is 0.8.</p> +<p>The default and minimum scale for raster output in dotty mode is +1.</p> +<figure> +<img src="images/codeone_s_dotty.svg" title="fig:" class="dotty" +alt="zint -b CODEONE -d "123456789012345678" --dotty --vers=9" /> +<figcaption +aria-hidden="true"><code>zint -b CODEONE -d "123456789012345678" --dotty --vers=9</code></figcaption> +</figure> +<h2 id="multiple-segments">4.16 Multiple Segments</h2> +<p>If you need to specify different ECIs for different sections of the +input data, the <code>--seg1</code> to <code>--seg9</code> options can +be used. Each option is of the form <code>--segN=ECI,data</code> where +<code>ECI</code> is the ECI code (see Table <a href="#tbl:eci_codes">: +ECI Codes</a>) and <code>data</code> is the data to which this applies. +This is in addition to the ECI and data specified using the +<code>--eci</code> and <code>-d</code> options which must still be +present and which in effect constitute segment 0. For instance</p> +<div class="sourceCode" id="cb52"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb52-1"><a href="#cb52-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> AZTEC_CODE <span class="at">--eci</span><span class="op">=</span>9 <span class="at">-d</span> <span class="st">"Κείμενο"</span> <span class="at">--seg1</span><span class="op">=</span>7,<span class="st">"Текст"</span> <span class="at">--seg2</span><span class="op">=</span>20,<span class="st">"文章"</span></span></code></pre></div> +<p>specifies 3 segments: segment 0 with ECI 9 (Greek), segment 1 with +ECI 7 (Cyrillic), and segment 2 with ECI 20 (Shift JIS). Segments must +be consecutive.</p> +<p>Naturally the symbology must be ECI-aware (see Table <a +href="#tbl:eci_aware_symbologies">: ECI-Aware Symbologies</a>).</p> +<figure> +<img src="images/aztec_segs.svg" title="fig:" class="i2d" +alt="zint -b AZTEC --eci=9 -d "Κείμενο" --seg1=7,"Текст" --seg2=20,"文章"" /> +<figcaption +aria-hidden="true"><code>zint -b AZTEC --eci=9 -d "Κείμενο" --seg1=7,"Текст" --seg2=20,"文章"</code></figcaption> +</figure> +<p>ECIs of zero may be given, in which case Zint will automatically +determine an ECI if necessary, as described in section <a +href="#input-modes-and-eci">4.11.2 Input Modes and ECI</a>.</p> +<p>Multiple segments are not currently supported for use with GS1 +data.</p> +<h2 id="structured-append">4.17 Structured Append</h2> +<p>Structured Append is a method of splitting data among several symbols +so that they form a sequence that can be scanned and re-assembled in the +correct order on reading, and is available for Aztec Code, Code One, +Data Matrix, DotCode, Grid Matrix, MaxiCode, MicroPDF417, PDF417, QR +Code and Ultracode.</p> +<p>The <code>--structapp</code> option marks a symbol as part of a +Structured Append sequence, and has the format</p> +<pre><code>--structapp=I,C[,ID]</code></pre> +<figure> +<img src="images/datamatrix_structapp.svg" title="fig:" class="i2d" +alt="zint -b DATAMATRIX -d "2nd of 3" --structapp="2,3,5006"" /> +<figcaption +aria-hidden="true"><code>zint -b DATAMATRIX -d "2nd of 3" --structapp="2,3,5006"</code></figcaption> +</figure> +<p>where <code>I</code> is the index (position) of the symbol in the +Structured Append sequence, <code>C</code> is the count or total number +of symbols in the sequence, and <code>ID</code> is an optional +identifier (not available for Code One, DotCode or MaxiCode) that is the +same for all symbols belonging to the same sequence. The index is +1-based and goes from 1 to count. Count must be 2 or more. See the +individual symbologies for further details.</p> +<h2 id="help-options">4.18 Help Options</h2> +<p>There are three help options which give information about how to use +the command line. The <code>-h</code> or <code>--help</code> option will +display a list of all of the valid options available, and also gives the +exact version of the software (the version by itself can be displayed +with <code>-v</code> or <code>--version</code>).</p> +<p>The <code>-t</code> or <code>--types</code> option gives the table of +symbologies along with the symbol ID numbers and names.</p> +<p>The <code>-e</code> or <code>--ecinos</code> option gives a list of +the ECI codes.</p> +<h2 id="other-options">4.19 Other Options</h2> +<p>Zint can output a representation of the symbol data as a set of +hexadecimal values if asked to output to a text file +(<code>"*.txt"</code>) or if given the option +<code>--filetype=txt</code>. This can be used for test and diagnostic +purposes.</p> +<p>Additional options are available which are specific to certain +symbologies. These may, for example, control the amount of error +correction data or the size of the symbol. These options are discussed +in section <a href="#types-of-symbology">6. Types of Symbology</a> of +this guide.</p> +<h1 id="using-the-api">5. Using the API</h1> +<p>Zint has been written using the C language and has an API for use +with C/C++ language programs. A Qt interface (see <a +href="#annex-b.-qt-backend-qzint">Annex B. Qt Backend QZint</a>) is +available in the <code>"backend_qt"</code> sub-directory, and a Tcl +interface is available in the <code>"backend_tcl"</code> sub-directory +(see <a href="#annex-c.-tcl-backend-binding">Annex C. Tcl Backend +Binding</a>).</p> +<p>The <code>libzint</code> API has been designed to be very similar to +that used by the GNU Barcode package. This allows easy migration from +GNU Barcode to Zint. Zint, however, uses none of the same function names +or option names as GNU Barcode. This allows you to use both packages in +your application without conflict if you wish.</p> +<h2 id="creating-and-deleting-symbols">5.1 Creating and Deleting +Symbols</h2> +<p>The symbols manipulated by Zint are held in a +<code>zint_symbol</code> structure defined in <code>"zint.h"</code>. +These symbol structures are created with the +<code>ZBarcode_Create()</code> function and deleted using the +<code>ZBarcode_Delete()</code> function. For example the following code +creates and then deletes a symbol:</p> +<div class="sourceCode" id="cb54"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb54-1"><a href="#cb54-1" aria-hidden="true" tabindex="-1"></a><span class="pp">#include </span><span class="im"><zint.h></span></span> +<span id="cb54-2"><a href="#cb54-2" aria-hidden="true" tabindex="-1"></a><span class="pp">#include </span><span class="im"><stdio.h></span></span> +<span id="cb54-3"><a href="#cb54-3" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> main<span class="op">()</span></span> +<span id="cb54-4"><a href="#cb54-4" aria-hidden="true" tabindex="-1"></a><span class="op">{</span></span> +<span id="cb54-5"><a href="#cb54-5" aria-hidden="true" tabindex="-1"></a> <span class="kw">struct</span> zint_symbol <span class="op">*</span>my_symbol<span class="op">;</span></span> +<span id="cb54-6"><a href="#cb54-6" aria-hidden="true" tabindex="-1"></a> my_symbol <span class="op">=</span> ZBarcode_Create<span class="op">();</span></span> +<span id="cb54-7"><a href="#cb54-7" aria-hidden="true" tabindex="-1"></a> <span class="cf">if</span> <span class="op">(</span>my_symbol <span class="op">!=</span> NULL<span class="op">)</span> <span class="op">{</span></span> +<span id="cb54-8"><a href="#cb54-8" aria-hidden="true" tabindex="-1"></a> printf<span class="op">(</span><span class="st">"Symbol successfully created!</span><span class="sc">\n</span><span class="st">"</span><span class="op">);</span></span> +<span id="cb54-9"><a href="#cb54-9" aria-hidden="true" tabindex="-1"></a> ZBarcode_Delete<span class="op">(</span>my_symbol<span class="op">);</span></span> +<span id="cb54-10"><a href="#cb54-10" aria-hidden="true" tabindex="-1"></a> <span class="op">}</span></span> +<span id="cb54-11"><a href="#cb54-11" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> <span class="dv">0</span><span class="op">;</span></span> +<span id="cb54-12"><a href="#cb54-12" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span></code></pre></div> +<p>When compiling this code it will need to be linked with the +<code>libzint</code> library using the <code>-lzint</code> option:</p> +<div class="sourceCode" id="cb55"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb55-1"><a href="#cb55-1" aria-hidden="true" tabindex="-1"></a><span class="fu">gcc</span> <span class="at">-o</span> simple simple.c <span class="at">-lzint</span></span></code></pre></div> +<h2 id="encoding-and-saving-to-file">5.2 Encoding and Saving to +File</h2> +<p>To encode data in a barcode use the <code>ZBarcode_Encode()</code> +function. To write the symbol to a file use the +<code>ZBarcode_Print()</code> function. For example the following code +takes a string from the command line and outputs a Code 128 symbol to a +PNG file named <code>"out.png"</code> (or a GIF file +<code>"out.gif"</code> if <code>libpng</code> is not present) in the +current working directory:</p> +<div class="sourceCode" id="cb56"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb56-1"><a href="#cb56-1" aria-hidden="true" tabindex="-1"></a><span class="pp">#include </span><span class="im"><zint.h></span></span> +<span id="cb56-2"><a href="#cb56-2" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> main<span class="op">(</span><span class="dt">int</span> argc<span class="op">,</span> <span class="dt">char</span> <span class="op">**</span>argv<span class="op">)</span></span> +<span id="cb56-3"><a href="#cb56-3" aria-hidden="true" tabindex="-1"></a><span class="op">{</span></span> +<span id="cb56-4"><a href="#cb56-4" aria-hidden="true" tabindex="-1"></a> <span class="kw">struct</span> zint_symbol <span class="op">*</span>my_symbol<span class="op">;</span></span> +<span id="cb56-5"><a href="#cb56-5" aria-hidden="true" tabindex="-1"></a> my_symbol <span class="op">=</span> ZBarcode_Create<span class="op">();</span></span> +<span id="cb56-6"><a href="#cb56-6" aria-hidden="true" tabindex="-1"></a> ZBarcode_Encode<span class="op">(</span>my_symbol<span class="op">,</span> argv<span class="op">[</span><span class="dv">1</span><span class="op">],</span> <span class="dv">0</span><span class="op">);</span></span> +<span id="cb56-7"><a href="#cb56-7" aria-hidden="true" tabindex="-1"></a> ZBarcode_Print<span class="op">(</span>my_symbol<span class="op">,</span> <span class="dv">0</span><span class="op">);</span></span> +<span id="cb56-8"><a href="#cb56-8" aria-hidden="true" tabindex="-1"></a> ZBarcode_Delete<span class="op">(</span>my_symbol<span class="op">);</span></span> +<span id="cb56-9"><a href="#cb56-9" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> <span class="dv">0</span><span class="op">;</span></span> +<span id="cb56-10"><a href="#cb56-10" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span></code></pre></div> +<p>This can also be done in one stage using the +<code>ZBarcode_Encode_and_Print()</code> function as shown in the next +example:</p> +<div class="sourceCode" id="cb57"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb57-1"><a href="#cb57-1" aria-hidden="true" tabindex="-1"></a><span class="pp">#include </span><span class="im"><zint.h></span></span> +<span id="cb57-2"><a href="#cb57-2" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> main<span class="op">(</span><span class="dt">int</span> argc<span class="op">,</span> <span class="dt">char</span> <span class="op">**</span>argv<span class="op">)</span></span> +<span id="cb57-3"><a href="#cb57-3" aria-hidden="true" tabindex="-1"></a><span class="op">{</span></span> +<span id="cb57-4"><a href="#cb57-4" aria-hidden="true" tabindex="-1"></a> <span class="kw">struct</span> zint_symbol <span class="op">*</span>my_symbol<span class="op">;</span></span> +<span id="cb57-5"><a href="#cb57-5" aria-hidden="true" tabindex="-1"></a> my_symbol <span class="op">=</span> ZBarcode_Create<span class="op">();</span></span> +<span id="cb57-6"><a href="#cb57-6" aria-hidden="true" tabindex="-1"></a> ZBarcode_Encode_and_Print<span class="op">(</span>my_symbol<span class="op">,</span> argv<span class="op">[</span><span class="dv">1</span><span class="op">],</span> <span class="dv">0</span><span class="op">,</span> <span class="dv">0</span><span class="op">);</span></span> +<span id="cb57-7"><a href="#cb57-7" aria-hidden="true" tabindex="-1"></a> ZBarcode_Delete<span class="op">(</span>my_symbol<span class="op">);</span></span> +<span id="cb57-8"><a href="#cb57-8" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> <span class="dv">0</span><span class="op">;</span></span> +<span id="cb57-9"><a href="#cb57-9" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span></code></pre></div> +<p>Note that when using the API, the input data is assumed to be 8-bit +binary unless the <code>input_mode</code> member of the +<code>zint_symbol</code> structure is set - see <a +href="#setting-the-input-mode">5.11 Setting the Input Mode</a> for +details.</p> +<h2 id="encoding-and-printing-functions-in-depth">5.3 Encoding and +Printing Functions in Depth</h2> +<p>The functions for encoding and printing barcodes are defined as:</p> +<div class="sourceCode" id="cb58"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb58-1"><a href="#cb58-1" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_Encode<span class="op">(</span><span class="kw">struct</span> zint_symbol <span class="op">*</span>symbol<span class="op">,</span></span> +<span id="cb58-2"><a href="#cb58-2" aria-hidden="true" tabindex="-1"></a> <span class="dt">const</span> <span class="dt">unsigned</span> <span class="dt">char</span> <span class="op">*</span>source<span class="op">,</span> <span class="dt">int</span> length<span class="op">);</span></span> +<span id="cb58-3"><a href="#cb58-3" aria-hidden="true" tabindex="-1"></a></span> +<span id="cb58-4"><a href="#cb58-4" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_Encode_File<span class="op">(</span><span class="kw">struct</span> zint_symbol <span class="op">*</span>symbol<span class="op">,</span></span> +<span id="cb58-5"><a href="#cb58-5" aria-hidden="true" tabindex="-1"></a> <span class="dt">const</span> <span class="dt">char</span> <span class="op">*</span>filename<span class="op">);</span></span> +<span id="cb58-6"><a href="#cb58-6" aria-hidden="true" tabindex="-1"></a></span> +<span id="cb58-7"><a href="#cb58-7" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_Print<span class="op">(</span><span class="kw">struct</span> zint_symbol <span class="op">*</span>symbol<span class="op">,</span> <span class="dt">int</span> rotate_angle<span class="op">);</span></span> +<span id="cb58-8"><a href="#cb58-8" aria-hidden="true" tabindex="-1"></a></span> +<span id="cb58-9"><a href="#cb58-9" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_Encode_and_Print<span class="op">(</span><span class="kw">struct</span> zint_symbol <span class="op">*</span>symbol<span class="op">,</span></span> +<span id="cb58-10"><a href="#cb58-10" aria-hidden="true" tabindex="-1"></a> <span class="dt">const</span> <span class="dt">unsigned</span> <span class="dt">char</span> <span class="op">*</span>source<span class="op">,</span> <span class="dt">int</span> length<span class="op">,</span> <span class="dt">int</span> rotate_angle<span class="op">);</span></span> +<span id="cb58-11"><a href="#cb58-11" aria-hidden="true" tabindex="-1"></a></span> +<span id="cb58-12"><a href="#cb58-12" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_Encode_File_and_Print<span class="op">(</span><span class="kw">struct</span> zint_symbol <span class="op">*</span>symbol<span class="op">,</span></span> +<span id="cb58-13"><a href="#cb58-13" aria-hidden="true" tabindex="-1"></a> <span class="dt">const</span> <span class="dt">char</span> <span class="op">*</span>filename<span class="op">,</span> <span class="dt">int</span> rotate_angle<span class="op">);</span></span></code></pre></div> +<p>In these definitions <code>length</code> can be used to set the +length of the input string. This allows the encoding of <code>NUL</code> +(ASCII 0) characters in those symbologies which allow this. A value of 0 +(or less than 0) will disable this usage and Zint will encode data up to +the first <code>NUL</code> character in the input string, which must be +present.</p> +<p>The <code>rotate_angle</code> value can be used to rotate the image +when outputting. Valid values are 0, 90, 180 and 270.</p> +<p>The <code>ZBarcode_Encode_File()</code> and +<code>ZBarcode_Encode_File_and_Print()</code> functions can be used to +encode data read directly from a text file where the filename is given +in the <code>NUL</code>-terminated <code>filename</code> string. The +special filename <code>"-"</code> (single hyphen) can be used to read +from stdin. Note that on Windows, filenames are assumed to be UTF-8 +encoded.</p> +<p>If printing more than one barcode, the <code>zint_symbol</code> +structure may be re-used by calling the <code>ZBarcode_Clear()</code> +function after each barcode to free any output buffers allocated. The +<code>zint_symbol</code> input members must be reset. To fully restore +<code>zint_symbol</code> to its default state, call +<code>ZBarcode_Reset()</code> instead.</p> +<h2 id="buffering-symbols-in-memory-raster">5.4 Buffering Symbols in +Memory (raster)</h2> +<p>In addition to saving barcode images to file Zint allows you to +access a representation of the resulting bitmap image in memory. The +following functions allow you to do this:</p> +<div class="sourceCode" id="cb59"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb59-1"><a href="#cb59-1" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_Buffer<span class="op">(</span><span class="kw">struct</span> zint_symbol <span class="op">*</span>symbol<span class="op">,</span> <span class="dt">int</span> rotate_angle<span class="op">);</span></span> +<span id="cb59-2"><a href="#cb59-2" aria-hidden="true" tabindex="-1"></a></span> +<span id="cb59-3"><a href="#cb59-3" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_Encode_and_Buffer<span class="op">(</span><span class="kw">struct</span> zint_symbol <span class="op">*</span>symbol<span class="op">,</span></span> +<span id="cb59-4"><a href="#cb59-4" aria-hidden="true" tabindex="-1"></a> <span class="dt">const</span> <span class="dt">unsigned</span> <span class="dt">char</span> <span class="op">*</span>source<span class="op">,</span> <span class="dt">int</span> length<span class="op">,</span> <span class="dt">int</span> rotate_angle<span class="op">);</span></span> +<span id="cb59-5"><a href="#cb59-5" aria-hidden="true" tabindex="-1"></a></span> +<span id="cb59-6"><a href="#cb59-6" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_Encode_File_and_Buffer<span class="op">(</span><span class="kw">struct</span> zint_symbol <span class="op">*</span>symbol<span class="op">,</span></span> +<span id="cb59-7"><a href="#cb59-7" aria-hidden="true" tabindex="-1"></a> <span class="dt">const</span> <span class="dt">char</span> <span class="op">*</span>filename<span class="op">,</span> <span class="dt">int</span> rotate_angle<span class="op">);</span></span></code></pre></div> +<p>The arguments here are the same as above, and rotation and colour +options can be used with the buffer functions in the same way as when +saving to a file. The difference is that instead of saving the image to +a file it is placed in a byte (<code>unsigned char</code>) array pointed +to by the <code>bitmap</code> member, with <code>bitmap_width</code> set +to the number of columns and <code>bitmap_height</code> set to the +number of rows.</p> +<p>The RGB channels are split into 3 consecutive red, green, blue bytes +per pixel, and there are <code>bitmap_width</code> pixels per row and +<code>bitmap_height</code> rows, so the total size of the +<code>bitmap</code> array is +<code>3 * bitmap_width * bitmap_height</code>.</p> +<p>If the background and/or foreground are RGBA then the byte array +<code>alphamap</code> will also be set, with a single alpha value for +each pixel. Its total size will be +<code>bitmap_width * bitmap_height</code>.</p> +<p>The pixel data can be extracted from the array (or arrays) by the +method shown in the example below, where <code>render_rgb()</code> and +<code>render_rgba()</code> are assumed to be functions for drawing an +RGB and RGBA pixel on the screen implemented by the client +application:</p> +<div class="sourceCode" id="cb60"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb60-1"><a href="#cb60-1" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> row<span class="op">,</span> col<span class="op">,</span> i <span class="op">=</span> <span class="dv">0</span><span class="op">,</span> j <span class="op">=</span> <span class="dv">0</span><span class="op">;</span></span> +<span id="cb60-2"><a href="#cb60-2" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> red<span class="op">,</span> blue<span class="op">,</span> green<span class="op">,</span> alpha<span class="op">;</span></span> +<span id="cb60-3"><a href="#cb60-3" aria-hidden="true" tabindex="-1"></a></span> +<span id="cb60-4"><a href="#cb60-4" aria-hidden="true" tabindex="-1"></a><span class="cf">for</span> <span class="op">(</span>row <span class="op">=</span> <span class="dv">0</span><span class="op">;</span> row <span class="op"><</span> my_symbol<span class="op">-></span>bitmap_height<span class="op">;</span> row<span class="op">++)</span> <span class="op">{</span></span> +<span id="cb60-5"><a href="#cb60-5" aria-hidden="true" tabindex="-1"></a> <span class="cf">for</span> <span class="op">(</span>col <span class="op">=</span> <span class="dv">0</span><span class="op">;</span> col <span class="op"><</span> my_symbol<span class="op">-></span>bitmap_width<span class="op">;</span> col<span class="op">++)</span> <span class="op">{</span></span> +<span id="cb60-6"><a href="#cb60-6" aria-hidden="true" tabindex="-1"></a> red <span class="op">=</span> <span class="op">(</span><span class="dt">int</span><span class="op">)</span> my_symbol<span class="op">-></span>bitmap<span class="op">[</span>i<span class="op">];</span></span> +<span id="cb60-7"><a href="#cb60-7" aria-hidden="true" tabindex="-1"></a> green <span class="op">=</span> <span class="op">(</span><span class="dt">int</span><span class="op">)</span> my_symbol<span class="op">-></span>bitmap<span class="op">[</span>i <span class="op">+</span> <span class="dv">1</span><span class="op">];</span></span> +<span id="cb60-8"><a href="#cb60-8" aria-hidden="true" tabindex="-1"></a> blue <span class="op">=</span> <span class="op">(</span><span class="dt">int</span><span class="op">)</span> my_symbol<span class="op">-></span>bitmap<span class="op">[</span>i <span class="op">+</span> <span class="dv">2</span><span class="op">];</span></span> +<span id="cb60-9"><a href="#cb60-9" aria-hidden="true" tabindex="-1"></a> <span class="cf">if</span> <span class="op">(</span>my_symbol<span class="op">-></span>alphamap<span class="op">)</span> <span class="op">{</span></span> +<span id="cb60-10"><a href="#cb60-10" aria-hidden="true" tabindex="-1"></a> alpha <span class="op">=</span> <span class="op">(</span><span class="dt">int</span><span class="op">)</span> my_symbol<span class="op">-></span>alphamap<span class="op">[</span>j<span class="op">];</span></span> +<span id="cb60-11"><a href="#cb60-11" aria-hidden="true" tabindex="-1"></a> render_rgba<span class="op">(</span>row<span class="op">,</span> col<span class="op">,</span> red<span class="op">,</span> green<span class="op">,</span> blue<span class="op">,</span> alpha<span class="op">);</span></span> +<span id="cb60-12"><a href="#cb60-12" aria-hidden="true" tabindex="-1"></a> j<span class="op">++;</span></span> +<span id="cb60-13"><a href="#cb60-13" aria-hidden="true" tabindex="-1"></a> <span class="op">}</span> <span class="cf">else</span> <span class="op">{</span></span> +<span id="cb60-14"><a href="#cb60-14" aria-hidden="true" tabindex="-1"></a> render_rgb<span class="op">(</span>row<span class="op">,</span> col<span class="op">,</span> red<span class="op">,</span> green<span class="op">,</span> blue<span class="op">);</span></span> +<span id="cb60-15"><a href="#cb60-15" aria-hidden="true" tabindex="-1"></a> <span class="op">}</span></span> +<span id="cb60-16"><a href="#cb60-16" aria-hidden="true" tabindex="-1"></a> i <span class="op">+=</span> <span class="dv">3</span><span class="op">;</span></span> +<span id="cb60-17"><a href="#cb60-17" aria-hidden="true" tabindex="-1"></a> <span class="op">}</span></span> +<span id="cb60-18"><a href="#cb60-18" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span></code></pre></div> +<p>Where speed is important, the buffer can be returned instead in a +more compact intermediate form using the output option +<code>OUT_BUFFER_INTERMEDIATE</code>. Here each byte is an ASCII value: +<code>'1'</code> for foreground colour and <code>'0'</code> for +background colour, except for Ultracode, which also uses colour codes: +<code>'W'</code> for white, <code>'C'</code> for cyan, <code>'B'</code> +for blue, <code>'M'</code> for magenta, <code>'R'</code> for red, +<code>'Y'</code> for yellow, <code>'G'</code> for green, and +<code>'K'</code> for black. Alpha values are not reported +(<code>alphamap</code> will always be <code>NULL</code>). The loop for +accessing the data is then:</p> +<div class="sourceCode" id="cb61"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb61-1"><a href="#cb61-1" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> row<span class="op">,</span> col<span class="op">,</span> i <span class="op">=</span> <span class="dv">0</span><span class="op">;</span></span> +<span id="cb61-2"><a href="#cb61-2" aria-hidden="true" tabindex="-1"></a></span> +<span id="cb61-3"><a href="#cb61-3" aria-hidden="true" tabindex="-1"></a><span class="cf">for</span> <span class="op">(</span>row <span class="op">=</span> <span class="dv">0</span><span class="op">;</span> row <span class="op"><</span> my_symbol<span class="op">-></span>bitmap_height<span class="op">;</span> row<span class="op">++)</span> <span class="op">{</span></span> +<span id="cb61-4"><a href="#cb61-4" aria-hidden="true" tabindex="-1"></a> <span class="cf">for</span> <span class="op">(</span>col <span class="op">=</span> <span class="dv">0</span><span class="op">;</span> col <span class="op"><</span> my_symbol<span class="op">-></span>bitmap_width<span class="op">;</span> col<span class="op">++)</span> <span class="op">{</span></span> +<span id="cb61-5"><a href="#cb61-5" aria-hidden="true" tabindex="-1"></a> render_pixel<span class="op">(</span>row<span class="op">,</span> col<span class="op">,</span> my_symbol<span class="op">-></span>bitmap<span class="op">[</span>i<span class="op">]);</span></span> +<span id="cb61-6"><a href="#cb61-6" aria-hidden="true" tabindex="-1"></a> i<span class="op">++;</span></span> +<span id="cb61-7"><a href="#cb61-7" aria-hidden="true" tabindex="-1"></a> <span class="op">}</span></span> +<span id="cb61-8"><a href="#cb61-8" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span></code></pre></div> +<h2 id="buffering-symbols-in-memory-vector">5.5 Buffering Symbols in +Memory (vector)</h2> +<p>Symbols can also be saved to memory in a vector representation as +well as a bitmap one. The following functions, exactly analogous to the +ones above, allow you to do this:</p> +<div class="sourceCode" id="cb62"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb62-1"><a href="#cb62-1" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_Buffer_Vector<span class="op">(</span><span class="kw">struct</span> zint_symbol <span class="op">*</span>symbol<span class="op">,</span> <span class="dt">int</span> rotate_angle<span class="op">);</span></span> +<span id="cb62-2"><a href="#cb62-2" aria-hidden="true" tabindex="-1"></a></span> +<span id="cb62-3"><a href="#cb62-3" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_Encode_and_Buffer_Vector<span class="op">(</span><span class="kw">struct</span> zint_symbol <span class="op">*</span>symbol<span class="op">,</span></span> +<span id="cb62-4"><a href="#cb62-4" aria-hidden="true" tabindex="-1"></a> <span class="dt">const</span> <span class="dt">unsigned</span> <span class="dt">char</span> <span class="op">*</span>source<span class="op">,</span> <span class="dt">int</span> length<span class="op">,</span> <span class="dt">int</span> rotate_angle<span class="op">);</span></span> +<span id="cb62-5"><a href="#cb62-5" aria-hidden="true" tabindex="-1"></a></span> +<span id="cb62-6"><a href="#cb62-6" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_Encode_File_and_Buffer_Vector<span class="op">(</span><span class="kw">struct</span> zint_symbol <span class="op">*</span>symbol<span class="op">,</span></span> +<span id="cb62-7"><a href="#cb62-7" aria-hidden="true" tabindex="-1"></a> <span class="dt">const</span> <span class="dt">char</span> <span class="op">*</span>filename<span class="op">,</span> <span class="dt">int</span> rotate_angle<span class="op">);</span></span></code></pre></div> +<p>Here the <code>vector</code> member is set to point to a +<code>zint_vector</code> header structure which contains pointers to +lists of structures representing the various elements of the barcode: +rectangles, hexagons, strings and circles. To draw the barcode, each of +the element types is iterated in turn, and using the information stored +is drawn by a rendering system. For instance, to draw a barcode using a +rendering system with <code>prepare_canvas()</code>, +<code>draw_rect()</code>, <code>draw_hexagon()</code>, +<code>draw_string()</code>, and <code>draw_circle()</code> routines +available:</p> +<div class="sourceCode" id="cb63"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb63-1"><a href="#cb63-1" aria-hidden="true" tabindex="-1"></a><span class="kw">struct</span> zint_vector_rect <span class="op">*</span>rect<span class="op">;</span></span> +<span id="cb63-2"><a href="#cb63-2" aria-hidden="true" tabindex="-1"></a><span class="kw">struct</span> zint_vector_hexagon <span class="op">*</span>hex<span class="op">;</span></span> +<span id="cb63-3"><a href="#cb63-3" aria-hidden="true" tabindex="-1"></a><span class="kw">struct</span> zint_vector_string <span class="op">*</span>string<span class="op">;</span></span> +<span id="cb63-4"><a href="#cb63-4" aria-hidden="true" tabindex="-1"></a><span class="kw">struct</span> zint_vector_circle <span class="op">*</span>circle<span class="op">;</span></span> +<span id="cb63-5"><a href="#cb63-5" aria-hidden="true" tabindex="-1"></a></span> +<span id="cb63-6"><a href="#cb63-6" aria-hidden="true" tabindex="-1"></a>prepare_canvas<span class="op">(</span>my_symbol<span class="op">-></span>vector<span class="op">-></span>width<span class="op">,</span> my_symbol<span class="op">-></span>vector<span class="op">-></span>height<span class="op">,</span></span> +<span id="cb63-7"><a href="#cb63-7" aria-hidden="true" tabindex="-1"></a> my_symbol<span class="op">-></span>scale<span class="op">,</span> my_symbol<span class="op">-></span>fgcolour<span class="op">,</span> my_symbol<span class="op">-></span>bgcolour<span class="op">,</span></span> +<span id="cb63-8"><a href="#cb63-8" aria-hidden="true" tabindex="-1"></a> rotate_angle<span class="op">);</span></span> +<span id="cb63-9"><a href="#cb63-9" aria-hidden="true" tabindex="-1"></a></span> +<span id="cb63-10"><a href="#cb63-10" aria-hidden="true" tabindex="-1"></a><span class="cf">for</span> <span class="op">(</span>rect <span class="op">=</span> my_symbol<span class="op">-></span>vector<span class="op">-></span>rectangles<span class="op">;</span> rect<span class="op">;</span> rect <span class="op">=</span> rect<span class="op">-></span>next<span class="op">)</span> <span class="op">{</span></span> +<span id="cb63-11"><a href="#cb63-11" aria-hidden="true" tabindex="-1"></a> draw_rect<span class="op">(</span>rect<span class="op">-></span>x<span class="op">,</span> rect<span class="op">-></span>y<span class="op">,</span> rect<span class="op">-></span>width<span class="op">,</span> rect<span class="op">-></span>height<span class="op">,</span></span> +<span id="cb63-12"><a href="#cb63-12" aria-hidden="true" tabindex="-1"></a> rect<span class="op">-></span>colour<span class="op">);</span></span> +<span id="cb63-13"><a href="#cb63-13" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span> +<span id="cb63-14"><a href="#cb63-14" aria-hidden="true" tabindex="-1"></a><span class="cf">for</span> <span class="op">(</span>hex <span class="op">=</span> my_symbol<span class="op">-></span>vector<span class="op">-></span>hexagons<span class="op">;</span> hex<span class="op">;</span> hex <span class="op">=</span> hex<span class="op">-></span>next<span class="op">)</span> <span class="op">{</span></span> +<span id="cb63-15"><a href="#cb63-15" aria-hidden="true" tabindex="-1"></a> draw_hexagon<span class="op">(</span>hex<span class="op">-></span>x<span class="op">,</span> hex<span class="op">-></span>y<span class="op">,</span> hex<span class="op">-></span>diameter<span class="op">,</span> hex<span class="op">-></span>rotation<span class="op">);</span></span> +<span id="cb63-16"><a href="#cb63-16" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span> +<span id="cb63-17"><a href="#cb63-17" aria-hidden="true" tabindex="-1"></a><span class="cf">for</span> <span class="op">(</span>string <span class="op">=</span> my_symbol<span class="op">-></span>vector<span class="op">-></span>strings<span class="op">;</span> string<span class="op">;</span> string <span class="op">=</span> string<span class="op">-></span>next<span class="op">)</span> <span class="op">{</span></span> +<span id="cb63-18"><a href="#cb63-18" aria-hidden="true" tabindex="-1"></a> draw_string<span class="op">(</span>string<span class="op">-></span>x<span class="op">,</span> string<span class="op">-></span>y<span class="op">,</span> string<span class="op">-></span>fsize<span class="op">,</span></span> +<span id="cb63-19"><a href="#cb63-19" aria-hidden="true" tabindex="-1"></a> string<span class="op">-></span>rotation<span class="op">,</span> string<span class="op">-></span>halign<span class="op">,</span></span> +<span id="cb63-20"><a href="#cb63-20" aria-hidden="true" tabindex="-1"></a> string<span class="op">-></span>text<span class="op">,</span> string<span class="op">-></span>length<span class="op">);</span></span> +<span id="cb63-21"><a href="#cb63-21" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span> +<span id="cb63-22"><a href="#cb63-22" aria-hidden="true" tabindex="-1"></a><span class="cf">for</span> <span class="op">(</span>circle <span class="op">=</span> my_symbol<span class="op">-></span>vector<span class="op">-></span>circles<span class="op">;</span> circle<span class="op">;</span> circle <span class="op">=</span> circle<span class="op">-></span>next<span class="op">)</span> <span class="op">{</span></span> +<span id="cb63-23"><a href="#cb63-23" aria-hidden="true" tabindex="-1"></a> draw_circle<span class="op">(</span>circle<span class="op">-></span>x<span class="op">,</span> circle<span class="op">-></span>y<span class="op">,</span> circle<span class="op">-></span>diameter<span class="op">,</span> circle<span class="op">-></span>width<span class="op">);</span></span> +<span id="cb63-24"><a href="#cb63-24" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span></code></pre></div> +<h2 id="buffering-symbols-in-memory-memfile">5.6 Buffering Symbols in +Memory (memfile)</h2> +<p>Symbols can also be stored as “in-memory” file buffers by giving the +<code>BARCODE_MEMORY_FILE</code> option to the +<code>output_options</code> member, which saves the print output to +member <code>memfile</code> instead of to the output file +<code>outfile</code>. The length of the buffer is given in +<code>memfile_size</code>. For instance:</p> +<div class="sourceCode" id="cb64"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb64-1"><a href="#cb64-1" aria-hidden="true" tabindex="-1"></a><span class="pp">#include </span><span class="im"><zint.h></span></span> +<span id="cb64-2"><a href="#cb64-2" aria-hidden="true" tabindex="-1"></a><span class="pp">#include </span><span class="im"><stdio.h></span></span> +<span id="cb64-3"><a href="#cb64-3" aria-hidden="true" tabindex="-1"></a><span class="pp">#include </span><span class="im"><string.h></span></span> +<span id="cb64-4"><a href="#cb64-4" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> main<span class="op">(</span><span class="dt">int</span> argc<span class="op">,</span> <span class="dt">char</span> <span class="op">**</span>argv<span class="op">)</span></span> +<span id="cb64-5"><a href="#cb64-5" aria-hidden="true" tabindex="-1"></a><span class="op">{</span></span> +<span id="cb64-6"><a href="#cb64-6" aria-hidden="true" tabindex="-1"></a> <span class="kw">struct</span> zint_symbol <span class="op">*</span>my_symbol<span class="op">;</span></span> +<span id="cb64-7"><a href="#cb64-7" aria-hidden="true" tabindex="-1"></a> my_symbol <span class="op">=</span> ZBarcode_Create<span class="op">();</span></span> +<span id="cb64-8"><a href="#cb64-8" aria-hidden="true" tabindex="-1"></a> my_symbol<span class="op">-></span>output_options <span class="op">|=</span> BARCODE_MEMORY_FILE<span class="op">;</span></span> +<span id="cb64-9"><a href="#cb64-9" aria-hidden="true" tabindex="-1"></a> <span class="co">/* Only the extension is used, to determine output format */</span></span> +<span id="cb64-10"><a href="#cb64-10" aria-hidden="true" tabindex="-1"></a> strcpy<span class="op">(</span>my_symbol<span class="op">-></span>outfile<span class="op">,</span> <span class="st">"mem.svg"</span><span class="op">);</span></span> +<span id="cb64-11"><a href="#cb64-11" aria-hidden="true" tabindex="-1"></a> ZBarcode_Encode_and_Print<span class="op">(</span>my_symbol<span class="op">,</span> argv<span class="op">[</span><span class="dv">1</span><span class="op">],</span> <span class="dv">0</span><span class="op">,</span> <span class="dv">0</span><span class="op">);</span></span> +<span id="cb64-12"><a href="#cb64-12" aria-hidden="true" tabindex="-1"></a> <span class="co">/* `my_symbol->memfile` now contains the SVG output */</span></span> +<span id="cb64-13"><a href="#cb64-13" aria-hidden="true" tabindex="-1"></a> fwrite<span class="op">(</span>my_symbol<span class="op">-></span>memfile<span class="op">,</span> <span class="dv">1</span><span class="op">,</span> my_symbol<span class="op">-></span>memfile_size<span class="op">,</span> stdout<span class="op">);</span></span> +<span id="cb64-14"><a href="#cb64-14" aria-hidden="true" tabindex="-1"></a> ZBarcode_Delete<span class="op">(</span>my_symbol<span class="op">);</span></span> +<span id="cb64-15"><a href="#cb64-15" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> <span class="dv">0</span><span class="op">;</span></span> +<span id="cb64-16"><a href="#cb64-16" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span></code></pre></div> +<p>will print the SVG output to <code>stdout</code> (the file “mem.svg” +is not created). This is particularly useful for the textual formats EPS +and SVG,<a href="#fn7" class="footnote-ref" id="fnref7" +role="doc-noteref"><sup>7</sup></a> allowing the output to be +manipulated and processed by the client.</p> +<h2 id="setting-options">5.7 Setting Options</h2> +<p>So far our application is not very useful unless we plan to only make +Code 128 symbols and we don’t mind that they only save to +<code>"out.png"</code> (or to memory, as above). As with the CLI +program, of course, these options can be altered. The way this is done +is by altering the contents of the <code>zint_symbol</code> structure +between the creation and encoding stages. The <code>zint_symbol</code> +structure consists of the following members:</p> +<div id="tbl:api_structure_zint_symbol" class="tablenos"> +<table id="tbl:api_structure_zint_symbol" data-tag="$ $"> +<caption><span>Table <span class="math inline"> </span>:</span> API +Structure <code>zint_symbol</code> </caption> +<colgroup> +<col style="width: 26%" /> +<col style="width: 15%" /> +<col style="width: 34%" /> +<col style="width: 23%" /> +</colgroup> +<thead> +<tr> +<th style="text-align: left;">Member Name</th> +<th style="text-align: left;">Type</th> +<th style="text-align: left;">Meaning</th> +<th style="text-align: left;">Default Value</th> +</tr> +</thead> +<tbody> +<tr> +<td style="text-align: left;"><code>symbology</code></td> +<td style="text-align: left;">integer</td> +<td style="text-align: left;">Symbol to use - see <a +href="#specifying-a-symbology">5.9 Specifying a Symbology</a>.</td> +<td style="text-align: left;"><code>BARCODE_CODE128</code></td> +</tr> +<tr> +<td style="text-align: left;"><code>height</code></td> +<td style="text-align: left;">float</td> +<td style="text-align: left;">Symbol height in X-dimensions, excluding +fixed width-to-height symbols.<a href="#fn8" class="footnote-ref" +id="fnref8" role="doc-noteref"><sup>8</sup></a></td> +<td style="text-align: left;">Symbol dependent</td> +</tr> +<tr> +<td style="text-align: left;"><code>scale</code></td> +<td style="text-align: left;">float</td> +<td style="text-align: left;">Scale factor for adjusting size of image +(sets X-dimension).</td> +<td style="text-align: left;">1.0</td> +</tr> +<tr> +<td style="text-align: left;"><code>whitespace_width</code></td> +<td style="text-align: left;">integer</td> +<td style="text-align: left;">Horizontal whitespace width in +X-dimensions.</td> +<td style="text-align: left;">0</td> +</tr> +<tr> +<td style="text-align: left;"><code>whitespace_height</code></td> +<td style="text-align: left;">integer</td> +<td style="text-align: left;">Vertical whitespace height in +X-dimensions.</td> +<td style="text-align: left;">0</td> +</tr> +<tr> +<td style="text-align: left;"><code>border_width</code></td> +<td style="text-align: left;">integer</td> +<td style="text-align: left;">Border width in X-dimensions.</td> +<td style="text-align: left;">0</td> +</tr> +<tr> +<td style="text-align: left;"><code>output_options</code></td> +<td style="text-align: left;">integer</td> +<td style="text-align: left;">Set various output parameters - see <a +href="#adjusting-output-options">5.10 Adjusting Output Options</a>.</td> +<td style="text-align: left;">0 (none)</td> +</tr> +<tr> +<td style="text-align: left;"><code>fgcolour</code></td> +<td style="text-align: left;">character string</td> +<td style="text-align: left;">Foreground (ink) colour as RGB/RGBA +hexadecimal string or <code>"C,M,Y,K"</code> decimal percentages string, +with a terminating <code>NUL</code>.</td> +<td style="text-align: left;"><code>"000000"</code></td> +</tr> +<tr> +<td style="text-align: left;"><code>bgcolour</code></td> +<td style="text-align: left;">character string</td> +<td style="text-align: left;">Background (paper) colour as RGB/RGBA +hexadecimal string or <code>"C,M,Y,K"</code> decimal percentages string, +with a terminating <code>NUL</code>.</td> +<td style="text-align: left;"><code>"ffffff"</code></td> +</tr> +<tr> +<td style="text-align: left;"><code>fgcolor</code></td> +<td style="text-align: left;">pointer</td> +<td style="text-align: left;">Points to fgcolour allowing alternate +spelling.</td> +<td style="text-align: left;"></td> +</tr> +<tr> +<td style="text-align: left;"><code>bgcolor</code></td> +<td style="text-align: left;">pointer</td> +<td style="text-align: left;">Points to bgcolour allowing alternate +spelling.</td> +<td style="text-align: left;"></td> +</tr> +<tr> +<td style="text-align: left;"><code>outfile</code></td> +<td style="text-align: left;">character string</td> +<td style="text-align: left;">Contains the name of the file to output a +resulting barcode symbol to. Must end in <code>.png</code>, +<code>.gif</code>, <code>.bmp</code>, <code>.emf</code>, +<code>.eps</code>, <code>.pcx</code>, <code>.svg</code>, +<code>.tif</code> or <code>.txt</code> followed by a terminating +<code>NUL</code>.<a href="#fn9" class="footnote-ref" id="fnref9" +role="doc-noteref"><sup>9</sup></a></td> +<td style="text-align: left;"><code>"out.png"</code></td> +</tr> +<tr> +<td style="text-align: left;"><code>primary</code></td> +<td style="text-align: left;">character string</td> +<td style="text-align: left;">Primary message data for more complex +symbols, with a terminating <code>NUL</code>.</td> +<td style="text-align: left;"><code>""</code> (empty)</td> +</tr> +<tr> +<td style="text-align: left;"><code>option_1</code></td> +<td style="text-align: left;">integer</td> +<td style="text-align: left;">Symbol specific options.</td> +<td style="text-align: left;">-1</td> +</tr> +<tr> +<td style="text-align: left;"><code>option_2</code></td> +<td style="text-align: left;">integer</td> +<td style="text-align: left;">Symbol specific options.</td> +<td style="text-align: left;">0</td> +</tr> +<tr> +<td style="text-align: left;"><code>option_3</code></td> +<td style="text-align: left;">integer</td> +<td style="text-align: left;">Symbol specific options.</td> +<td style="text-align: left;">0</td> +</tr> +<tr> +<td style="text-align: left;"><code>show_hrt</code></td> +<td style="text-align: left;">integer</td> +<td style="text-align: left;">Set to 0 to hide Human Readable Text +(HRT).</td> +<td style="text-align: left;">1</td> +</tr> +<tr> +<td style="text-align: left;"><code>input_mode</code></td> +<td style="text-align: left;">integer</td> +<td style="text-align: left;">Set encoding of input data - see <a +href="#setting-the-input-mode">5.11 Setting the Input Mode</a>.</td> +<td style="text-align: left;"><code>DATA_MODE</code></td> +</tr> +<tr> +<td style="text-align: left;"><code>eci</code></td> +<td style="text-align: left;">integer</td> +<td style="text-align: left;">Extended Channel Interpretation code.</td> +<td style="text-align: left;">0 (none)</td> +</tr> +<tr> +<td style="text-align: left;"><code>dpmm</code></td> +<td style="text-align: left;">float</td> +<td style="text-align: left;">Resolution of output in dots per mm (BMP, +EMF, PCX, PNG and TIF only).</td> +<td style="text-align: left;">0 (none)</td> +</tr> +<tr> +<td style="text-align: left;"><code>dot_size</code></td> +<td style="text-align: left;">float</td> +<td style="text-align: left;">Diameter of dots used in dotty mode (in +X-dimensions).</td> +<td style="text-align: left;">0.8</td> +</tr> +<tr> +<td style="text-align: left;"><code>text_gap</code></td> +<td style="text-align: left;">float</td> +<td style="text-align: left;">Gap between barcode and text (HRT) in +X-dimensions.</td> +<td style="text-align: left;">1.0</td> +</tr> +<tr> +<td style="text-align: left;"><code>guard_descent</code></td> +<td style="text-align: left;">float</td> +<td style="text-align: left;">Height of guard bar descent (EAN/UPC only) +in X-dimensions.</td> +<td style="text-align: left;">5.0</td> +</tr> +<tr> +<td style="text-align: left;"><code>structapp</code></td> +<td style="text-align: left;">Structured Append structure</td> +<td style="text-align: left;">Mark a symbol as part of a sequence of +symbols.</td> +<td style="text-align: left;">count 0 (disabled)</td> +</tr> +<tr> +<td style="text-align: left;"><code>debug</code></td> +<td style="text-align: left;">integer</td> +<td style="text-align: left;">Debugging flags.</td> +<td style="text-align: left;">0</td> +</tr> +<tr> +<td style="text-align: left;"><code>warn_level</code></td> +<td style="text-align: left;">integer</td> +<td style="text-align: left;">Affects error/warning value returned by +Zint API - see <a href="#handling-errors">5.8 Handling Errors</a>.</td> +<td style="text-align: left;"><code>WARN_DEFAULT</code></td> +</tr> +<tr> +<td style="text-align: left;"><code>text</code></td> +<td style="text-align: left;">unsigned character string</td> +<td style="text-align: left;">Human Readable Text, which usually +consists of input data plus one more check digit. Uses UTF-8 formatting, +with a terminating <code>NUL</code>.</td> +<td style="text-align: left;"><code>""</code> (empty) (output only)</td> +</tr> +<tr> +<td style="text-align: left;"><code>rows</code></td> +<td style="text-align: left;">integer</td> +<td style="text-align: left;">Number of rows used by the symbol.</td> +<td style="text-align: left;">(output only)</td> +</tr> +<tr> +<td style="text-align: left;"><code>width</code></td> +<td style="text-align: left;">integer</td> +<td style="text-align: left;">Width of the generated symbol.</td> +<td style="text-align: left;">(output only)</td> +</tr> +<tr> +<td style="text-align: left;"><code>encoded_data</code></td> +<td style="text-align: left;">array of unsigned character arrays</td> +<td style="text-align: left;">Representation of the encoded data.</td> +<td style="text-align: left;">(output only)</td> +</tr> +<tr> +<td style="text-align: left;"><code>row_height</code></td> +<td style="text-align: left;">array of floats</td> +<td style="text-align: left;">Heights of each row.</td> +<td style="text-align: left;">(output only)</td> +</tr> +<tr> +<td style="text-align: left;"><code>errtxt</code></td> +<td style="text-align: left;">character string</td> +<td style="text-align: left;">Error message in the event that an error +occurred, with a terminating <code>NUL</code> - see <a +href="#handling-errors">5.8 Handling Errors</a>.</td> +<td style="text-align: left;">(output only)</td> +</tr> +<tr> +<td style="text-align: left;"><code>bitmap</code></td> +<td style="text-align: left;">pointer to unsigned character array</td> +<td style="text-align: left;">Pointer to stored bitmap image - see <a +href="#buffering-symbols-in-memory-raster">5.4 Buffering Symbols in +Memory (raster)</a>.</td> +<td style="text-align: left;">(output only)</td> +</tr> +<tr> +<td style="text-align: left;"><code>bitmap_width</code></td> +<td style="text-align: left;">integer</td> +<td style="text-align: left;">Width of stored bitmap image (in pixels) - +see <code>bitmap</code> member.</td> +<td style="text-align: left;">(output only)</td> +</tr> +<tr> +<td style="text-align: left;"><code>bitmap_height</code></td> +<td style="text-align: left;">integer</td> +<td style="text-align: left;">Height of stored bitmap image (in pixels) +- see <code>bitmap</code> member.</td> +<td style="text-align: left;">(output only)</td> +</tr> +<tr> +<td style="text-align: left;"><code>alphamap</code></td> +<td style="text-align: left;">pointer to unsigned character array</td> +<td style="text-align: left;">Pointer to array representing alpha +channel of stored bitmap image (or <code>NULL</code> if no alpha channel +used) - see <code>bitmap</code> member.</td> +<td style="text-align: left;">(output only)</td> +</tr> +<tr> +<td style="text-align: left;"><code>vector</code></td> +<td style="text-align: left;">pointer to vector structure</td> +<td style="text-align: left;">Pointer to vector header containing +pointers to vector elements - see <a +href="#buffering-symbols-in-memory-vector">5.5 Buffering Symbols in +Memory (vector)</a>.</td> +<td style="text-align: left;">(output only)</td> +</tr> +<tr> +<td style="text-align: left;"><code>memfile</code></td> +<td style="text-align: left;">pointer to unsigned character array</td> +<td style="text-align: left;">Pointer to in-memory file buffer if +<code>BARCODE_MEMORY_FILE</code> set in <code>output_options</code> - +see <a href="#buffering-symbols-in-memory-memfile">5.6 Buffering Symbols +in Memory (memfile)</a>.</td> +<td style="text-align: left;">(output only)</td> +</tr> +<tr> +<td style="text-align: left;"><code>memfile_size</code></td> +<td style="text-align: left;">integer</td> +<td style="text-align: left;">Length of in-memory file buffer.</td> +<td style="text-align: left;">(output only)</td> +</tr> +</tbody> +</table> +</div> +<p>To alter these values use the syntax shown in the example below. This +code has the same result as the previous example except the output is +now taller and plotted in green.</p> +<div class="sourceCode" id="cb65"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb65-1"><a href="#cb65-1" aria-hidden="true" tabindex="-1"></a><span class="pp">#include </span><span class="im"><zint.h></span></span> +<span id="cb65-2"><a href="#cb65-2" aria-hidden="true" tabindex="-1"></a><span class="pp">#include </span><span class="im"><string.h></span></span> +<span id="cb65-3"><a href="#cb65-3" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> main<span class="op">(</span><span class="dt">int</span> argc<span class="op">,</span> <span class="dt">char</span> <span class="op">**</span>argv<span class="op">)</span></span> +<span id="cb65-4"><a href="#cb65-4" aria-hidden="true" tabindex="-1"></a><span class="op">{</span></span> +<span id="cb65-5"><a href="#cb65-5" aria-hidden="true" tabindex="-1"></a> <span class="kw">struct</span> zint_symbol <span class="op">*</span>my_symbol<span class="op">;</span></span> +<span id="cb65-6"><a href="#cb65-6" aria-hidden="true" tabindex="-1"></a> my_symbol <span class="op">=</span> ZBarcode_Create<span class="op">();</span></span> +<span id="cb65-7"><a href="#cb65-7" aria-hidden="true" tabindex="-1"></a> strcpy<span class="op">(</span>my_symbol<span class="op">-></span>fgcolour<span class="op">,</span> <span class="st">"00ff00"</span><span class="op">);</span></span> +<span id="cb65-8"><a href="#cb65-8" aria-hidden="true" tabindex="-1"></a> my_symbol<span class="op">-></span>height <span class="op">=</span> <span class="fl">400.0</span><span class="bu">f</span><span class="op">;</span></span> +<span id="cb65-9"><a href="#cb65-9" aria-hidden="true" tabindex="-1"></a> ZBarcode_Encode_and_Print<span class="op">(</span>my_symbol<span class="op">,</span> argv<span class="op">[</span><span class="dv">1</span><span class="op">],</span> <span class="dv">0</span><span class="op">,</span> <span class="dv">0</span><span class="op">);</span></span> +<span id="cb65-10"><a href="#cb65-10" aria-hidden="true" tabindex="-1"></a> ZBarcode_Delete<span class="op">(</span>my_symbol<span class="op">);</span></span> +<span id="cb65-11"><a href="#cb65-11" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> <span class="dv">0</span><span class="op">;</span></span> +<span id="cb65-12"><a href="#cb65-12" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span></code></pre></div> +<p>Note that background removal for all outputs except BMP can be +achieved by setting the background alpha to <code>"00"</code> where the +values for R, G and B will be ignored:</p> +<div class="sourceCode" id="cb66"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb66-1"><a href="#cb66-1" aria-hidden="true" tabindex="-1"></a> strcpy<span class="op">(</span>my_symbol<span class="op">-></span>bgcolour<span class="op">,</span> <span class="st">"55555500"</span><span class="op">);</span></span></code></pre></div> +<p>This is what the CLI option <code>--nobackground</code> does - see <a +href="#using-colour">4.7 Using Colour</a>.</p> +<h2 id="handling-errors">5.8 Handling Errors</h2> +<p>If errors occur during encoding a non-zero integer value is passed +back to the calling application. In addition the <code>errtxt</code> +member is set to a message detailing the nature of the error. The errors +generated by Zint are:</p> +<div id="tbl:api_warnings_errors" class="tablenos"> +<table id="tbl:api_warnings_errors" +data-tag=": API Warning and Error Return Values"> +<caption><span>Table : API Warning and Error Return Values</span> +</caption> +<colgroup> +<col style="width: 39%" /> +<col style="width: 60%" /> +</colgroup> +<thead> +<tr> +<th style="text-align: left;">Return Value</th> +<th style="text-align: left;">Meaning</th> +</tr> +</thead> +<tbody> +<tr> +<td style="text-align: left;"><code>ZINT_WARN_HRT_TRUNCATED</code></td> +<td style="text-align: left;">The Human Readable Text returned in +<code>text</code> was truncated (maximum 255 bytes).</td> +</tr> +<tr> +<td style="text-align: left;"><code>ZINT_WARN_INVALID_OPTION</code></td> +<td style="text-align: left;">One of the values in +<code>zint_struct</code> was set incorrectly but Zint has made a guess +at what it should have been and generated a barcode accordingly.</td> +</tr> +<tr> +<td style="text-align: left;"><code>ZINT_WARN_USES_ECI</code></td> +<td style="text-align: left;">Zint has automatically inserted an ECI +character. The symbol may not be readable with some readers.</td> +</tr> +<tr> +<td style="text-align: left;"><code>ZINT_WARN_NONCOMPLIANT</code></td> +<td style="text-align: left;">The symbol was created but is not +compliant with certain standards set in its specification (e.g. height, +GS1 AI data lengths).</td> +</tr> +<tr> +<td style="text-align: left;"><code>ZINT_ERROR</code></td> +<td style="text-align: left;">Marks the divide between warnings and +errors. For return values greater than or equal to this no symbol (or +only an incomplete symbol) is generated.</td> +</tr> +<tr> +<td style="text-align: left;"><code>ZINT_ERROR_TOO_LONG</code></td> +<td style="text-align: left;">The input data is too long or too short +for the selected symbology. No symbol has been generated.</td> +</tr> +<tr> +<td style="text-align: left;"><code>ZINT_ERROR_INVALID_DATA</code></td> +<td style="text-align: left;">The data to be encoded includes characters +which are not permitted by the selected symbology (e.g. alphabetic +characters in an EAN symbol). No symbol has been generated.</td> +</tr> +<tr> +<td style="text-align: left;"><code>ZINT_ERROR_INVALID_CHECK</code></td> +<td style="text-align: left;">Data with an incorrect check digit has +been entered. No symbol has been generated.</td> +</tr> +<tr> +<td +style="text-align: left;"><code>ZINT_ERROR_INVALID_OPTION</code></td> +<td style="text-align: left;">One of the values in +<code>zint_struct</code> was set incorrectly and Zint was unable (or +unwilling) to guess what it should have been. No symbol has been +generated.</td> +</tr> +<tr> +<td +style="text-align: left;"><code>ZINT_ERROR_ENCODING_PROBLEM</code></td> +<td style="text-align: left;">A problem has occurred during encoding of +the data. This should never happen. Please contact the developer if you +encounter this error.</td> +</tr> +<tr> +<td style="text-align: left;"><code>ZINT_ERROR_FILE_ACCESS</code></td> +<td style="text-align: left;">Zint was unable to open the requested +output file. This is usually a file permissions problem.</td> +</tr> +<tr> +<td style="text-align: left;"><code>ZINT_ERROR_MEMORY</code></td> +<td style="text-align: left;">Zint ran out of memory. This should only +be a problem with legacy systems.</td> +</tr> +<tr> +<td style="text-align: left;"><code>ZINT_ERROR_FILE_WRITE</code></td> +<td style="text-align: left;">Zint failed to write all contents to the +requested output file. This should only occur if the output device +becomes full.</td> +</tr> +<tr> +<td style="text-align: left;"><code>ZINT_ERROR_USES_ECI</code></td> +<td style="text-align: left;">Returned if <code>warn_level</code> set to +<code>WARN_FAIL_ALL</code> and <code>ZINT_WARN_USES_ECI</code> +occurs.</td> +</tr> +<tr> +<td style="text-align: left;"><code>ZINT_ERROR_NONCOMPLIANT</code></td> +<td style="text-align: left;">Returned if <code>warn_level</code> set to +<code>WARN_FAIL_ALL</code> and <code>ZINT_WARN_NONCOMPLIANT</code> +occurs.</td> +</tr> +<tr> +<td style="text-align: left;"><code>ZINT_ERROR_HRT_TRUNCATED</code></td> +<td style="text-align: left;">Returned if <code>warn_level</code> set to +<code>WARN_FAIL_ALL</code> and <code>ZINT_WARN_HRT_TRUNCATED</code> +occurs.</td> +</tr> +</tbody> +</table> +</div> +<p>To catch errors use an integer variable as shown in the code +below:</p> +<div class="sourceCode" id="cb67"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb67-1"><a href="#cb67-1" aria-hidden="true" tabindex="-1"></a><span class="pp">#include </span><span class="im"><zint.h></span></span> +<span id="cb67-2"><a href="#cb67-2" aria-hidden="true" tabindex="-1"></a><span class="pp">#include </span><span class="im"><stdio.h></span></span> +<span id="cb67-3"><a href="#cb67-3" aria-hidden="true" tabindex="-1"></a><span class="pp">#include </span><span class="im"><string.h></span></span> +<span id="cb67-4"><a href="#cb67-4" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> main<span class="op">(</span><span class="dt">int</span> argc<span class="op">,</span> <span class="dt">char</span> <span class="op">**</span>argv<span class="op">)</span></span> +<span id="cb67-5"><a href="#cb67-5" aria-hidden="true" tabindex="-1"></a><span class="op">{</span></span> +<span id="cb67-6"><a href="#cb67-6" aria-hidden="true" tabindex="-1"></a> <span class="kw">struct</span> zint_symbol <span class="op">*</span>my_symbol<span class="op">;</span></span> +<span id="cb67-7"><a href="#cb67-7" aria-hidden="true" tabindex="-1"></a> <span class="dt">int</span> error<span class="op">;</span></span> +<span id="cb67-8"><a href="#cb67-8" aria-hidden="true" tabindex="-1"></a> my_symbol <span class="op">=</span> ZBarcode_Create<span class="op">();</span></span> +<span id="cb67-9"><a href="#cb67-9" aria-hidden="true" tabindex="-1"></a> <span class="co">/* Set invalid foreground colour */</span></span> +<span id="cb67-10"><a href="#cb67-10" aria-hidden="true" tabindex="-1"></a> strcpy<span class="op">(</span>my_symbol<span class="op">-></span>fgcolour<span class="op">,</span> <span class="st">"nonsense"</span><span class="op">);</span></span> +<span id="cb67-11"><a href="#cb67-11" aria-hidden="true" tabindex="-1"></a> error <span class="op">=</span> ZBarcode_Encode_and_Print<span class="op">(</span>my_symbol<span class="op">,</span> argv<span class="op">[</span><span class="dv">1</span><span class="op">],</span> <span class="dv">0</span><span class="op">,</span> <span class="dv">0</span><span class="op">);</span></span> +<span id="cb67-12"><a href="#cb67-12" aria-hidden="true" tabindex="-1"></a> <span class="cf">if</span> <span class="op">(</span>error <span class="op">!=</span> <span class="dv">0</span><span class="op">)</span> <span class="op">{</span></span> +<span id="cb67-13"><a href="#cb67-13" aria-hidden="true" tabindex="-1"></a> <span class="co">/* Some warning or error occurred */</span></span> +<span id="cb67-14"><a href="#cb67-14" aria-hidden="true" tabindex="-1"></a> printf<span class="op">(</span><span class="st">"</span><span class="sc">%s\n</span><span class="st">"</span><span class="op">,</span> my_symbol<span class="op">-></span>errtxt<span class="op">);</span></span> +<span id="cb67-15"><a href="#cb67-15" aria-hidden="true" tabindex="-1"></a> <span class="cf">if</span> <span class="op">(</span>error <span class="op">>=</span> ZINT_ERROR<span class="op">)</span> <span class="op">{</span></span> +<span id="cb67-16"><a href="#cb67-16" aria-hidden="true" tabindex="-1"></a> <span class="co">/* Stop now */</span></span> +<span id="cb67-17"><a href="#cb67-17" aria-hidden="true" tabindex="-1"></a> ZBarcode_Delete<span class="op">(</span>my_symbol<span class="op">);</span></span> +<span id="cb67-18"><a href="#cb67-18" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> <span class="dv">1</span><span class="op">;</span></span> +<span id="cb67-19"><a href="#cb67-19" aria-hidden="true" tabindex="-1"></a> <span class="op">}</span></span> +<span id="cb67-20"><a href="#cb67-20" aria-hidden="true" tabindex="-1"></a> <span class="op">}</span></span> +<span id="cb67-21"><a href="#cb67-21" aria-hidden="true" tabindex="-1"></a> <span class="co">/* Otherwise carry on with the rest of the application */</span></span> +<span id="cb67-22"><a href="#cb67-22" aria-hidden="true" tabindex="-1"></a> ZBarcode_Delete<span class="op">(</span>my_symbol<span class="op">);</span></span> +<span id="cb67-23"><a href="#cb67-23" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> <span class="dv">0</span><span class="op">;</span></span> +<span id="cb67-24"><a href="#cb67-24" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span></code></pre></div> +<p>This code will exit with the appropriate message:</p> +<pre><code>Error 881: Malformed foreground RGB colour 'nonsense' (hexadecimal only)</code></pre> +<p>To treat all warnings as errors, set +<code>symbol->warn_level</code> to <code>WARN_FAIL_ALL</code>.</p> +<h2 id="specifying-a-symbology">5.9 Specifying a Symbology</h2> +<p>Symbologies can be specified by number or by name as shown in the +Table <a href="#tbl:barcode_types">: Barcode Types (Symbologies)</a>. +For example</p> +<div class="sourceCode" id="cb69"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb69-1"><a href="#cb69-1" aria-hidden="true" tabindex="-1"></a>symbol<span class="op">-></span>symbology <span class="op">=</span> BARCODE_LOGMARS<span class="op">;</span></span></code></pre></div> +<p>means the same as</p> +<div class="sourceCode" id="cb70"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb70-1"><a href="#cb70-1" aria-hidden="true" tabindex="-1"></a>symbol<span class="op">-></span>symbology <span class="op">=</span> <span class="dv">50</span><span class="op">;</span></span></code></pre></div> +<h2 id="adjusting-output-options">5.10 Adjusting Output Options</h2> +<p>The <code>output_options</code> member can be used to adjust various +aspects of the output file. To select more than one option from the +table below simply <code>OR</code> them together when adjusting this +value:</p> +<div class="sourceCode" id="cb71"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb71-1"><a href="#cb71-1" aria-hidden="true" tabindex="-1"></a>my_symbol<span class="op">-></span>output_options <span class="op">|=</span> BARCODE_BIND <span class="op">|</span> READER_INIT<span class="op">;</span></span></code></pre></div> +<div id="tbl:api_output_options" class="tablenos"> +<table id="tbl:api_output_options" data-tag="$ $"> +<caption><span>Table <span class="math inline"> </span>:</span> API +<code>output_options</code> Values </caption> +<colgroup> +<col style="width: 34%" /> +<col style="width: 65%" /> +</colgroup> +<thead> +<tr> +<th style="text-align: left;">Value</th> +<th style="text-align: left;">Effect</th> +</tr> +</thead> +<tbody> +<tr> +<td style="text-align: left;">0</td> +<td style="text-align: left;">No options selected.</td> +</tr> +<tr> +<td style="text-align: left;"><code>BARCODE_BIND_TOP</code></td> +<td style="text-align: left;">Boundary bar above the symbol only.<a +href="#fn10" class="footnote-ref" id="fnref10" +role="doc-noteref"><sup>10</sup></a></td> +</tr> +<tr> +<td style="text-align: left;"><code>BARCODE_BIND</code></td> +<td style="text-align: left;">Boundary bars above and below the symbol +and between rows if stacking multiple symbols.<a href="#fn11" +class="footnote-ref" id="fnref11" +role="doc-noteref"><sup>11</sup></a></td> +</tr> +<tr> +<td style="text-align: left;"><code>BARCODE_BOX</code></td> +<td style="text-align: left;">Add a box surrounding the symbol and +whitespace.</td> +</tr> +<tr> +<td style="text-align: left;"><code>BARCODE_STDOUT</code></td> +<td style="text-align: left;">Output the file to stdout.</td> +</tr> +<tr> +<td style="text-align: left;"><code>READER_INIT</code></td> +<td style="text-align: left;">Create as a Reader Initialisation +(Programming) symbol.</td> +</tr> +<tr> +<td style="text-align: left;"><code>SMALL_TEXT</code></td> +<td style="text-align: left;">Use a smaller font for the Human Readable +Text.</td> +</tr> +<tr> +<td style="text-align: left;"><code>BOLD_TEXT</code></td> +<td style="text-align: left;">Embolden the Human Readable Text.</td> +</tr> +<tr> +<td style="text-align: left;"><code>CMYK_COLOUR</code></td> +<td style="text-align: left;">Select the CMYK colour space option for +Encapsulated PostScript and TIF files.</td> +</tr> +<tr> +<td style="text-align: left;"><code>BARCODE_DOTTY_MODE</code></td> +<td style="text-align: left;">Plot a matrix symbol using dots rather +than squares.</td> +</tr> +<tr> +<td style="text-align: left;"><code>GS1_GS_SEPARATOR</code></td> +<td style="text-align: left;">Use GS (Group Separator) instead of FNC1 +as GS1 separator (Data Matrix only).</td> +</tr> +<tr> +<td style="text-align: left;"><code>OUT_BUFFER_INTERMEDIATE</code></td> +<td style="text-align: left;">Return the bitmap buffer as ASCII values +instead of separate colour channels - see <a +href="#buffering-symbols-in-memory-raster">5.4 Buffering Symbols in +Memory (raster)</a>.</td> +</tr> +<tr> +<td style="text-align: left;"><code>BARCODE_QUIET_ZONES</code></td> +<td style="text-align: left;">Add compliant quiet zones (additional to +any specified whitespace).<a href="#fn12" class="footnote-ref" +id="fnref12" role="doc-noteref"><sup>12</sup></a></td> +</tr> +<tr> +<td style="text-align: left;"><code>BARCODE_NO_QUIET_ZONES</code></td> +<td style="text-align: left;">Disable quiet zones, notably those with +defaults.</td> +</tr> +<tr> +<td style="text-align: left;"><code>COMPLIANT_HEIGHT</code></td> +<td style="text-align: left;">Warn if height specified not compliant, or +use standard height (if any) as default.</td> +</tr> +<tr> +<td style="text-align: left;"><code>EANUPC_GUARD_WHITESPACE</code></td> +<td style="text-align: left;">Add quiet zone indicators (“<” and/or +“>”) to HRT whitespace (EAN/UPC).</td> +</tr> +<tr> +<td style="text-align: left;"><code>EMBED_VECTOR_FONT</code></td> +<td style="text-align: left;">Embed font in vector output - currently +available for SVG output only.</td> +</tr> +<tr> +<td style="text-align: left;"><code>BARCODE_MEMORY_FILE</code></td> +<td style="text-align: left;">Write output to in-memory buffer +<code>symbol->memfile</code> instead of to <code>outfile</code> +file.</td> +</tr> +</tbody> +</table> +</div> +<h2 id="setting-the-input-mode">5.11 Setting the Input Mode</h2> +<p>The way in which the input data is encoded can be set using the +<code>input_mode</code> member. Valid values are shown in the table +below.</p> +<div id="tbl:api_input_mode" class="tablenos"> +<table id="tbl:api_input_mode" data-tag="$ $"> +<caption><span>Table <span class="math inline"> </span>:</span> API +<code>input_mode</code> Values </caption> +<colgroup> +<col style="width: 25%" /> +<col style="width: 74%" /> +</colgroup> +<thead> +<tr> +<th style="text-align: left;">Value</th> +<th style="text-align: left;">Effect</th> +</tr> +</thead> +<tbody> +<tr> +<td style="text-align: left;"><code>DATA_MODE</code></td> +<td style="text-align: left;">Uses full 8-bit range interpreted as +binary data.</td> +</tr> +<tr> +<td style="text-align: left;"><code>UNICODE_MODE</code></td> +<td style="text-align: left;">Uses UTF-8 input.</td> +</tr> +<tr> +<td style="text-align: left;"><code>GS1_MODE</code></td> +<td style="text-align: left;">Encodes GS1 data using FNC1 +characters.</td> +</tr> +<tr> +<td style="text-align: left;"></td> +<td style="text-align: left;"><em>The above are exclusive, the following +optional and OR-ed.</em></td> +</tr> +<tr> +<td style="text-align: left;"><code>ESCAPE_MODE</code></td> +<td style="text-align: left;">Process input data for escape +sequences.</td> +</tr> +<tr> +<td style="text-align: left;"><code>GS1PARENS_MODE</code></td> +<td style="text-align: left;">Parentheses (round brackets) used in GS1 +data instead of square brackets to delimit Application Identifiers +(parentheses must not otherwise occur in the data).</td> +</tr> +<tr> +<td style="text-align: left;"><code>GS1NOCHECK_MODE</code></td> +<td style="text-align: left;">Do not check GS1 data for validity, +i.e. suppress checks for valid AIs and data lengths. Invalid characters +(e.g. control characters, extended ASCII characters) are still checked +for.</td> +</tr> +<tr> +<td style="text-align: left;"><code>HEIGHTPERROW_MODE</code></td> +<td style="text-align: left;">Interpret the <code>height</code> member +as per-row rather than as overall height.</td> +</tr> +<tr> +<td style="text-align: left;"><code>FAST_MODE</code></td> +<td style="text-align: left;">Use faster if less optimal encodation or +other shortcuts if available (affects <code>DATAMATRIX</code>, +<code>MICROPDF417</code>, <code>PDF417</code>, <code>QRCODE</code> and +<code>UPNQR</code> only).</td> +</tr> +<tr> +<td style="text-align: left;"><code>EXTRA_ESCAPE_MODE</code></td> +<td style="text-align: left;">Process special symbology-specific escape +sequences (<code>CODE128</code> only).</td> +</tr> +</tbody> +</table> +</div> +<p>The default mode is <code>DATA_MODE</code>. (Note that this differs +from the default for the CLI and GUI, which is +<code>UNICODE_MODE</code>.)</p> +<p><code>DATA_MODE</code>, <code>UNICODE_MODE</code> and +<code>GS1_MODE</code> are mutually exclusive, whereas +<code>ESCAPE_MODE</code>, <code>GS1PARENS_MODE</code>, +<code>GS1NOCHECK_MODE</code>, <code>HEIGHTPERROW_MODE</code>, +<code>FAST_MODE</code> and <code>EXTRA_ESCAPE_MODE</code> are optional. +So, for example, you can set</p> +<div class="sourceCode" id="cb72"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb72-1"><a href="#cb72-1" aria-hidden="true" tabindex="-1"></a>my_symbol<span class="op">-></span>input_mode <span class="op">=</span> UNICODE_MODE <span class="op">|</span> ESCAPE_MODE<span class="op">;</span></span></code></pre></div> +<p>or</p> +<div class="sourceCode" id="cb73"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb73-1"><a href="#cb73-1" aria-hidden="true" tabindex="-1"></a>my_symbol<span class="op">-></span>input_mode <span class="op">=</span> GS1_MODE <span class="op">|</span> GS1PARENS_MODE <span class="op">|</span> GS1NOCHECK_MODE<span class="op">;</span></span></code></pre></div> +<p>whereas</p> +<div class="sourceCode" id="cb74"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb74-1"><a href="#cb74-1" aria-hidden="true" tabindex="-1"></a>my_symbol<span class="op">-></span>input_mode <span class="op">=</span> DATA_MODE <span class="op">|</span> GS1_MODE<span class="op">;</span></span></code></pre></div> +<p>is not valid.</p> +<p>Permissible escape sequences (<code>ESCAPE_MODE</code>) are listed in +Table <a href="#tbl:escape_sequences">: Escape Sequences</a>, and the +special Code 128-only <code>EXTRA_ESCAPE_MODE</code> escape sequences +are given in <a href="#standard-code-128-iso-15417">6.1.10.1 Standard +Code 128 (ISO 15417)</a>. An example of <code>GS1PARENS_MODE</code> +usage is given in section <a href="#gs1-128">6.1.10.3 GS1-128</a>.</p> +<p><code>GS1NOCHECK_MODE</code> is for use with legacy systems that have +data that does not conform to the current GS1 standard. Printable ASCII +input is still checked for, as is the validity of GS1 data specified +without AIs (e.g. linear data for GS1 DataBar +Omnidirectional/Limited/etc.). Also checked is GS1 DataBar Expanded and +GS1 Composite input that is not in the GS1 encodable character set 82 +(see GS1 General Specifications Figure 7.11.1 ‘GS1 AI encodable +character set 82’), otherwise encodation would fail.</p> +<p>For <code>HEIGHTPERROW_MODE</code>, see <code>--heightperrow</code> +in section <a href="#adjusting-height">4.4 Adjusting Height</a>. The +<code>height</code> member should be set to the desired per-row value on +input (it will be set to the overall height on output).</p> +<p><code>FAST_MODE</code> causes a less optimal encodation scheme to be +used for Data Matrix, MicroPDF417 and PDF417. For QR Code and UPNQR, it +affects Zint’s automatic mask selection - see <a +href="#qr-code-iso-18004">6.6.3 QR Code (ISO 18004)</a> for details.</p> +<h2 id="multiple-segments-1">5.12 Multiple Segments</h2> +<p>For input data requiring multiple ECIs, the following functions may +be used:</p> +<div class="sourceCode" id="cb75"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb75-1"><a href="#cb75-1" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_Encode_Segs<span class="op">(</span><span class="kw">struct</span> zint_symbol <span class="op">*</span>symbol<span class="op">,</span></span> +<span id="cb75-2"><a href="#cb75-2" aria-hidden="true" tabindex="-1"></a> <span class="dt">const</span> <span class="kw">struct</span> zint_seg segs<span class="op">[],</span> <span class="dt">const</span> <span class="dt">int</span> seg_count<span class="op">);</span></span> +<span id="cb75-3"><a href="#cb75-3" aria-hidden="true" tabindex="-1"></a></span> +<span id="cb75-4"><a href="#cb75-4" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_Encode_Segs_and_Print<span class="op">(</span><span class="kw">struct</span> zint_symbol <span class="op">*</span>symbol<span class="op">,</span></span> +<span id="cb75-5"><a href="#cb75-5" aria-hidden="true" tabindex="-1"></a> <span class="dt">const</span> <span class="kw">struct</span> zint_seg segs<span class="op">[],</span> <span class="dt">const</span> <span class="dt">int</span> seg_count<span class="op">,</span> <span class="dt">int</span> rotate_angle<span class="op">);</span></span> +<span id="cb75-6"><a href="#cb75-6" aria-hidden="true" tabindex="-1"></a></span> +<span id="cb75-7"><a href="#cb75-7" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_Encode_Segs_and_Buffer<span class="op">(</span><span class="kw">struct</span> zint_symbol <span class="op">*</span>symbol<span class="op">,</span></span> +<span id="cb75-8"><a href="#cb75-8" aria-hidden="true" tabindex="-1"></a> <span class="dt">const</span> <span class="kw">struct</span> zint_seg segs<span class="op">[],</span> <span class="dt">const</span> <span class="dt">int</span> seg_count<span class="op">,</span> <span class="dt">int</span> rotate_angle<span class="op">);</span></span> +<span id="cb75-9"><a href="#cb75-9" aria-hidden="true" tabindex="-1"></a></span> +<span id="cb75-10"><a href="#cb75-10" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_Encode_Segs_and_Buffer_Vector<span class="op">(</span><span class="kw">struct</span> zint_symbol <span class="op">*</span>symbol<span class="op">,</span></span> +<span id="cb75-11"><a href="#cb75-11" aria-hidden="true" tabindex="-1"></a> <span class="dt">const</span> <span class="kw">struct</span> zint_seg segs<span class="op">[],</span> <span class="dt">const</span> <span class="dt">int</span> seg_count<span class="op">,</span> <span class="dt">int</span> rotate_angle<span class="op">);</span></span></code></pre></div> +<p>These are direct analogues of the previously mentioned +<code>ZBarcode_Encode()</code>, +<code>ZBarcode_Encode_and_Print()</code>, +<code>ZBarcode_Encode_and_Buffer()</code> and +<code>ZBarcode_Encode_and_Buffer_Vector()</code> respectively, where +instead of a pair consisting of <code>"source, length"</code>, a pair +consisting of <code>"segs, seg_count"</code> is given, with +<code>segs</code> being an array of <code>struct zint_seg</code> +segments and <code>seg_count</code> being the number of elements it +contains. The zint_seg structure is of the form:</p> +<div class="sourceCode" id="cb76"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb76-1"><a href="#cb76-1" aria-hidden="true" tabindex="-1"></a><span class="kw">struct</span> zint_seg <span class="op">{</span></span> +<span id="cb76-2"><a href="#cb76-2" aria-hidden="true" tabindex="-1"></a> <span class="dt">unsigned</span> <span class="dt">char</span> <span class="op">*</span>source<span class="op">;</span> <span class="co">/* Data to encode */</span></span> +<span id="cb76-3"><a href="#cb76-3" aria-hidden="true" tabindex="-1"></a> <span class="dt">int</span> length<span class="op">;</span> <span class="co">/* Length of `source`. If 0, `source` must be</span></span> +<span id="cb76-4"><a href="#cb76-4" aria-hidden="true" tabindex="-1"></a><span class="co"> NUL-terminated */</span></span> +<span id="cb76-5"><a href="#cb76-5" aria-hidden="true" tabindex="-1"></a> <span class="dt">int</span> eci<span class="op">;</span> <span class="co">/* Extended Channel Interpretation */</span></span> +<span id="cb76-6"><a href="#cb76-6" aria-hidden="true" tabindex="-1"></a><span class="op">};</span></span></code></pre></div> +<p>The symbology must support ECIs (see Table <a +href="#tbl:eci_aware_symbologies">: ECI-Aware Symbologies</a>). For +example:</p> +<div class="sourceCode" id="cb77"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb77-1"><a href="#cb77-1" aria-hidden="true" tabindex="-1"></a><span class="pp">#include </span><span class="im"><zint.h></span></span> +<span id="cb77-2"><a href="#cb77-2" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> main<span class="op">(</span><span class="dt">int</span> argc<span class="op">,</span> <span class="dt">char</span> <span class="op">**</span>argv<span class="op">)</span></span> +<span id="cb77-3"><a href="#cb77-3" aria-hidden="true" tabindex="-1"></a><span class="op">{</span></span> +<span id="cb77-4"><a href="#cb77-4" aria-hidden="true" tabindex="-1"></a> <span class="kw">struct</span> zint_seg segs<span class="op">[]</span> <span class="op">=</span> <span class="op">{</span></span> +<span id="cb77-5"><a href="#cb77-5" aria-hidden="true" tabindex="-1"></a> <span class="op">{</span> <span class="st">"Κείμενο"</span><span class="op">,</span> <span class="dv">0</span><span class="op">,</span> <span class="dv">9</span> <span class="op">},</span></span> +<span id="cb77-6"><a href="#cb77-6" aria-hidden="true" tabindex="-1"></a> <span class="op">{</span> <span class="st">"Текст"</span><span class="op">,</span> <span class="dv">0</span><span class="op">,</span> <span class="dv">7</span> <span class="op">},</span></span> +<span id="cb77-7"><a href="#cb77-7" aria-hidden="true" tabindex="-1"></a> <span class="op">{</span> <span class="st">"文章"</span><span class="op">,</span> <span class="dv">0</span><span class="op">,</span> <span class="dv">20</span> <span class="op">}</span></span> +<span id="cb77-8"><a href="#cb77-8" aria-hidden="true" tabindex="-1"></a> <span class="op">};</span></span> +<span id="cb77-9"><a href="#cb77-9" aria-hidden="true" tabindex="-1"></a> <span class="kw">struct</span> zint_symbol <span class="op">*</span>my_symbol<span class="op">;</span></span> +<span id="cb77-10"><a href="#cb77-10" aria-hidden="true" tabindex="-1"></a> my_symbol <span class="op">=</span> ZBarcode_Create<span class="op">();</span></span> +<span id="cb77-11"><a href="#cb77-11" aria-hidden="true" tabindex="-1"></a> my_symbol<span class="op">-></span>symbology <span class="op">=</span> BARCODE_AZTEC<span class="op">;</span></span> +<span id="cb77-12"><a href="#cb77-12" aria-hidden="true" tabindex="-1"></a> my_symbol<span class="op">-></span>input_mode <span class="op">=</span> UNICODE_MODE<span class="op">;</span></span> +<span id="cb77-13"><a href="#cb77-13" aria-hidden="true" tabindex="-1"></a> ZBarcode_Encode_Segs<span class="op">(</span>my_symbol<span class="op">,</span> segs<span class="op">,</span> <span class="dv">3</span><span class="op">);</span></span> +<span id="cb77-14"><a href="#cb77-14" aria-hidden="true" tabindex="-1"></a> ZBarcode_Print<span class="op">(</span>my_symbol<span class="op">,</span> <span class="dv">0</span><span class="op">);</span></span> +<span id="cb77-15"><a href="#cb77-15" aria-hidden="true" tabindex="-1"></a> ZBarcode_Delete<span class="op">(</span>my_symbol<span class="op">);</span></span> +<span id="cb77-16"><a href="#cb77-16" aria-hidden="true" tabindex="-1"></a> <span class="cf">return</span> <span class="dv">0</span><span class="op">;</span></span> +<span id="cb77-17"><a href="#cb77-17" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span></code></pre></div> +<p>A maximum of 256 segments may be specified. Use of multiple segments +with GS1 data is not currently supported.</p> +<h2 id="scaling-helpers">5.13 Scaling Helpers</h2> +<p>To help with scaling the output, the following three function are +available:</p> +<div class="sourceCode" id="cb78"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb78-1"><a href="#cb78-1" aria-hidden="true" tabindex="-1"></a><span class="dt">float</span> ZBarcode_Default_Xdim<span class="op">(</span><span class="dt">int</span> symbol_id<span class="op">);</span></span> +<span id="cb78-2"><a href="#cb78-2" aria-hidden="true" tabindex="-1"></a></span> +<span id="cb78-3"><a href="#cb78-3" aria-hidden="true" tabindex="-1"></a><span class="dt">float</span> ZBarcode_Scale_From_XdimDp<span class="op">(</span><span class="dt">int</span> symbol_id<span class="op">,</span> <span class="dt">float</span> x_dim_mm<span class="op">,</span> <span class="dt">float</span> dpmm<span class="op">,</span></span> +<span id="cb78-4"><a href="#cb78-4" aria-hidden="true" tabindex="-1"></a> <span class="dt">const</span> <span class="dt">char</span> <span class="op">*</span>filetype<span class="op">)</span> <span class="op">{</span></span> +<span id="cb78-5"><a href="#cb78-5" aria-hidden="true" tabindex="-1"></a></span> +<span id="cb78-6"><a href="#cb78-6" aria-hidden="true" tabindex="-1"></a><span class="dt">float</span> ZBarcode_XdimDP_From_Scale<span class="op">(</span><span class="dt">int</span> symbol_id<span class="op">,</span> <span class="dt">float</span> scale<span class="op">,</span></span> +<span id="cb78-7"><a href="#cb78-7" aria-hidden="true" tabindex="-1"></a> <span class="dt">float</span> x_dim_mm_or_dpmm<span class="op">,</span> <span class="dt">const</span> <span class="dt">char</span> <span class="op">*</span>filetype<span class="op">);</span></span></code></pre></div> +<p>The first <code>ZBarcode_Default_Xdim()</code> returns the default +X-dimension suggested by Zint for symbology <code>symbol_id</code>.</p> +<p>The second <code>ZBarcode_Scale_From_XdimDp()</code> returns the +scale to use to output to a file of type <code>filetype</code> with +X-dimension <code>x_dim_mm</code> at <code>dpmm</code> dots per mm. The +given X-dimension must be non-zero and less than or equal to 10mm, +however <code>dpmm</code> may be zero and defaults to 12 dpmm, and +<code>filetype</code> may be NULL or empty in which case a GIF filetype +is assumed. For raster output (BMP/GIF/PCX/PNG/TIF) the scale is rounded +to half-integer increments.</p> +<p>For example:</p> +<div class="sourceCode" id="cb79"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb79-1"><a href="#cb79-1" aria-hidden="true" tabindex="-1"></a><span class="co">/* Royal Mail 4-State Customer Code */</span></span> +<span id="cb79-2"><a href="#cb79-2" aria-hidden="true" tabindex="-1"></a>my_symbol<span class="op">-></span>symbology <span class="op">=</span> BARCODE_RM4SCC<span class="op">;</span></span> +<span id="cb79-3"><a href="#cb79-3" aria-hidden="true" tabindex="-1"></a>my_symbol<span class="op">-></span>dpmm <span class="op">=</span> <span class="fl">600.0</span><span class="bu">f</span> <span class="op">/</span> <span class="fl">25.4</span><span class="bu">f</span><span class="op">;</span> <span class="co">/* 600 dpi */</span></span> +<span id="cb79-4"><a href="#cb79-4" aria-hidden="true" tabindex="-1"></a>my_symbol<span class="op">-></span>scale <span class="op">=</span> ZBarcode_Scale_From_XdimDp<span class="op">(</span></span> +<span id="cb79-5"><a href="#cb79-5" aria-hidden="true" tabindex="-1"></a> my_symbol<span class="op">-></span>symbology<span class="op">,</span></span> +<span id="cb79-6"><a href="#cb79-6" aria-hidden="true" tabindex="-1"></a> ZBarcode_Default_Xdim<span class="op">(</span>my_symbol<span class="op">-></span>symbology<span class="op">),</span></span> +<span id="cb79-7"><a href="#cb79-7" aria-hidden="true" tabindex="-1"></a> my_symbol<span class="op">-></span>dpmm<span class="op">,</span> <span class="st">"PNG"</span><span class="op">);</span> <span class="co">/* Returns 7.5 */</span></span></code></pre></div> +<p>The third function <code>ZBarcode_XdimDP_From_Scale()</code> is the +“reverse” of <code>ZBarcode_Scale_From_XdimDp()</code>, returning the +X-dimension (in mm) or the dot density (in dpmm) given a scale +<code>scale</code>. Both <code>scale</code> and +<code>x_dim_mm_or_dpmm</code> must be non-zero. The returned value is +bound to the maximum value of dpmm (1000), so must be further bound to +10 on return if the X-dimension is sought.</p> +<p>Note that the X-dimension to use is application dependent, and varies +not only due to the symbology, resolution and filetype but also due to +the type of scanner used, the intended scanning distance, and what media +(“substrates”) the barcode appears on.</p> +<h2 id="verifying-symbology-availability">5.14 Verifying Symbology +Availability</h2> +<p>An additional function available in the API is:</p> +<div class="sourceCode" id="cb80"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb80-1"><a href="#cb80-1" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_ValidID<span class="op">(</span><span class="dt">int</span> symbol_id<span class="op">);</span></span></code></pre></div> +<p>which allows you to check whether a given symbology is available, +returning a non-zero value if so. For example:</p> +<div class="sourceCode" id="cb81"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb81-1"><a href="#cb81-1" aria-hidden="true" tabindex="-1"></a><span class="cf">if</span> <span class="op">(</span>ZBarcode_ValidID<span class="op">(</span>BARCODE_PDF417<span class="op">)</span> <span class="op">!=</span> <span class="dv">0</span><span class="op">)</span> <span class="op">{</span></span> +<span id="cb81-2"><a href="#cb81-2" aria-hidden="true" tabindex="-1"></a> printf<span class="op">(</span><span class="st">"PDF417 available</span><span class="sc">\n</span><span class="st">"</span><span class="op">);</span></span> +<span id="cb81-3"><a href="#cb81-3" aria-hidden="true" tabindex="-1"></a><span class="op">}</span> <span class="cf">else</span> <span class="op">{</span></span> +<span id="cb81-4"><a href="#cb81-4" aria-hidden="true" tabindex="-1"></a> printf<span class="op">(</span><span class="st">"PDF417 not available</span><span class="sc">\n</span><span class="st">"</span><span class="op">);</span></span> +<span id="cb81-5"><a href="#cb81-5" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span></code></pre></div> +<p>Another function that may be useful is:</p> +<div class="sourceCode" id="cb82"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb82-1"><a href="#cb82-1" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_BarcodeName<span class="op">(</span><span class="dt">int</span> symbol_id<span class="op">,</span> <span class="dt">char</span> name<span class="op">[</span><span class="dv">32</span><span class="op">]);</span></span></code></pre></div> +<p>which copies the name of a symbology into the supplied +<code>name</code> buffer, which should be 32 characters in length. The +name is <code>NUL</code>-terminated, and zero is returned on success. +For instance:</p> +<div class="sourceCode" id="cb83"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb83-1"><a href="#cb83-1" aria-hidden="true" tabindex="-1"></a><span class="dt">char</span> name<span class="op">[</span><span class="dv">32</span><span class="op">];</span></span> +<span id="cb83-2"><a href="#cb83-2" aria-hidden="true" tabindex="-1"></a><span class="cf">if</span> <span class="op">(</span>ZBarcode_BarcodeName<span class="op">(</span>BARCODE_PDF417<span class="op">,</span> name<span class="op">)</span> <span class="op">==</span> <span class="dv">0</span><span class="op">)</span> <span class="op">{</span></span> +<span id="cb83-3"><a href="#cb83-3" aria-hidden="true" tabindex="-1"></a> printf<span class="op">(</span><span class="st">"</span><span class="sc">%s\n</span><span class="st">"</span><span class="op">,</span> name<span class="op">);</span></span> +<span id="cb83-4"><a href="#cb83-4" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span></code></pre></div> +<p>will print <code>BARCODE_PDF417</code>.</p> +<h2 id="checking-symbology-capabilities">5.15 Checking Symbology +Capabilities</h2> +<p>It can be useful for frontend programs to know the capabilities of a +symbology. This can be determined using another additional function:</p> +<div class="sourceCode" id="cb84"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb84-1"><a href="#cb84-1" aria-hidden="true" tabindex="-1"></a><span class="dt">unsigned</span> <span class="dt">int</span> ZBarcode_Cap<span class="op">(</span><span class="dt">int</span> symbol_id<span class="op">,</span> <span class="dt">unsigned</span> <span class="dt">int</span> cap_flag<span class="op">);</span></span></code></pre></div> +<p>by <code>OR</code>-ing the flags below in the <code>cap_flag</code> +argument and checking the return to see which are set.</p> +<div id="tbl:api_cap" class="tablenos"> +<table id="tbl:api_cap" data-tag=": API Capability Flags"> +<caption><span>Table : API Capability Flags</span> </caption> +<colgroup> +<col style="width: 35%" /> +<col style="width: 64%" /> +</colgroup> +<thead> +<tr> +<th style="text-align: left;">Value</th> +<th style="text-align: left;">Meaning</th> +</tr> +</thead> +<tbody> +<tr> +<td style="text-align: left;"><code>ZINT_CAP_HRT</code></td> +<td style="text-align: left;">Can the symbology print Human Readable +Text?</td> +</tr> +<tr> +<td style="text-align: left;"><code>ZINT_CAP_STACKABLE</code></td> +<td style="text-align: left;">Is the symbology stackable?</td> +</tr> +<tr> +<td style="text-align: left;"><code>ZINT_CAP_EANUPC</code><a +href="#fn13" class="footnote-ref" id="fnref13" +role="doc-noteref"><sup>13</sup></a></td> +<td style="text-align: left;">Is the symbology EAN/UPC?</td> +</tr> +<tr> +<td style="text-align: left;"><code>ZINT_CAP_COMPOSITE</code></td> +<td style="text-align: left;">Does the symbology support composite data? +(see <a href="#gs1-composite-symbols-iso-24723">6.3 GS1 Composite +Symbols (ISO 24723)</a> below)</td> +</tr> +<tr> +<td style="text-align: left;"><code>ZINT_CAP_ECI</code></td> +<td style="text-align: left;">Does the symbology support Extended +Channel Interpretations?</td> +</tr> +<tr> +<td style="text-align: left;"><code>ZINT_CAP_GS1</code></td> +<td style="text-align: left;">Does the symbology support GS1 data?</td> +</tr> +<tr> +<td style="text-align: left;"><code>ZINT_CAP_DOTTY</code></td> +<td style="text-align: left;">Can the symbology be outputted as +dots?</td> +</tr> +<tr> +<td style="text-align: left;"><code>ZINT_CAP_QUIET_ZONES</code></td> +<td style="text-align: left;">Does the symbology have default quiet +zones?</td> +</tr> +<tr> +<td style="text-align: left;"><code>ZINT_CAP_FIXED_RATIO</code></td> +<td style="text-align: left;">Does the symbology have a fixed +width-to-height (aspect) ratio?</td> +</tr> +<tr> +<td style="text-align: left;"><code>ZINT_CAP_READER_INIT</code></td> +<td style="text-align: left;">Does the symbology support Reader +Initialisation?</td> +</tr> +<tr> +<td style="text-align: left;"><code>ZINT_CAP_FULL_MULTIBYTE</code></td> +<td style="text-align: left;">Is the <code>ZINT_FULL_MULTIBYTE</code> +option applicable?</td> +</tr> +<tr> +<td style="text-align: left;"><code>ZINT_CAP_MASK</code></td> +<td style="text-align: left;">Is mask selection applicable?</td> +</tr> +<tr> +<td style="text-align: left;"><code>ZINT_CAP_STRUCTAPP</code></td> +<td style="text-align: left;">Does the symbology support Structured +Append?</td> +</tr> +<tr> +<td +style="text-align: left;"><code>ZINT_CAP_COMPLIANT_HEIGHT</code></td> +<td style="text-align: left;">Does the symbology have a compliant height +defined?</td> +</tr> +</tbody> +</table> +</div> +<p>For example:</p> +<div class="sourceCode" id="cb85"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb85-1"><a href="#cb85-1" aria-hidden="true" tabindex="-1"></a><span class="dt">unsigned</span> <span class="dt">int</span> cap<span class="op">;</span></span> +<span id="cb85-2"><a href="#cb85-2" aria-hidden="true" tabindex="-1"></a>cap <span class="op">=</span> ZBarcode_Cap<span class="op">(</span>BARCODE_PDF417<span class="op">,</span> ZINT_CAP_HRT <span class="op">|</span> ZINT_CAP_ECI<span class="op">);</span></span> +<span id="cb85-3"><a href="#cb85-3" aria-hidden="true" tabindex="-1"></a><span class="cf">if</span> <span class="op">(</span>cap <span class="op">&</span> ZINT_CAP_HRT<span class="op">)</span> <span class="op">{</span></span> +<span id="cb85-4"><a href="#cb85-4" aria-hidden="true" tabindex="-1"></a> printf<span class="op">(</span><span class="st">"PDF417 supports HRT</span><span class="sc">\n</span><span class="st">"</span><span class="op">);</span></span> +<span id="cb85-5"><a href="#cb85-5" aria-hidden="true" tabindex="-1"></a><span class="op">}</span> <span class="cf">else</span> <span class="op">{</span></span> +<span id="cb85-6"><a href="#cb85-6" aria-hidden="true" tabindex="-1"></a> printf<span class="op">(</span><span class="st">"PDF417 does not support HRT</span><span class="sc">\n</span><span class="st">"</span><span class="op">);</span></span> +<span id="cb85-7"><a href="#cb85-7" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span> +<span id="cb85-8"><a href="#cb85-8" aria-hidden="true" tabindex="-1"></a><span class="cf">if</span> <span class="op">(</span>cap <span class="op">&</span> ZINT_CAP_ECI<span class="op">)</span> <span class="op">{</span></span> +<span id="cb85-9"><a href="#cb85-9" aria-hidden="true" tabindex="-1"></a> printf<span class="op">(</span><span class="st">"PDF417 supports ECI</span><span class="sc">\n</span><span class="st">"</span><span class="op">);</span></span> +<span id="cb85-10"><a href="#cb85-10" aria-hidden="true" tabindex="-1"></a><span class="op">}</span> <span class="cf">else</span> <span class="op">{</span></span> +<span id="cb85-11"><a href="#cb85-11" aria-hidden="true" tabindex="-1"></a> printf<span class="op">(</span><span class="st">"PDF417 does not support ECI</span><span class="sc">\n</span><span class="st">"</span><span class="op">);</span></span> +<span id="cb85-12"><a href="#cb85-12" aria-hidden="true" tabindex="-1"></a><span class="op">}</span></span></code></pre></div> +<h2 id="zint-version">5.16 Zint Version</h2> +<p>Whether the Zint library linked to was built with PNG support may be +determined with:</p> +<div class="sourceCode" id="cb86"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb86-1"><a href="#cb86-1" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_NoPng<span class="op">();</span></span></code></pre></div> +<p>which returns 1 if no PNG support is available, else zero.</p> +<p>Lastly, the version of the Zint library linked to is returned by:</p> +<div class="sourceCode" id="cb87"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb87-1"><a href="#cb87-1" aria-hidden="true" tabindex="-1"></a><span class="dt">int</span> ZBarcode_Version<span class="op">();</span></span></code></pre></div> +<p>The version parts are separated by hundreds. For instance, version +<code>"2.9.1"</code> is returned as <code>"20901"</code>.</p> +<h1 id="types-of-symbology">6. Types of Symbology</h1> +<h2 id="one-dimensional-symbols">6.1 One-Dimensional Symbols</h2> +<p>One-dimensional or linear symbols are what most people associate with +the term barcode. They consist of a number of bars and a number of +spaces of differing widths.</p> +<h3 id="code-11">6.1.1 Code 11</h3> +<figure> +<img src="images/code11.svg" title="fig:" class="lin" +alt="zint -b CODE11 -d "9212320967"" /> +<figcaption +aria-hidden="true"><code>zint -b CODE11 -d "9212320967"</code></figcaption> +</figure> +<p>Developed by Intermec in 1977, Code 11 is similar to Code 2 of 5 +Matrix and is primarily used in telecommunications. The symbol can +encode data consisting of the digits 0-9 and the dash character +(<code>-</code>) up to a maximum of 140 characters. Two modulo-11 check +digits are added by default. To add just one check digit, set +<code>--vers=1</code> (API <code>option_2 = 1</code>). To add no check +digits, set <code>--vers=2</code> (API <code>option_2 = 2</code>).</p> +<h3 id="code-2-of-5">6.1.2 Code 2 of 5</h3> +<p>Code 2 of 5 is a family of one-dimensional symbols, 8 of which are +supported by Zint. Note that the names given to these standards alters +from one source to another so you should take care to ensure that you +have the right barcode type before using these standards.</p> +<h4 id="standard-code-2-of-5">6.1.2.1 Standard Code 2 of 5</h4> +<figure> +<img src="images/c25standard.svg" title="fig:" class="lin" +alt="zint -b C25STANDARD -d "9212320967"" /> +<figcaption +aria-hidden="true"><code>zint -b C25STANDARD -d "9212320967"</code></figcaption> +</figure> +<p>Also known as Code 2 of 5 Matrix, this is a self-checking code used +in industrial applications and photo development. Standard Code 2 of 5 +will encode numeric input (digits 0-9) up to a maximum of 112 digits. No +check digit is added by default. To add a check digit, set +<code>--vers=1</code> (API <code>option_2 = 1</code>). To add a check +digit but not show it in the Human Readable Text, set +<code>--vers=2</code> (API <code>option_2 = 2</code>).</p> +<h4 id="iata-code-2-of-5">6.1.2.2 IATA Code 2 of 5</h4> +<figure> +<img src="images/c25iata.svg" title="fig:" class="lin" +alt="zint -b C25IATA -d "9212320967"" /> +<figcaption +aria-hidden="true"><code>zint -b C25IATA -d "9212320967"</code></figcaption> +</figure> +<p>Used for baggage handling in the air-transport industry by the +International Air Transport Agency, this self-checking code will encode +numeric input (digits 0-9) up to a maximum of 80 digits. No check digit +is added by default, but can be set the same as for <a +href="#standard-code-2-of-5">6.1.2.1 Standard Code 2 of 5</a>.</p> +<h4 id="industrial-code-2-of-5">6.1.2.3 Industrial Code 2 of 5</h4> +<figure> +<img src="images/c25ind.svg" title="fig:" class="lin" +alt="zint -b C25IND -d "9212320967"" /> +<figcaption +aria-hidden="true"><code>zint -b C25IND -d "9212320967"</code></figcaption> +</figure> +<p>Industrial Code 2 of 5 can encode numeric input (digits 0-9) up to a +maximum of 79 digits. No check digit is added by default, but can be set +the same as for <a href="#standard-code-2-of-5">6.1.2.1 Standard Code 2 +of 5</a>.</p> +<h4 id="interleaved-code-2-of-5-iso-16390">6.1.2.4 Interleaved Code 2 of +5 (ISO 16390)</h4> +<figure> +<img src="images/c25inter.svg" title="fig:" class="lin" +alt="zint -b C25INTER --compliantheight -d "9212320967"" /> +<figcaption +aria-hidden="true"><code>zint -b C25INTER --compliantheight -d "9212320967"</code></figcaption> +</figure> +<p>This self-checking symbology encodes pairs of numbers, and so can +only encode an even number of digits (0-9). If an odd number of digits +is entered a leading zero is added by Zint. A maximum of 62 pairs (124 +digits) can be encoded. No check digit is added by default, but can be +set the same as for <a href="#standard-code-2-of-5">6.1.2.1 Standard +Code 2 of 5</a>.</p> +<h4 id="code-2-of-5-data-logic">6.1.2.5 Code 2 of 5 Data Logic</h4> +<figure> +<img src="images/c25logic.svg" title="fig:" class="lin" +alt="zint -b C25LOGIC -d "9212320967"" /> +<figcaption +aria-hidden="true"><code>zint -b C25LOGIC -d "9212320967"</code></figcaption> +</figure> +<p>Data Logic does not include a check digit by default and can encode +numeric input (digits 0-9) up to a maximum of 113 digits. Check digit +options are the same as for <a href="#standard-code-2-of-5">6.1.2.1 +Standard Code 2 of 5</a>.</p> +<h4 id="itf-14">6.1.2.6 ITF-14</h4> +<figure> +<img src="images/itf14.svg" title="fig:" class="lin" +alt="zint -b ITF14 --compliantheight -d "9212320967145"" /> +<figcaption +aria-hidden="true"><code>zint -b ITF14 --compliantheight -d "9212320967145"</code></figcaption> +</figure> +<p>ITF-14, also known as UPC Shipping Container Symbol or Case Code, is +based on Interleaved Code 2 of 5 and requires a 13-digit numeric input +(digits 0-9). One modulo-10 check digit is added by Zint.</p> +<p>If no border option is specified Zint defaults to adding a bounding +box with a border width of 5. This behaviour can be overridden by using +the <code>--bind</code> option (API +<code>output_options |= BARCODE_BIND</code>). Similarly the border width +can be overridden using <code>--border</code> (API +<code>border_width</code>). If a symbol with no border is required this +can be achieved by explicitly setting the border type to box (or bind or +bindtop) and leaving the border width 0.</p> +<figure> +<img src="images/itf14_border0.svg" title="fig:" class="lin" +alt="zint -b ITF14 --box --compliantheight -d "9212320967145"" /> +<figcaption +aria-hidden="true"><code>zint -b ITF14 --box --compliantheight -d "9212320967145"</code></figcaption> +</figure> +<h4 id="deutsche-post-leitcode">6.1.2.7 Deutsche Post Leitcode</h4> +<figure> +<img src="images/dpleit.svg" title="fig:" class="lin" +alt="zint -b DPLEIT -d "9212320967145"" /> +<figcaption +aria-hidden="true"><code>zint -b DPLEIT -d "9212320967145"</code></figcaption> +</figure> +<p>Leitcode is based on Interleaved Code 2 of 5 and is used by Deutsche +Post for routing purposes. Leitcode requires a 13-digit numerical input +to which Zint adds a check digit.</p> +<h4 id="deutsche-post-identcode">6.1.2.8 Deutsche Post Identcode</h4> +<figure> +<img src="images/dpident.svg" title="fig:" class="lin" +alt="zint -b DPIDENT -d "91232096712"" /> +<figcaption +aria-hidden="true"><code>zint -b DPIDENT -d "91232096712"</code></figcaption> +</figure> +<p>Identcode is based on Interleaved Code 2 of 5 and is used by Deutsche +Post for identification purposes. Identcode requires an 11-digit +numerical input to which Zint adds a check digit.</p> +<h3 id="upc-universal-product-code-iso-15420">6.1.3 UPC (Universal +Product Code) (ISO 15420)</h3> +<h4 id="upc-version-a">6.1.3.1 UPC Version A</h4> +<figure> +<img src="images/upca.svg" title="fig:" class="upcean" +alt="zint -b UPCA --compliantheight -d "72527270270"" /> +<figcaption +aria-hidden="true"><code>zint -b UPCA --compliantheight -d "72527270270"</code></figcaption> +</figure> +<p>UPC-A is used in the United States for retail applications. The +symbol requires an 11-digit article number. The check digit is +calculated by Zint. In addition EAN-2 and EAN-5 add-on symbols can be +added using the + character. For example, to draw a UPC-A symbol with +the data 72527270270 with an EAN-5 add-on showing the data 12345 use the +command:</p> +<div class="sourceCode" id="cb88"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb88-1"><a href="#cb88-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> UPCA <span class="at">-d</span> <span class="st">"72527270270+12345"</span></span></code></pre></div> +<p>or using the API encode a data string with the + character +included:</p> +<div class="sourceCode" id="cb89"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb89-1"><a href="#cb89-1" aria-hidden="true" tabindex="-1"></a>my_symbol<span class="op">-></span>symbology <span class="op">=</span> BARCODE_UPCA<span class="op">;</span></span> +<span id="cb89-2"><a href="#cb89-2" aria-hidden="true" tabindex="-1"></a>error <span class="op">=</span> ZBarcode_Encode_and_Print<span class="op">(</span>my_symbol<span class="op">,</span> <span class="st">"72527270270+12345"</span><span class="op">,</span> <span class="dv">0</span><span class="op">,</span> <span class="dv">0</span><span class="op">);</span></span></code></pre></div> +<figure> +<img src="images/upca_5.svg" title="fig:" class="upcean" +alt="zint -b UPCA --compliantheight -d "72527270270+12345"" /> +<figcaption +aria-hidden="true"><code>zint -b UPCA --compliantheight -d "72527270270+12345"</code></figcaption> +</figure> +<p>If your input data already includes the check digit symbology +<code>BARCODE_UPCA_CHK</code> (35) can be used which takes a 12-digit +input and validates the check digit before encoding.</p> +<p>A quiet zone indicator can be added to the HRT by setting +<code>--guardwhitespace</code> (API +<code>output_options |= EANUPC_GUARD_WHITESPACE</code>). For UPC, this +is only relevant when there is add-on:</p> +<div class="sourceCode" id="cb90"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb90-1"><a href="#cb90-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> UPCA <span class="at">-d</span> <span class="st">"72527270270+12345"</span> <span class="at">--guardwhitespace</span></span></code></pre></div> +<p>or using the API:</p> +<div class="sourceCode" id="cb91"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb91-1"><a href="#cb91-1" aria-hidden="true" tabindex="-1"></a>my_symbol<span class="op">-></span>symbology <span class="op">=</span> BARCODE_UPCA<span class="op">;</span></span> +<span id="cb91-2"><a href="#cb91-2" aria-hidden="true" tabindex="-1"></a>my_symbol<span class="op">-></span>output_options <span class="op">|=</span> EANUPC_GUARD_WHITESPACE<span class="op">;</span></span> +<span id="cb91-3"><a href="#cb91-3" aria-hidden="true" tabindex="-1"></a>error <span class="op">=</span> ZBarcode_Encode_and_Print<span class="op">(</span>my_symbol<span class="op">,</span> <span class="st">"72527270270+12345"</span><span class="op">,</span> <span class="dv">0</span><span class="op">,</span> <span class="dv">0</span><span class="op">);</span></span></code></pre></div> +<figure> +<img src="images/upca_5_gws.svg" title="fig:" class="upcean" +alt="zint -b UPCA --compliantheight -d "72527270270+12345" --guardwhitespace" /> +<figcaption +aria-hidden="true"><code>zint -b UPCA --compliantheight -d "72527270270+12345" --guardwhitespace</code></figcaption> +</figure> +<p>You can adjust the gap between the main symbol and an add-on in +integral multiples of the X-dimension by setting <code>--addongap</code> +(API <code>option_2</code>) to a value between 9 (default) and 12. The +height in X-dimensions that the guard bars descend below the main bars +can be adjusted by setting <code>--guarddescent</code> (API +<code>guard_descent</code>) to a value between 0.0 and 20.0 (default +5.0).</p> +<h4 id="upc-version-e">6.1.3.2 UPC Version E</h4> +<figure> +<img src="images/upce.svg" title="fig:" class="upcean" +alt="zint -b UPCE --compliantheight -d "1123456"" /> +<figcaption +aria-hidden="true"><code>zint -b UPCE --compliantheight -d "1123456"</code></figcaption> +</figure> +<p>UPC-E is a zero-compressed version of UPC-A developed for smaller +packages. The code requires a 6-digit article number (digits 0-9). The +check digit is calculated by Zint. EAN-2 and EAN-5 add-on symbols can be +added using the + character as with UPC-A. In addition Zint also +supports Number System 1 encoding by entering a 7-digit article number +starting with the digit 1. For example:</p> +<div class="sourceCode" id="cb92"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb92-1"><a href="#cb92-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> UPCE <span class="at">-d</span> <span class="st">"1123456"</span></span></code></pre></div> +<p>or</p> +<div class="sourceCode" id="cb93"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb93-1"><a href="#cb93-1" aria-hidden="true" tabindex="-1"></a>my_symbol<span class="op">-></span>symbology <span class="op">=</span> BARCODE_UPCE<span class="op">;</span></span> +<span id="cb93-2"><a href="#cb93-2" aria-hidden="true" tabindex="-1"></a>error <span class="op">=</span> ZBarcode_Encode_and_Print<span class="op">(</span>my_symbol<span class="op">,</span> <span class="st">"1123456"</span><span class="op">,</span> <span class="dv">0</span><span class="op">,</span> <span class="dv">0</span><span class="op">);</span></span></code></pre></div> +<p>If your input data already includes the check digit symbology +<code>BARCODE_UPCE_CHK</code> (38) can be used which takes a 7 or +8-digit input and validates the check digit before encoding.</p> +<p>As with UPC-A, a quiet zone indicator can be added when there is an +add-on by setting <code>--guardwhitespace</code> (API +<code>output_options |= EANUPC_GUARD_WHITESPACE</code>):</p> +<div class="sourceCode" id="cb94"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb94-1"><a href="#cb94-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> UPCE <span class="at">-d</span> <span class="st">"1123456+12"</span> <span class="at">--guardwhitespace</span></span></code></pre></div> +<figure> +<img src="images/upce_2_gws.svg" title="fig:" class="upcean" +alt="zint -b UPCE --compliantheight -d "1123456+12" --guardwhitespace" /> +<figcaption +aria-hidden="true"><code>zint -b UPCE --compliantheight -d "1123456+12" --guardwhitespace</code></figcaption> +</figure> +<p>You can adjust the gap between the main symbol and an add-on in +integral multiples of the X-dimension by setting <code>--addongap</code> +(API <code>option_2</code>) to a value between 7 (default) and 12. The +height in X-dimensions that the guard bars descend below the main bars +can be adjusted by setting <code>--guarddescent</code> (API +<code>guard_descent</code>) to a value between 0.0 and 20.0 (default +5.0).</p> +<h3 id="ean-european-article-number-iso-15420">6.1.4 EAN (European +Article Number) (ISO 15420)</h3> +<h4 id="ean-2-ean-5-ean-8-and-ean-13">6.1.4.1 EAN-2, EAN-5, EAN-8 and +EAN-13</h4> +<figure> +<img src="images/eanx13.svg" title="fig:" class="upcean" +alt="zint -b EANX --compliantheight -d "4512345678906"" /> +<figcaption +aria-hidden="true"><code>zint -b EANX --compliantheight -d "4512345678906"</code></figcaption> +</figure> +<p>The EAN system is used in retail across Europe and includes standards +for EAN-2, EAN-5, EAN-8 and EAN-13 which encode 2, 5, 7 or 12-digit +numbers respectively. Zint will decide which symbology to use depending +on the length of the input data. In addition EAN-2 and EAN-5 add-on +symbols can be added to EAN-8 and EAN-13 symbols using the + character +as with UPC symbols. For example:</p> +<div class="sourceCode" id="cb95"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb95-1"><a href="#cb95-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> EANX <span class="at">-d</span> <span class="st">"54321"</span></span></code></pre></div> +<figure> +<img src="images/eanx5.svg" title="fig:" class="upcean" +alt="zint -b EANX --compliantheight -d "54321"" /> +<figcaption +aria-hidden="true"><code>zint -b EANX --compliantheight -d "54321"</code></figcaption> +</figure> +<p>will encode a stand-alone EAN-5, whereas</p> +<div class="sourceCode" id="cb96"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb96-1"><a href="#cb96-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> EANX <span class="at">-d</span> <span class="st">"7432365+54321"</span></span></code></pre></div> +<p>will encode an EAN-8 symbol with an EAN-5 add-on. As before these +results can be achieved using the API:</p> +<div class="sourceCode" id="cb97"><pre class="sourceCode c"><code class="sourceCode c"><span id="cb97-1"><a href="#cb97-1" aria-hidden="true" tabindex="-1"></a>my_symbol<span class="op">-></span>symbology <span class="op">=</span> BARCODE_EANX<span class="op">;</span></span> +<span id="cb97-2"><a href="#cb97-2" aria-hidden="true" tabindex="-1"></a></span> +<span id="cb97-3"><a href="#cb97-3" aria-hidden="true" tabindex="-1"></a>error <span class="op">=</span> ZBarcode_Encode_and_Print<span class="op">(</span>my_symbol<span class="op">,</span> <span class="st">"54321"</span><span class="op">,</span> <span class="dv">0</span><span class="op">,</span> <span class="dv">0</span><span class="op">);</span></span> +<span id="cb97-4"><a href="#cb97-4" aria-hidden="true" tabindex="-1"></a></span> +<span id="cb97-5"><a href="#cb97-5" aria-hidden="true" tabindex="-1"></a>error <span class="op">=</span> ZBarcode_Encode_and_Print<span class="op">(</span>my_symbol<span class="op">,</span> <span class="st">"7432365+54321"</span><span class="op">,</span> <span class="dv">0</span><span class="op">,</span> <span class="dv">0</span><span class="op">);</span></span></code></pre></div> +<figure> +<img src="images/eanx8_5.svg" title="fig:" class="upcean" +alt="zint -b EANX --compliantheight -d "7432365+54321"" /> +<figcaption +aria-hidden="true"><code>zint -b EANX --compliantheight -d "7432365+54321"</code></figcaption> +</figure> +<p>All of the EAN symbols include check digits which are added by +Zint.</p> +<p>If you are encoding an EAN-8 or EAN-13 symbol and your data already +includes the check digit then you can use symbology +<code>BARCODE_EANX_CHK</code> (14) which takes an 8 or 13-digit input +and validates the check digit before encoding.</p> +<p>Options to add quiet zone indicators and to adjust the add-on gap and +the guard bar descent height are the same as for <a +href="#upc-version-e">6.1.3.2 UPC Version E</a>. For instance:</p> +<div class="sourceCode" id="cb98"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb98-1"><a href="#cb98-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> EANX_CHK <span class="at">-d</span> <span class="st">"74323654"</span> <span class="at">--guardwhitespace</span></span></code></pre></div> +<figure> +<img src="images/eanx8_gws.svg" title="fig:" class="upcean" +alt="zint -b EANX_CHK --compliantheight -d "74323654" –guardwhitespace" /> +<figcaption +aria-hidden="true"><code>zint -b EANX_CHK --compliantheight -d "74323654"</code> +–guardwhitespace</figcaption> +</figure> +<h4 id="sbn-isbn-and-isbn-13">6.1.4.2 SBN, ISBN and ISBN-13</h4> +<figure> +<img src="images/isbnx.svg" title="fig:" class="upcean" +alt="zint -b ISBNX --compliantheight -d "9789295055124"" /> +<figcaption +aria-hidden="true"><code>zint -b ISBNX --compliantheight -d "9789295055124"</code></figcaption> +</figure> +<p>EAN-13 symbols (also known as Bookland EAN-13) can also be produced +from 9-digit SBN, 10-digit ISBN or 13-digit ISBN-13 data. The relevant +check digit needs to be present in the input data and will be verified +before the symbol is generated.</p> +<p>As with EAN-13, a quiet zone indicator can be added using +<code>--guardwhitespace</code>:</p> +<figure> +<img src="images/isbnx_gws.svg" title="fig:" class="upcean" +alt="zint -b ISBNX --compliantheight -d "9789295055124" --guardwhitespace" /> +<figcaption +aria-hidden="true"><code>zint -b ISBNX --compliantheight -d "9789295055124" --guardwhitespace</code></figcaption> +</figure> +<p>EAN-2 and EAN-5 add-on symbols can be added using the + character, +and there are options to adjust the add-on gap and the guard bar descent +height - see <a href="#upc-version-e">6.1.3.2 UPC Version E</a>.</p> +<h3 id="plessey">6.1.5 Plessey</h3> +<h4 id="uk-plessey">6.1.5.1 UK Plessey</h4> +<figure> +<img src="images/plessey.svg" title="fig:" class="lin" +alt="zint -b PLESSEY -d "C64"" /> +<figcaption +aria-hidden="true"><code>zint -b PLESSEY -d "C64"</code></figcaption> +</figure> +<p>Also known as Plessey Code, this symbology was developed by the +Plessey Company Ltd. in the UK. The symbol can encode data consisting of +digits (0-9) or letters A-F up to a maximum of 67 characters and +includes a hidden CRC check digit.</p> +<h4 id="msi-plessey">6.1.5.2 MSI Plessey</h4> +<figure> +<img src="images/msi_plessey.svg" title="fig:" class="lin" +alt="zint -b MSI_PLESSEY -d "6502" --vers=2" /> +<figcaption +aria-hidden="true"><code>zint -b MSI_PLESSEY -d "6502" --vers=2</code></figcaption> +</figure> +<p>Based on Plessey and developed by MSI Data Corporation, MSI Plessey +can encode numeric (digits 0-9) input of up to 92 digits. It has a range +of check digit options that are selectable by setting +<code>--vers</code> (API <code>option_2</code>), shown in the table +below:</p> +<div id="tbl:msi_plessey_check_digits" class="tablenos"> +<table id="tbl:msi_plessey_check_digits" +data-tag=": MSI Plessey Check Digit Options"> +<caption><span>Table : MSI Plessey Check Digit Options</span> +</caption> +<thead> +<tr> +<th>Value</th> +<th style="text-align: left;">Check Digits</th> +</tr> +</thead> +<tbody> +<tr> +<td>0</td> +<td style="text-align: left;">None</td> +</tr> +<tr> +<td>1</td> +<td style="text-align: left;">Modulo-10 (Luhn)</td> +</tr> +<tr> +<td>2</td> +<td style="text-align: left;">Modulo-10 & Modulo-10</td> +</tr> +<tr> +<td>3</td> +<td style="text-align: left;">Modulo-11 (IBM)</td> +</tr> +<tr> +<td>4</td> +<td style="text-align: left;">Modulo-11 (IBM) & Modulo-10</td> +</tr> +<tr> +<td>5</td> +<td style="text-align: left;">Modulo-11 (NCR)</td> +</tr> +<tr> +<td>6</td> +<td style="text-align: left;">Modulo-11 (NCR) & Modulo-10</td> +</tr> +</tbody> +</table> +</div> +<p>To not show the check digit or digits in the Human Readable Text, add +10 to the <code>--vers</code> value. For example <code>--vers=12</code> +(API <code>option_2 = 12</code>) will add two hidden modulo-10 check +digits.</p> +<h3 id="telepen">6.1.6 Telepen</h3> +<h4 id="telepen-alpha">6.1.6.1 Telepen Alpha</h4> +<figure> +<img src="images/telepen.svg" title="fig:" class="lin" +alt="zint -b TELEPEN --compliantheight -d "Z80"" /> +<figcaption +aria-hidden="true"><code>zint -b TELEPEN --compliantheight -d "Z80"</code></figcaption> +</figure> +<p>Telepen Alpha was developed by SB Electronic Systems Limited and can +encode ASCII text input, up to a maximum of 69 characters. Telepen +includes a hidden modulo-127 check digit, added by Zint.</p> +<h4 id="telepen-numeric">6.1.6.2 Telepen Numeric</h4> +<figure> +<img src="images/telepen_num.svg" title="fig:" class="lin" +alt="zint -b TELEPEN_NUM --compliantheight -d "466X33"" /> +<figcaption +aria-hidden="true"><code>zint -b TELEPEN_NUM --compliantheight -d "466X33"</code></figcaption> +</figure> +<p>Telepen Numeric allows compression of numeric data into a Telepen +symbol. Data can consist of pairs of numbers or pairs consisting of a +numerical digit followed an X character. For example: 466333 and 466X33 +are valid codes whereas 46X333 is not (the digit pair <code>"X3"</code> +is not valid). Up to 136 digits can be encoded. Telepen Numeric includes +a hidden modulo-127 check digit which is added by Zint.</p> +<h3 id="code-39">6.1.7 Code 39</h3> +<h4 id="standard-code-39-iso-16388">6.1.7.1 Standard Code 39 (ISO +16388)</h4> +<figure> +<img src="images/code39.svg" title="fig:" class="lin" +alt="zint -b CODE39 --compliantheight -d "1A" --vers=1" /> +<figcaption +aria-hidden="true"><code>zint -b CODE39 --compliantheight -d "1A" --vers=1</code></figcaption> +</figure> +<p>Standard Code 39 was developed in 1974 by Intermec. Input data can be +up to 86 characters in length and can include the characters 0-9, A-Z, +dash (<code>-</code>), full stop (<code>.</code>), space, asterisk +(<code>*</code>), dollar (<code>$</code>), slash (<code>/</code>), plus +(<code>+</code>) and percent (<code>%</code>). The standard does not +require a check digit but a modulo-43 check digit can be added if +desired by setting <code>--vers=1</code> (API +<code>option_2 = 1</code>). To add a check digit but not show it in the +Human Readable Text, set <code>--vers=2</code> (API +<code>option_2 = 2</code>).</p> +<h4 id="extended-code-39">6.1.7.2 Extended Code 39</h4> +<figure> +<img src="images/excode39.svg" title="fig:" class="lin" +alt="zint -b EXCODE39 --compliantheight -d "123.45$@fd"" /> +<figcaption +aria-hidden="true"><code>zint -b EXCODE39 --compliantheight -d "123.45$@fd"</code></figcaption> +</figure> +<p>Also known as Code 39e and Code39+, this symbology expands on +Standard Code 39 to provide support for the full 7-bit ASCII character +set. The check digit options are the same as for <a +href="#standard-code-39-iso-16388">6.1.7.1 Standard Code 39 (ISO +16388)</a>.</p> +<h4 id="code-93">6.1.7.3 Code 93</h4> +<figure> +<img src="images/code93.svg" title="fig:" class="lin" +alt="zint -b CODE93 --compliantheight -d "C93"" /> +<figcaption +aria-hidden="true"><code>zint -b CODE93 --compliantheight -d "C93"</code></figcaption> +</figure> +<p>A variation of Extended Code 39, Code 93 also supports full ASCII +text, accepting up to 123 characters. Two check characters are added by +Zint. By default these check characters are not shown in the Human +Readable Text, but may be shown by setting <code>--vers=1</code> (API +<code>option_2 = 1</code>).</p> +<h4 id="pzn-pharmazentralnummer">6.1.7.4 PZN (Pharmazentralnummer)</h4> +<figure> +<img src="images/pzn.svg" title="fig:" class="lin" +alt="zint -b PZN --compliantheight -d "2758089"" /> +<figcaption +aria-hidden="true"><code>zint -b PZN --compliantheight -d "2758089"</code></figcaption> +</figure> +<p>PZN is a Code 39 based symbology used by the pharmaceutical industry +in Germany. PZN encodes a 7-digit number to which Zint will add a +modulo-11 check digit (PZN8). Input less than 7 digits will be +zero-filled. An 8-digit input can be supplied in which case Zint will +validate the check digit.</p> +<p>To encode a PZN7 (obsolete since 2013) instead set +<code>--vers=1</code> (API <code>option_2 = 1</code>) and supply up to 7 +digits. As with PZN8, a modulo-11 check digit will be added or if 7 +digits supplied the check digit validated.</p> +<h4 id="logmars">6.1.7.5 LOGMARS</h4> +<figure> +<img src="images/logmars.svg" title="fig:" class="lin" +alt="zint -b LOGMARS --compliantheight -d "12345/ABCDE" --vers=1" /> +<figcaption +aria-hidden="true"><code>zint -b LOGMARS --compliantheight -d "12345/ABCDE" --vers=1</code></figcaption> +</figure> +<p>LOGMARS (Logistics Applications of Automated Marking and Reading +Symbols) is a variation of the Code 39 symbology used by the U.S. +Department of Defense. LOGMARS encodes the same character set as <a +href="#standard-code-39-iso-16388">6.1.7.1 Standard Code 39 (ISO +16388)</a>, and the check digit options are also the same. Input is +restricted to a maximum of 30 characters.</p> +<h4 id="code-32">6.1.7.6 Code 32</h4> +<figure> +<img src="images/code32.svg" title="fig:" class="lin" +alt="zint -b CODE32 --compliantheight -d "14352312"" /> +<figcaption +aria-hidden="true"><code>zint -b CODE32 --compliantheight -d "14352312"</code></figcaption> +</figure> +<p>A variation of Code 39 used by the Italian Ministry of Health +(“Ministero della Sanità”) for encoding identifiers on pharmaceutical +products. This symbology requires a numeric input up to 8 digits in +length. A check digit is added by Zint.</p> +<h4 id="hibc-code-39">6.1.7.7 HIBC Code 39</h4> +<figure> +<img src="images/hibc_39.svg" title="fig:" class="lin" +alt="zint -b HIBC_39 --compliantheight -d "14352312"" /> +<figcaption +aria-hidden="true"><code>zint -b HIBC_39 --compliantheight -d "14352312"</code></figcaption> +</figure> +<p>This variant adds a leading <code>'+'</code> character and a trailing +modulo-49 check digit to a standard Code 39 symbol as required by the +Health Industry Barcode standards.</p> +<h4 id="vehicle-identification-number-vin">6.1.7.8 Vehicle +Identification Number (VIN)</h4> +<figure> +<img src="images/vin.svg" title="fig:" class="lin" +alt="zint -b VIN -d "2FTPX28L0XCA15511" --vers=1" /> +<figcaption +aria-hidden="true"><code>zint -b VIN -d "2FTPX28L0XCA15511" --vers=1</code></figcaption> +</figure> +<p>A variation of Code 39 that for vehicle identification numbers used +in North America (first character <code>'1'</code> to <code>'5'</code>) +has a check character verification stage. A 17 character input (0-9, and +A-Z excluding <code>'I'</code>, <code>'O'</code> and <code>'Q'</code>) +is required. An invisible Import character prefix <code>'I'</code> can +be added by setting <code>--vers=1</code> (API +<code>option_2 = 1</code>).</p> +<h3 id="codabar-en-798">6.1.8 Codabar (EN 798)</h3> +<figure> +<img src="images/codabar.svg" title="fig:" class="lin" +alt="zint -b CODABAR --compliantheight -d "A37859B"" /> +<figcaption +aria-hidden="true"><code>zint -b CODABAR --compliantheight -d "A37859B"</code></figcaption> +</figure> +<p>Also known as NW-7, Monarch, ABC Codabar, USD-4, Ames Code and Code +27, this symbology was developed in 1972 by Monarch Marketing Systems +for retail purposes. The American Blood Commission adopted Codabar in +1977 as the standard symbology for blood identification. Codabar can +encode up to 103 characters starting and ending with the letters A-D and +containing between these letters the numbers 0-9, dash (<code>-</code>), +dollar (<code>$</code>), colon (<code>:</code>), slash (<code>/</code>), +full stop (<code>.</code>) or plus (<code>+</code>). No check character +is generated by default, but a modulo-16 one can be added by setting +<code>--vers=1</code> (API <code>option_2 = 1</code>). To have the check +character appear in the Human Readable Text, set <code>--vers=2</code> +(API <code>option_2 = 2</code>).</p> +<h3 id="pharmacode">6.1.9 Pharmacode</h3> +<figure> +<img src="images/pharma.svg" title="fig:" class="lin" +alt="zint -b PHARMA --compliantheight -d "130170"" /> +<figcaption +aria-hidden="true"><code>zint -b PHARMA --compliantheight -d "130170"</code></figcaption> +</figure> +<p>Developed by Laetus, Pharmacode is used for the identification of +pharmaceuticals. The symbology is able to encode whole numbers between 3 +and 131070.</p> +<h3 id="code-128">6.1.10 Code 128</h3> +<h4 id="standard-code-128-iso-15417">6.1.10.1 Standard Code 128 (ISO +15417)</h4> +<figure> +<img src="images/code128.svg" title="fig:" class="lin" +alt="zint -b CODE128 --bind -d "130170X178"" /> +<figcaption +aria-hidden="true"><code>zint -b CODE128 --bind -d "130170X178"</code></figcaption> +</figure> +<p>One of the most ubiquitous one-dimensional barcode symbologies, Code +128 was developed in 1981 by Computer Identics. This symbology supports +full ASCII text and uses a three-Code Set system to compress the data +into a smaller symbol. Zint automatically switches between Code Sets A, +B and C (but see below) and adds a hidden modulo-103 check digit.</p> +<p>Code 128 is the default barcode symbology used by Zint. In addition +Zint supports the encoding of ISO/IEC 8859-1 (non-English) characters in +Code 128 symbols. The ISO/IEC 8859-1 character set is shown in Annex <a +href="#a.2-latin-alphabet-no.-1-isoiec-8859-1">A.2 Latin Alphabet No. 1 +(ISO/IEC 8859-1)</a>.</p> +<p>Manual switching of Code Sets is possible using the +<code>--extraesc</code> option (API +<code>input_mode |= EXTRA_ESCAPE_MODE</code>), which apart from +processing normal escape sequences also processes the Code 128-specific +escapes <code>\^A</code>, <code>\^B</code>, <code>\^C</code> and +<code>\^@</code> (the latter turns off manual Code Set selection). For +instance the following will force switching to Code Set B for the data +<code>"5678"</code> (normally Code Set C would be used throughout):</p> +<div class="sourceCode" id="cb99"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb99-1"><a href="#cb99-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> CODE128 <span class="at">-d</span> <span class="st">"1234\^B5678"</span> <span class="at">--extraesc</span></span></code></pre></div> +<p>The manually selected Code Set will apply until the next Code Set +escape sequence or until a <code>\^@</code>, with the exception that +data that cannot be represented in that Code Set will be switched as +appropriate. If the data contains an extra escape sequence, it can be +escaped by doubling the caret (<code>^</code>). For instance</p> +<div class="sourceCode" id="cb100"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb100-1"><a href="#cb100-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> CODE128 <span class="at">-d</span> <span class="st">"\^AABC\^^BDEF"</span> <span class="at">--extraesc</span></span></code></pre></div> +<p>will encode the data <code>"ABC\^BDEF"</code> in Code Set A.</p> +<p>There is also the extra escape <code>\^1</code>, which will encode a +special Function Code 1 character (FNC1) anywhere you chose in the data, +for instance</p> +<div class="sourceCode" id="cb101"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb101-1"><a href="#cb101-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> CODE128 <span class="at">-d</span> <span class="st">"A\^1BC\^1DEF"</span> <span class="at">--extraesc</span></span></code></pre></div> +<p>Zint can encode a maximum of 102 symbol characters, which allows for +e.g. 202 all-numeric or 101 all-uppercase characters. Sizes above 120 +digits (60 alphanumerics) are not recommended.</p> +<h4 id="code-128-suppress-code-set-c-code-sets-a-and-b-only">6.1.10.2 +Code 128 Suppress Code Set C (Code Sets A and B only)</h4> +<figure> +<img src="images/code128ab.svg" title="fig:" class="lin" +alt="zint -b CODE128AB -d "130170X178"" /> +<figcaption +aria-hidden="true"><code>zint -b CODE128AB -d "130170X178"</code></figcaption> +</figure> +<p>It is sometimes advantageous to stop Code 128 from using Code Set C +which compresses numerical data. The <code>BARCODE_CODE128AB</code><a +href="#fn14" class="footnote-ref" id="fnref14" +role="doc-noteref"><sup>14</sup></a> variant (symbology 60) suppresses +Code Set C in favour of Code Sets A and B.</p> +<p>Note that the special extra escapes mentioned above are not available +for this variant (nor for any other).</p> +<h4 id="gs1-128">6.1.10.3 GS1-128</h4> +<figure> +<img src="images/gs1_128.svg" title="fig:" class="lin" +alt="zint -b GS1_128 --compliantheight -d "[01]98898765432106[3202]012345[15]991231"" /> +<figcaption +aria-hidden="true"><code>zint -b GS1_128 --compliantheight -d "[01]98898765432106[3202]012345[15]991231"</code></figcaption> +</figure> +<p>A variation of Code 128 previously known as UCC/EAN-128, this +symbology is defined by the GS1 General Specifications. Application +Identifiers (AIs) should be entered using [square bracket] notation. +These will be converted to parentheses (round brackets) for the Human +Readable Text. This will allow round brackets to be used in the data +strings to be encoded.</p> +<p>For compatibility with data entry in other systems, if the data does +not include round brackets, the option <code>--gs1parens</code> (API +<code>input_mode |= GS1PARENS_MODE</code>) may be used to signal that +AIs are encased in round brackets instead of square ones.</p> +<p>Fixed length data should be entered at the appropriate length for +correct encoding. GS1-128 does not support extended ASCII (ISO/IEC +8859-1) characters. Check digits for GTIN data AI (01) are not generated +and need to be included in the input data. The following is an example +of a valid GS1-128 input:</p> +<div class="sourceCode" id="cb102"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb102-1"><a href="#cb102-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> 16 <span class="at">-d</span> <span class="st">"[01]98898765432106[3202]012345[15]991231"</span></span></code></pre></div> +<p>or using the <code>--gs1parens</code> option:</p> +<div class="sourceCode" id="cb103"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb103-1"><a href="#cb103-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> 16 <span class="at">--gs1parens</span> <span class="at">-d</span> <span class="st">"(01)98898765432106(3202)012345(15)991231"</span></span></code></pre></div> +<h4 id="ean-14">6.1.10.4 EAN-14</h4> +<figure> +<img src="images/ean14.svg" title="fig:" class="lin" +alt="zint -b EAN14 --compliantheight -d "9889876543210"" /> +<figcaption +aria-hidden="true"><code>zint -b EAN14 --compliantheight -d "9889876543210"</code></figcaption> +</figure> +<p>A shorter version of GS1-128 which encodes GTIN data only. A 13-digit +number is required. The GTIN check digit and HRT-only AI “(01)” are +added by Zint.</p> +<h4 id="nve-18-sscc-18">6.1.10.5 NVE-18 (SSCC-18)</h4> +<figure> +<img src="images/nve18.svg" title="fig:" class="lin" +alt="zint -b NVE18 --compliantheight -d "37612345000001003"" /> +<figcaption +aria-hidden="true"><code>zint -b NVE18 --compliantheight -d "37612345000001003"</code></figcaption> +</figure> +<p>A variation of Code 128 the ‘Nummer der Versandeinheit’ standard, +also known as SSCC-18 (Serial Shipping Container Code), includes both a +visible modulo-10 and a hidden modulo-103 check digit. NVE-18 requires a +17-digit numerical input. Check digits and HRT-only AI “(00)” are added +by Zint.</p> +<h4 id="hibc-code-128">6.1.10.6 HIBC Code 128</h4> +<figure> +<img src="images/hibc_128.svg" title="fig:" class="lin" +alt="zint -b HIBC_128 -d "A123BJC5D6E71"" /> +<figcaption +aria-hidden="true"><code>zint -b HIBC_128 -d "A123BJC5D6E71"</code></figcaption> +</figure> +<p>This option adds a leading <code>'+'</code> character and a trailing +modulo-49 check digit to a standard Code 128 symbol as required by the +Health Industry Barcode standards.</p> +<h4 id="dpd-code">6.1.10.7 DPD Code</h4> +<figure> +<img src="images/dpd.svg" title="fig:" class="lin" +alt="zint -b DPD --compliantheight -d "000393206219912345678101040"" /> +<figcaption +aria-hidden="true"><code>zint -b DPD --compliantheight -d "000393206219912345678101040"</code></figcaption> +</figure> +<p>Another variation of Code 128 as used by DPD (Deutscher Paketdienst). +Requires a 27 or 28 character input. For 28 character input, the first +character is an identification tag (Barcode ID), which should usually be +<code>"%"</code> (ASCII 37). If 27 characters are supplied, +<code>"%"</code> will be prefixed by Zint (except if marked as a +“relabel”, see below). The rest of the 27-character input must be +alphanumeric, and is of the form:</p> +<div id="tbl:dpd_input_fields" class="tablenos"> +<table id="tbl:dpd_input_fields" data-tag=": DPD Input Fields"> +<caption><span>Table : DPD Input Fields</span> </caption> +<colgroup> +<col style="width: 26%" /> +<col style="width: 27%" /> +<col style="width: 16%" /> +<col style="width: 29%" /> +</colgroup> +<thead> +<tr> +<th style="text-align: left;">Destination Post Code</th> +<th style="text-align: left;">Tracking Number</th> +<th style="text-align: left;">Service Code</th> +<th style="text-align: left;">Destination Country Code</th> +</tr> +</thead> +<tbody> +<tr> +<td style="text-align: left;">PPPPPPP (7 alphanumerics)</td> +<td style="text-align: left;">TTTTTTTTTTTTTT (14 alphanumerics)</td> +<td style="text-align: left;">SSS (3 digits)</td> +<td style="text-align: left;">CCC (3-digit ISO 3166-1)</td> +</tr> +</tbody> +</table> +</div> +<p>A warning will be generated if the Service Code, the Destination +Country Code, or the last 10 characters of the Tracking Number are +non-numeric.</p> +<p>Zint formats the Human Readable Text as specified by DPD, leaving out +the identication tag, and adds a modulo-36 check character to the text +(not to the barcode itself), thus:</p> +<p><code>PPPP PPP TTTT TTTT TTTT TT SSS CCC D</code></p> +<p>By default a top boundary bar is added, with default width 3X. The +width can be overridden using <code>--border</code> (API +<code>border_width</code>). For a symbol with no top boundary bar, +explicitly set the border type to bindtop (or bind or box) and leave the +border width 0.</p> +<p>A DPD Code can be marked as a “relabel” by specifying +<code>--vers=1</code> (API <code>option_2 = 1</code>), which omits the +identification tag and prints the barcode at half height. In this case, +an input of 27 alphanumeric characters is required.</p> +<h4 id="upu-s10">6.1.10.8 UPU S10</h4> +<figure> +<img src="images/upu_s10.svg" title="fig:" class="lin" +alt="zint -b UPU_S10 --compliantheight -d "EE876543216CA"" /> +<figcaption +aria-hidden="true"><code>zint -b UPU_S10 --compliantheight -d "EE876543216CA"</code></figcaption> +</figure> +<p>The Universal Postal Union S10 variant of Code 128 encodes 13 +characters in the format <code>"SSNNNNNNNNXCC"</code>, where +<code>"SS"</code> is a two-character alphabetic service indicator, +<code>"NNNNNNNN"</code> is an 8-digit serial number, <code>"X"</code> is +a modulo-11 check digit, and <code>"CC"</code> is a two-character ISO +3166-1 country code.</p> +<p>The check digit may be omitted in which case Zint will add it. +Warnings will be generated if the service indicator is non-standard or +the country code is not ISO 3361-1.</p> +<h3 id="gs1-databar-iso-24724">6.1.11 GS1 DataBar (ISO 24724)</h3> +<p>Previously known as RSS (Reduced Spaced Symbology), these symbols are +due to replace GS1-128 symbols in accordance with the GS1 General +Specifications. If a GS1 DataBar symbol is to be printed with a 2D +component as specified in ISO/IEC 24723 set <code>--mode=2</code> (API +<code>option_1 = 2</code>). See <a +href="#gs1-composite-symbols-iso-24723">6.3 GS1 Composite Symbols (ISO +24723)</a> to find out how to generate DataBar symbols with 2D +components.</p> +<h4 id="gs1-databar-omnidirectional-and-gs1-databar-truncated">6.1.11.1 +GS1 DataBar Omnidirectional and GS1 DataBar Truncated</h4> +<figure> +<img src="images/dbar_omn.svg" title="fig:" class="lin" +alt="zint -b DBAR_OMN --compliantheight -d "0950110153001"" /> +<figcaption +aria-hidden="true"><code>zint -b DBAR_OMN --compliantheight -d "0950110153001"</code></figcaption> +</figure> +<p>Previously known as RSS-14 this standard encodes a 13-digit item +code. A check digit and HRT-only Application Identifier of “(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.)</p> +<p>GS1 DataBar Omnidirectional symbols should have a height of 33 or +greater. To produce a GS1 DataBar Truncated symbol set the symbol height +to a value between 13 and 32. Truncated symbols may not be scannable by +omnidirectional scanners.</p> +<figure> +<img src="images/dbar_truncated.svg" title="fig:" class="lin" +alt="zint -b DBAR_OMN -d "0950110153001" --height=13" /> +<figcaption +aria-hidden="true"><code>zint -b DBAR_OMN -d "0950110153001" --height=13</code></figcaption> +</figure> +<h4 id="gs1-databar-limited">6.1.11.2 GS1 DataBar Limited</h4> +<figure> +<img src="images/dbar_ltd.svg" title="fig:" class="lin" +alt="zint -b DBAR_LTD --compliantheight -d "0950110153001"" /> +<figcaption +aria-hidden="true"><code>zint -b DBAR_LTD --compliantheight -d "0950110153001"</code></figcaption> +</figure> +<p>Previously known as RSS Limited this standard encodes a 13-digit item +code and can be used in the same way as GS1 DataBar Omnidirectional +above. GS1 DataBar Limited, however, is limited to data starting with +digits 0 and 1 (i.e. numbers in the range 0 to 1999999999999). As with +GS1 DataBar Omnidirectional a check digit and HRT-only Application +Identifier of “(01)” are added by Zint, and a 14-digit code may be given +in which case the check digit will be verified.</p> +<h4 id="gs1-databar-expanded">6.1.11.3 GS1 DataBar Expanded</h4> +<figure> +<img src="images/dbar_exp.svg" title="fig:" class="lin" +alt="zint -b DBAR_EXP --compliantheight -d "[01]98898765432106[3202]012345[15]991231"" /> +<figcaption +aria-hidden="true"><code>zint -b DBAR_EXP --compliantheight -d "[01]98898765432106[3202]012345[15]991231"</code></figcaption> +</figure> +<p>Previously known as RSS Expanded this is a variable length symbology +capable of encoding data from a number of AIs in a single symbol. AIs +should be encased in [square brackets] in the input data, which will be +converted to parentheses (round brackets) before being included in the +Human Readable Text attached to the symbol. This method allows the +inclusion of parentheses in the data to be encoded. If the data does not +include parentheses, the AIs may alternatively be encased in parentheses +using the <code>--gs1parens</code> switch. See <a +href="#gs1-128">6.1.10.3 GS1-128</a>.</p> +<p>GTIN data AI (01) should also include the check digit data as this is +not calculated by Zint when this symbology is encoded. Fixed length data +should be entered at the appropriate length for correct encoding. The +following is an example of a valid GS1 DataBar Expanded input:</p> +<div class="sourceCode" id="cb104"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb104-1"><a href="#cb104-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> 31 <span class="at">-d</span> <span class="st">"[01]98898765432106[3202]012345[15]991231"</span></span></code></pre></div> +<h3 id="korea-post-barcode">6.1.12 Korea Post Barcode</h3> +<figure> +<img src="images/koreapost.svg" title="fig:" class="lin" +alt="zint -b KOREAPOST -d "923457"" /> +<figcaption +aria-hidden="true"><code>zint -b KOREAPOST -d "923457"</code></figcaption> +</figure> +<p>The Korean Postal Barcode is used to encode a 6-digit number and +includes one check digit.</p> +<h3 id="channel-code">6.1.13 Channel Code</h3> +<figure> +<img src="images/channel.svg" title="fig:" class="lin" +alt="zint -b CHANNEL -d "453678" --compliantheight" /> +<figcaption +aria-hidden="true"><code>zint -b CHANNEL -d "453678" --compliantheight</code></figcaption> +</figure> +<p>A highly compressed symbol for numeric data. The number of channels +in the symbol can be between 3 and 8 and this can be specified by +setting the value of the <code>--vers</code> option (API +<code>option_2</code>). It can also be determined by the length of the +input data: e.g. a three character input string generates a 4 channel +code by default.</p> +<p>The maximum values permitted depend on the number of channels used as +shown in the table below:</p> +<div id="tbl:channel_maxima" class="tablenos"> +<table id="tbl:channel_maxima" data-tag=": Channel Value Ranges"> +<caption><span>Table : Channel Value Ranges</span> </caption> +<thead> +<tr> +<th style="text-align: left;">Channels</th> +<th style="text-align: left;">Minimum Value</th> +<th style="text-align: left;">Maximum Value</th> +</tr> +</thead> +<tbody> +<tr> +<td style="text-align: left;">3</td> +<td style="text-align: left;">00</td> +<td style="text-align: left;">26</td> +</tr> +<tr> +<td style="text-align: left;">4</td> +<td style="text-align: left;">000</td> +<td style="text-align: left;">292</td> +</tr> +<tr> +<td style="text-align: left;">5</td> +<td style="text-align: left;">0000</td> +<td style="text-align: left;">3493</td> +</tr> +<tr> +<td style="text-align: left;">6</td> +<td style="text-align: left;">00000</td> +<td style="text-align: left;">44072</td> +</tr> +<tr> +<td style="text-align: left;">7</td> +<td style="text-align: left;">000000</td> +<td style="text-align: left;">576688</td> +</tr> +<tr> +<td style="text-align: left;">8</td> +<td style="text-align: left;">0000000</td> +<td style="text-align: left;">7742862</td> +</tr> +</tbody> +</table> +</div> +<h3 id="bc412-semi-t1-95">6.1.14 BC412 (SEMI T1-95)</h3> +<figure> +<img src="images/bc412.svg" title="fig:" class="lin" +alt="zint -b BC412 -d "AQ45670" --compliantheight" /> +<figcaption +aria-hidden="true"><code>zint -b BC412 -d "AQ45670" --compliantheight</code></figcaption> +</figure> +<p>Designed by IBM for marking silicon wafers, each BC412 character is +represented by 4 bars of a single size, interleaved with 4 spaces of +varying sizes that total 8 (hence 4 bars in 12). Zint implements the +SEMI T1-95 standard, where input must be alphanumeric, excluding the +letter <code>O</code>, and must be from 7 to 18 characters in length. A +single check character is added by Zint, appearing in the 2nd character +position. Lowercase input is automatically made uppercase.</p> +<h2 id="stacked-symbologies">6.2 Stacked Symbologies</h2> +<h3 id="basic-symbol-stacking">6.2.1 Basic Symbol Stacking</h3> +<p>An early innovation to get more information into a symbol, used +primarily in the vehicle industry, is to simply stack one-dimensional +codes on top of each other. This can be achieved at the command prompt +by giving more than one set of input data. For example</p> +<div class="sourceCode" id="cb105"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb105-1"><a href="#cb105-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-d</span> <span class="st">"This"</span> <span class="at">-d</span> <span class="st">"That"</span></span></code></pre></div> +<p>will draw two Code 128 symbols, one on top of the other. The same +result can be achieved using the API by executing the +<code>ZBarcode_Encode()</code> function more than once on a symbol. For +example:</p> +<div class="sourceCode" id="cb106"><pre +class="sourceCode c"><code class="sourceCode c"><span id="cb106-1"><a href="#cb106-1" aria-hidden="true" tabindex="-1"></a>my_symbol<span class="op">-></span>symbology <span class="op">=</span> BARCODE_CODE128<span class="op">;</span></span> +<span id="cb106-2"><a href="#cb106-2" aria-hidden="true" tabindex="-1"></a></span> +<span id="cb106-3"><a href="#cb106-3" aria-hidden="true" tabindex="-1"></a>error <span class="op">=</span> ZBarcode_Encode<span class="op">(</span>my_symbol<span class="op">,</span> <span class="st">"This"</span><span class="op">,</span> <span class="dv">0</span><span class="op">);</span></span> +<span id="cb106-4"><a href="#cb106-4" aria-hidden="true" tabindex="-1"></a></span> +<span id="cb106-5"><a href="#cb106-5" aria-hidden="true" tabindex="-1"></a>error <span class="op">=</span> ZBarcode_Encode<span class="op">(</span>my_symbol<span class="op">,</span> <span class="st">"That"</span><span class="op">,</span> <span class="dv">0</span><span class="op">);</span></span> +<span id="cb106-6"><a href="#cb106-6" aria-hidden="true" tabindex="-1"></a></span> +<span id="cb106-7"><a href="#cb106-7" aria-hidden="true" tabindex="-1"></a>error <span class="op">=</span> ZBarcode_Print<span class="op">(</span>my_symbol<span class="op">);</span></span></code></pre></div> +<figure> +<img src="images/code128_stacked.svg" title="fig:" class="lin" +alt="zint -d "This" -d "That"" /> +<figcaption +aria-hidden="true"><code>zint -d "This" -d "That"</code></figcaption> +</figure> +<p>Note that the Human Readable Text will be that of the last data, so +it’s best to use the option <code>--notext</code> (API +<code>show_hrt = 0</code>).</p> +<p>The stacked barcode rows can be separated by row separator bars by +specifying <code>--bind</code> (API +<code>output_options |= BARCODE_BIND</code>). The height of the row +separator bars in integral multiples of the X-dimension (minimum and +default 1, maximum 4) can be set by <code>--separator</code> (API +<code>option_3</code>):</p> +<div class="sourceCode" id="cb107"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb107-1"><a href="#cb107-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">--bind</span> <span class="at">--notext</span> <span class="at">--separator</span><span class="op">=</span>2 <span class="at">-d</span> <span class="st">"This"</span> <span class="at">-d</span> <span class="st">"That"</span></span></code></pre></div> +<figure> +<img src="images/code128_stacked_sep2.svg" title="fig:" class="lin" +alt="zint --notext --bind --separator=2 -d "This" -d "That"" /> +<figcaption +aria-hidden="true"><code>zint --notext --bind --separator=2 -d "This" -d "That"</code></figcaption> +</figure> +<p>A more sophisticated method is to use some type of line indexing +which indicates to the barcode reader which order the stacked symbols +should be read in. This is demonstrated by the symbologies below.</p> +<h3 id="codablock-f">6.2.2 Codablock-F</h3> +<figure> +<img src="images/codablockf.svg" title="fig:" class="lin" +alt="zint -b CODABLOCKF -d "CODABLOCK F Symbology" --rows=3" /> +<figcaption +aria-hidden="true"><code>zint -b CODABLOCKF -d "CODABLOCK F Symbology" --rows=3</code></figcaption> +</figure> +<p>This is a stacked symbology based on Code 128 which can encode +Latin-1 data up to a maximum length of 2726 symbol characters, meaning +for instance up to 2726 all ASCII characters, or 5452 all numeric, or up +to 1363 all extended ASCII (ISO/IEC 8859-1).</p> +<p>The width of the Codablock-F symbol can be set using the +<code>--cols</code> option (API <code>option_2</code>), to a value +between 9 and 67. The height (number of rows) can be set using the +<code>--rows</code> option (API <code>option_1</code>), with a maximum +of 44. Zint does not currently support encoding of GS1 data in +Codablock-F symbols.</p> +<p>A separate symbology ID (<code>BARCODE_HIBC_BLOCKF</code>) can be +used to encode Health Industry Barcode (HIBC) data which adds a leading +<code>'+'</code> character and a modulo-49 check digit to the encoded +data.</p> +<h3 id="code-16k-en-12323">6.2.3 Code 16K (EN 12323)</h3> +<figure> +<img src="images/code16k.svg" title="fig:" class="lin" +alt="zint -b CODE16K --compliantheight -d "ab0123456789"" /> +<figcaption +aria-hidden="true"><code>zint -b CODE16K --compliantheight -d "ab0123456789"</code></figcaption> +</figure> +<p>Code 16K uses a Code 128 based system which can stack up to 16 rows +in a block. This gives a maximum data capacity of 77 characters or 154 +numerical digits and includes two modulo-107 check digits. Code 16K also +supports ISO/IEC 8859-1 character encoding in the same manner as Code +128. GS1 data encoding is also supported. The minimum number of rows to +use can be set using the <code>--rows</code> option (API +<code>option_1</code>), with values from 2 to 16.</p> +<h3 id="pdf417-iso-15438">6.2.4 PDF417 (ISO 15438)</h3> +<figure> +<img src="images/pdf417.svg" title="fig:" class="lin" +alt="zint -b PDF417 -d "PDF417"" /> +<figcaption +aria-hidden="true"><code>zint -b PDF417 -d "PDF417"</code></figcaption> +</figure> +<p>Heavily used in the parcel industry, the PDF417 symbology can encode +a vast amount of data into a small space. Zint supports encoding up to +the ISO standard maximum symbol size of 925 codewords which (at error +correction level 0) allows a maximum data size of 1850 text characters, +or 2710 digits.</p> +<p>The width of the generated PDF417 symbol can be specified at the +command line using the <code>--cols</code> switch (API +<code>option_2</code>) followed by a number between 1 and 30, the number +of rows using the <code>--rows</code> switch (API <code>option_3</code>) +followed by a number between 3 and 90, and the amount of error +correction information can be specified by using the +<code>--secure</code> switch (API <code>option_1</code>) followed by a +number between 0 and 8 where the number of codewords used for error +correction is determined by <code>2^(value + 1)</code>. The default +level of error correction is determined by the amount of data being +encoded.</p> +<p>This symbology uses Latin-1 character encoding by default but also +supports the ECI encoding mechanism. A separate symbology ID +(<code>BARCODE_HIBC_PDF</code>) can be used to encode Health Industry +Barcode (HIBC) data.</p> +<p>For a faster but less optimal encoding, the <code>--fast</code> +option (API <code>input_mode |= FAST_MODE</code>) may be used.</p> +<p>PDF417 supports Structured Append of up to 99,999 symbols and an +optional numeric ID of up to 30 digits, which can be set by using the +<code>--structapp</code> option (see <a href="#structured-append">4.17 +Structured Append</a>) (API <code>structapp</code>). The ID consists of +up to 10 triplets, each ranging from <code>"000"</code> to +<code>"899"</code>. For instance <code>"123456789"</code> would be a +valid ID of 3 triplets. However <code>"123456900"</code> would not, as +the last triplet <code>"900"</code> exceeds <code>"899"</code>. The +triplets are 0-filled, for instance <code>"1234"</code> becomes +<code>"123004"</code>. If an ID is not given, no ID is encoded.</p> +<h3 id="compact-pdf417-iso-15438">6.2.5 Compact PDF417 (ISO 15438)</h3> +<figure> +<img src="images/pdf417comp.svg" title="fig:" class="lin" +alt="zint -b PDF417COMP -d "PDF417"" /> +<figcaption +aria-hidden="true"><code>zint -b PDF417COMP -d "PDF417"</code></figcaption> +</figure> +<p>Previously known as Truncated PDF417, Compact PDF417 omits some +per-row overhead to produce a narrower but less robust symbol. Options +are the same as for PDF417 above.</p> +<h3 id="micropdf417-iso-24728">6.2.6 MicroPDF417 (ISO 24728)</h3> +<figure> +<img src="images/micropdf417.svg" title="fig:" class="lin" +alt="zint -b MICROPDF417 -d "12345678"" /> +<figcaption +aria-hidden="true"><code>zint -b MICROPDF417 -d "12345678"</code></figcaption> +</figure> +<p>A variation of the PDF417 standard, MicroPDF417 is intended for +applications where symbol size needs to be kept to a minimum. 34 +predefined symbol sizes are available with 1 - 4 columns and 4 - 44 +rows. The maximum amount a MicroPDF417 symbol can hold is 250 +alphanumeric characters or 366 digits. The amount of error correction +used is dependent on symbol size. The number of columns used can be +determined using the <code>--cols</code> switch (API +<code>option_2</code>) as with PDF417.</p> +<p>This symbology uses Latin-1 character encoding by default but also +supports the ECI encoding mechanism. A separate symbology ID +(<code>BARCODE_HIBC_MICPDF</code>) can be used to encode Health Industry +Barcode (HIBC) data. MicroPDF417 supports <code>FAST_MODE</code> and +Structured Append the same as PDF417, for which see details.</p> +<h3 id="gs1-databar-stacked-iso-24724">6.2.7 GS1 DataBar Stacked (ISO +24724)</h3> +<h4 id="gs1-databar-stacked">6.2.7.1 GS1 DataBar Stacked</h4> +<figure> +<img src="images/dbar_stk.svg" title="fig:" class="lin" +alt="zint -b DBAR_STK --compliantheight -d "9889876543210"" /> +<figcaption +aria-hidden="true"><code>zint -b DBAR_STK --compliantheight -d "9889876543210"</code></figcaption> +</figure> +<p>A stacked variation of the GS1 DataBar Truncated symbol requiring the +same input (see <a +href="#gs1-databar-omnidirectional-and-gs1-databar-truncated">6.1.11.1 +GS1 DataBar Omnidirectional and GS1 DataBar Truncated</a>), this symbol +is the same as the following GS1 DataBar Stacked Omnidirectional symbol +except that its height is reduced and its central separator is a single +row, making it suitable for small items when omnidirectional scanning is +not required. It can be generated with a two-dimensional component to +make a composite symbol.</p> +<h4 id="gs1-databar-stacked-omnidirectional">6.2.7.2 GS1 DataBar Stacked +Omnidirectional</h4> +<figure> +<img src="images/dbar_omnstk.svg" title="fig:" class="lin" +alt="zint -b DBAR_OMNSTK --compliantheight -d "9889876543210"" /> +<figcaption +aria-hidden="true"><code>zint -b DBAR_OMNSTK --compliantheight -d "9889876543210"</code></figcaption> +</figure> +<p>A stacked variation of the GS1 DataBar Omnidirectional symbol +requiring the same input (see <a +href="#gs1-databar-omnidirectional-and-gs1-databar-truncated">6.1.11.1 +GS1 DataBar Omnidirectional and GS1 DataBar Truncated</a>). The data is +encoded in two rows of bars with a central 3-row separator. This symbol +can be generated with a two-dimensional component to make a composite +symbol.</p> +<h4 id="gs1-databar-expanded-stacked">6.2.7.3 GS1 DataBar Expanded +Stacked</h4> +<figure> +<img src="images/dbar_expstk.svg" title="fig:" class="lin" +alt="zint -b DBAR_EXPSTK --compliantheight -d "[01]98898765432106[3202]012345[15]991231"" /> +<figcaption +aria-hidden="true"><code>zint -b DBAR_EXPSTK --compliantheight -d "[01]98898765432106[3202]012345[15]991231"</code></figcaption> +</figure> +<p>A stacked variation of the GS1 DataBar Expanded symbol for smaller +packages. Input is the same as for GS1 DataBar Expanded (see <a +href="#gs1-databar-expanded">6.1.11.3 GS1 DataBar Expanded</a>). In +addition the width of the symbol can be altered using the +<code>--cols</code> switch (API <code>option_2</code>). In this case the +number of columns (values 1 to 11) relates to the number of character +pairs on each row of the symbol. Alternatively the <code>--rows</code> +switch (API <code>option_3</code>) can be used to specify the maximum +number of rows (values 2 to 11), and the number of columns will be +adjusted accordingly. This symbol can be generated with a +two-dimensional component to make a composite symbol. For symbols with a +2D component the number of columns must be at least 2.</p> +<h3 id="code-49">6.2.8 Code 49</h3> +<figure> +<img src="images/code49.svg" title="fig:" class="lin" +alt="zint -b CODE49 --compliantheight -d "MULTIPLE ROWS IN CODE 49"" /> +<figcaption +aria-hidden="true"><code>zint -b CODE49 --compliantheight -d "MULTIPLE ROWS IN CODE 49"</code></figcaption> +</figure> +<p>Developed in 1987 at Intermec, Code 49 is a cross between UPC and +Code 39. It is one of the earliest stacked symbologies and influenced +the design of Code 16K a few years later. It supports full 7-bit ASCII +input up to a maximum of 49 characters or 81 numeric digits. GS1 data +encoding is also supported. The minimum number of rows to use can be set +using the <code>--rows</code> option (API <code>option_1</code>), with +values from 2 to 8.</p> +<h2 id="gs1-composite-symbols-iso-24723">6.3 GS1 Composite Symbols (ISO +24723)</h2> +<p>GS1 Composite symbols employ a mixture of components to give more +comprehensive information about a product. The permissible contents of a +composite symbol is determined by the terms of the GS1 General +Specifications. Composite symbols consist of a linear component which +can be an EAN, UPC, GS1-128 or GS1 DataBar symbol, a two-dimensional +(2D) component which is based on PDF417 or MicroPDF417, and a separator +pattern. The type of linear component to be used is determined using the +<code>-b</code> or <code>--barcode</code> switch (API +<code>symbology</code>) as with other encoding methods. Valid values are +shown below.</p> +<div id="tbl:composite_symbologies" class="tablenos"> +<table id="tbl:composite_symbologies" +data-tag=": GS1 Composite Symbology Values"> +<caption><span>Table : GS1 Composite Symbology Values</span> </caption> +<colgroup> +<col style="width: 11%" /> +<col style="width: 34%" /> +<col style="width: 53%" /> +</colgroup> +<thead> +<tr> +<th style="text-align: left;">Numeric Value</th> +<th style="text-align: left;">Name</th> +<th style="text-align: left;">Barcode Name</th> +</tr> +</thead> +<tbody> +<tr> +<td style="text-align: left;">130</td> +<td style="text-align: left;"><code>BARCODE_EANX_CC</code></td> +<td style="text-align: left;">GS1 Composite Symbol with EAN linear +component</td> +</tr> +<tr> +<td style="text-align: left;">131</td> +<td style="text-align: left;"><code>BARCODE_GS1_128_CC</code></td> +<td style="text-align: left;">GS1 Composite Symbol with GS1-128 linear +component</td> +</tr> +<tr> +<td style="text-align: left;">132</td> +<td style="text-align: left;"><code>BARCODE_DBAR_OMN_CC</code></td> +<td style="text-align: left;">GS1 Composite Symbol with GS1 DataBar +Omnidirectional linear component</td> +</tr> +<tr> +<td style="text-align: left;">133</td> +<td style="text-align: left;"><code>BARCODE_DBAR_LTD_CC</code></td> +<td style="text-align: left;">GS1 Composite Symbol with GS1 DataBar +Limited linear component</td> +</tr> +<tr> +<td style="text-align: left;">134</td> +<td style="text-align: left;"><code>BARCODE_DBAR_EXP_CC</code></td> +<td style="text-align: left;">GS1 Composite Symbol with GS1 DataBar +Expanded linear component</td> +</tr> +<tr> +<td style="text-align: left;">135</td> +<td style="text-align: left;"><code>BARCODE_UPCA_CC</code></td> +<td style="text-align: left;">GS1 Composite Symbol with UPC-A linear +component</td> +</tr> +<tr> +<td style="text-align: left;">136</td> +<td style="text-align: left;"><code>BARCODE_UPCE_CC</code></td> +<td style="text-align: left;">GS1 Composite Symbol with UPC-E linear +component</td> +</tr> +<tr> +<td style="text-align: left;">137</td> +<td style="text-align: left;"><code>BARCODE_DBAR_STK_CC</code></td> +<td style="text-align: left;">GS1 Composite Symbol with GS1 DataBar +Stacked component</td> +</tr> +<tr> +<td style="text-align: left;">138</td> +<td style="text-align: left;"><code>BARCODE_DBAR_OMNSTK_CC</code></td> +<td style="text-align: left;">GS1 Composite Symbol with GS1 DataBar +Stacked Omnidirectional component</td> +</tr> +<tr> +<td style="text-align: left;">139</td> +<td style="text-align: left;"><code>BARCODE_DBAR_EXPSTK_CC</code></td> +<td style="text-align: left;">GS1 Composite Symbol with GS1 DataBar +Expanded Stacked component</td> +</tr> +</tbody> +</table> +</div> +<p>The data to be encoded in the linear component of a composite symbol +should be entered into a primary string with the data for the 2D +component being entered in the normal way. To do this at the command +prompt use the <code>--primary</code> switch (API <code>primary</code>). +For example:</p> +<div class="sourceCode" id="cb108"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb108-1"><a href="#cb108-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> EANX_CC <span class="at">--mode</span><span class="op">=</span>1 <span class="at">--primary</span><span class="op">=</span>331234567890 <span class="at">-d</span> <span class="st">"[99]1234-abcd"</span></span></code></pre></div> +<p>This creates an EAN-13 linear component with the data +<code>"331234567890"</code> and a 2D CC-A (see <a +href="#cc-a">below</a>) component with the data +<code>"(99)1234-abcd"</code>. The same results can be achieved using the +API as shown below:</p> +<div class="sourceCode" id="cb109"><pre +class="sourceCode c"><code class="sourceCode c"><span id="cb109-1"><a href="#cb109-1" aria-hidden="true" tabindex="-1"></a>my_symbol<span class="op">-></span>symbology <span class="op">=</span> BARCODE_EANX_CC<span class="op">;</span></span> +<span id="cb109-2"><a href="#cb109-2" aria-hidden="true" tabindex="-1"></a></span> +<span id="cb109-3"><a href="#cb109-3" aria-hidden="true" tabindex="-1"></a>my_symbol<span class="op">-></span>option_1 <span class="op">=</span> <span class="dv">1</span><span class="op">;</span></span> +<span id="cb109-4"><a href="#cb109-4" aria-hidden="true" tabindex="-1"></a></span> +<span id="cb109-5"><a href="#cb109-5" aria-hidden="true" tabindex="-1"></a>strcpy<span class="op">(</span>my_symbol<span class="op">-></span>primary<span class="op">,</span> <span class="st">"331234567890"</span><span class="op">);</span></span> +<span id="cb109-6"><a href="#cb109-6" aria-hidden="true" tabindex="-1"></a></span> +<span id="cb109-7"><a href="#cb109-7" aria-hidden="true" tabindex="-1"></a>ZBarcode_Encode_and_Print<span class="op">(</span>my_symbol<span class="op">,</span> <span class="st">"[99]1234-abcd"</span><span class="op">,</span> <span class="dv">0</span><span class="op">,</span> <span class="dv">0</span><span class="op">);</span></span></code></pre></div> +<p>EAN-2 and EAN-5 add-on data can be used with EAN and UPC symbols +using the + symbol as described in sections <a +href="#upc-universal-product-code-iso-15420">6.1.3 UPC (Universal +Product Code) (ISO 15420)</a> and <a +href="#ean-european-article-number-iso-15420">6.1.4 EAN (European +Article Number) (ISO 15420)</a>.</p> +<p>The 2D component of a composite symbol can use one of three systems: +CC-A, CC-B and CC-C, as described below. The 2D component type can be +selected automatically by Zint dependent on the length of the input +string. Alternatively the three methods can be accessed using the +<code>--mode</code> prompt (API <code>option_1</code>) followed by 1, 2 +or 3 for CC-A, CC-B or CC-C respectively.</p> +<h3 id="cc-a">6.3.1 CC-A</h3> +<figure> +<img src="images/eanx_cc_a.svg" title="fig:" class="upcean" +alt="zint -b EANX_CC --compliantheight -d "[99]1234-abcd" --mode=1 --primary=331234567890" /> +<figcaption +aria-hidden="true"><code>zint -b EANX_CC --compliantheight -d "[99]1234-abcd" --mode=1 --primary=331234567890</code></figcaption> +</figure> +<p>This system uses a variation of MicroPDF417 which is optimised to fit +into a small space. The size of the 2D component and the amount of error +correction is determined by the amount of data to be encoded and the +type of linear component which is being used. CC-A can encode up to 56 +numeric digits or an alphanumeric string of shorter length. To select +CC-A use <code>--mode=1</code> (API <code>option_1 = 1</code>).</p> +<h3 id="cc-b">6.3.2 CC-B</h3> +<figure> +<img src="images/eanx_cc_b.svg" title="fig:" class="upcean" +alt="zint -b EANX_CC --compliantheight -d "[99]1234-abcd" --mode=2 --primary=331234567890" /> +<figcaption +aria-hidden="true"><code>zint -b EANX_CC --compliantheight -d "[99]1234-abcd" --mode=2 --primary=331234567890</code></figcaption> +</figure> +<p>This system uses MicroPDF417 to encode the 2D component. The size of +the 2D component and the amount of error correction is determined by the +amount of data to be encoded and the type of linear component which is +being used. CC-B can encode up to 338 numeric digits or an alphanumeric +string of shorter length. To select CC-B use <code>--mode=2</code> (API +<code>option_1 = 2</code>).</p> +<h3 id="cc-c">6.3.3 CC-C</h3> +<figure> +<img src="images/gs1_128_cc_c.svg" title="fig:" class="upcean" +alt="zint -b GS1_128_CC --compliantheight -d "[99]1234-abcd" --mode=3 --primary="[01]03312345678903"" /> +<figcaption +aria-hidden="true"><code>zint -b GS1_128_CC --compliantheight -d "[99]1234-abcd" --mode=3 --primary="[01]03312345678903"</code></figcaption> +</figure> +<p>This system uses PDF417 and can only be used in conjunction with a +GS1-128 linear component. CC-C can encode up to 2361 numeric digits or +an alphanumeric string of shorter length. To select CC-C use +<code>--mode=3</code> (API <code>option_1 = 3</code>).</p> +<h2 id="two-track-symbols">6.4 Two-Track Symbols</h2> +<h3 id="two-track-pharmacode">6.4.1 Two-Track Pharmacode</h3> +<figure> +<img src="images/pharma_two.svg" title="fig:" class="trk" +alt="zint -b PHARMA_TWO --compliantheight -d "29876543"" /> +<figcaption +aria-hidden="true"><code>zint -b PHARMA_TWO --compliantheight -d "29876543"</code></figcaption> +</figure> +<p>Developed by Laetus, Pharmacode Two-Track is an alternative system to +Pharmacode One-Track (see <a href="#pharmacode">6.1.9 Pharmacode</a>) +used for the identification of pharmaceuticals. The symbology is able to +encode whole numbers between 4 and 64570080.</p> +<h3 id="postnet">6.4.2 POSTNET</h3> +<figure> +<img src="images/postnet.svg" title="fig:" class="trk" +alt="zint -b POSTNET --compliantheight -d "12345678901"" /> +<figcaption +aria-hidden="true"><code>zint -b POSTNET --compliantheight -d "12345678901"</code></figcaption> +</figure> +<p>Used by the United States Postal Service until 2009, the POSTNET +barcode was used for encoding zip-codes on mail items. POSTNET uses +numerical input data and includes a modulo-10 check digit. While Zint +will encode POSTNET symbols of up to 38 digits in length, standard +lengths as used by USPS were <code>PostNet6</code> (5-digit ZIP input), +<code>PostNet10</code> (5-digit ZIP + 4-digit user data) and +<code>PostNet12</code> (5-digit ZIP + 6-digit user data), and a warning +will be issued if the input length is not one of these.</p> +<h3 id="planet">6.4.3 PLANET</h3> +<figure> +<img src="images/planet.svg" title="fig:" class="trk" +alt="zint -b PLANET --compliantheight -d "4012345235636"" /> +<figcaption +aria-hidden="true"><code>zint -b PLANET --compliantheight -d "4012345235636"</code></figcaption> +</figure> +<p>Used by the United States Postal Service until 2009, the PLANET +(Postal Alpha Numeric Encoding Technique) barcode was used for encoding +routing data on mail items. PLANET uses numerical input data and +includes a modulo-10 check digit. While Zint will encode PLANET symbols +of up to 38 digits in length, standard lengths used by USPS were +<code>Planet12</code> (11-digit input) and <code>Planet14</code> +(13-digit input), and as with POSTNET a warning will be issued if the +length is not one of these.</p> +<h3 id="brazilian-cepnet">6.4.4 Brazilian CEPNet</h3> +<figure> +<img src="images/cepnet.svg" title="fig:" class="trk" +alt="zint -b CEPNET --compliantheight -d "12345678"" /> +<figcaption +aria-hidden="true"><code>zint -b CEPNET --compliantheight -d "12345678"</code></figcaption> +</figure> +<p>Based on POSTNET, the CEPNet symbol is used by Correios, the +Brazilian postal service, to encode CEP (Código de Endereçamento Postal) +numbers on mail items. Input should consist of eight digits with the +check digit being automatically added by Zint.</p> +<h3 id="dx-film-edge-barcode">6.4.5 DX Film Edge Barcode</h3> +<figure> +<img src="images/dxfilmedge.svg" title="fig:" class="trk" +alt="zint -b DXFILMEDGE --compliantheight -d "112-1/10A"" /> +<figcaption +aria-hidden="true"><code>zint -b DXFILMEDGE --compliantheight -d "112-1/10A"</code></figcaption> +</figure> +<p>Introduced by Kodak in the 1980s, the DX (Digital Index) barcode is +printed on the bottom edge of 35mm film to aid in the reordering and +post-processing of prints.</p> +<p>The data can be in two parts. The first part (required) is the “DX +number”, identifying the manufacturer and film type - the National +Association of Photographic Manufacturers (NAPM) number. The second +part, which is optional and if present is separated from the first by a +slash (<code>/</code>), gives the frame number.</p> +<p>The DX number is in either of two formats. The first format is a +number of 1 to 4 digits (“DX Extract”) or 6 digits (“DX Full”), but for +the 6-digit version the first and last digit are ignored, leaving a +4-digit DX Extract number in any case, which must be in the range 16 to +2047. The second format “NNN-NN” represents the DX Extract as two +numbers separated by a dash (<code>-</code>), the first number being 1 +to 3 digits (range 1 to 127) and the second 1 to 2 digits (range 0 to +15).<a href="#fn15" class="footnote-ref" id="fnref15" +role="doc-noteref"><sup>15</sup></a></p> +<p>The optional frame number is a number in the range 0 to 63, and may +have a half frame indicator “A” appended. Special character sequences +(with or without a half frame indicator appended) may also be used: “S” +or “X” means frame number 62, “K” or “00” means frame number 63, and “F” +means frame number 0.</p> +<p>A parity bit is automatically added by Zint.</p> +<h2 id="state-postal-codes">6.5 4-State Postal Codes</h2> +<h3 id="australia-post-4-state-symbols">6.5.1 Australia Post 4-State +Symbols</h3> +<h4 id="customer-barcodes">6.5.1.1 Customer Barcodes</h4> +<figure> +<img src="images/auspost.svg" title="fig:" class="trk" +alt="zint -b AUSPOST --compliantheight -d "96184209"" /> +<figcaption +aria-hidden="true"><code>zint -b AUSPOST --compliantheight -d "96184209"</code></figcaption> +</figure> +<p>Australia Post Standard Customer Barcode, Customer Barcode 2 and +Customer Barcode 3 are 37-bar, 52-bar and 67-bar specifications +respectively, developed by Australia Post for printing Delivery Point ID +(DPID) and customer information on mail items. Valid data characters are +0-9, A-Z, a-z, space and hash (#). A Format Control Code (FCC) is added +by Zint and should not be included in the input data. Reed-Solomon error +correction data is generated by Zint. Encoding behaviour is determined +by the length of the input data according to the formula shown in the +following table.</p> +<div id="tbl:auspost_input_formats" class="tablenos"> +<table id="tbl:auspost_input_formats" style="width:86%;" +data-tag=": Australia Post Input Formats"> +<caption><span>Table : Australia Post Input Formats</span> </caption> +<colgroup> +<col style="width: 13%" /> +<col style="width: 38%" /> +<col style="width: 12%" /> +<col style="width: 8%" /> +<col style="width: 12%" /> +</colgroup> +<thead> +<tr> +<th style="text-align: left;">Input Length</th> +<th style="text-align: left;">Required Input Format</th> +<th>Symbol Length</th> +<th>FCC</th> +<th style="text-align: left;">Encoding Table</th> +</tr> +</thead> +<tbody> +<tr> +<td style="text-align: left;">8</td> +<td style="text-align: left;"><code>99999999</code></td> +<td>37-bar</td> +<td>11</td> +<td style="text-align: left;">None</td> +</tr> +<tr> +<td style="text-align: left;">13</td> +<td style="text-align: left;"><code>99999999AAAAA</code></td> +<td>52-bar</td> +<td>59</td> +<td style="text-align: left;">C</td> +</tr> +<tr> +<td style="text-align: left;">16</td> +<td style="text-align: left;"><code>9999999999999999</code></td> +<td>52-bar</td> +<td>59</td> +<td style="text-align: left;">N</td> +</tr> +<tr> +<td style="text-align: left;">18</td> +<td style="text-align: left;"><code>99999999AAAAAAAAAA</code></td> +<td>67-bar</td> +<td>62</td> +<td style="text-align: left;">C</td> +</tr> +<tr> +<td style="text-align: left;">23</td> +<td style="text-align: left;"><code>99999999999999999999999</code></td> +<td>67-bar</td> +<td>62</td> +<td style="text-align: left;">N</td> +</tr> +</tbody> +</table> +</div> +<h4 id="reply-paid-barcode">6.5.1.2 Reply Paid Barcode</h4> +<figure> +<img src="images/ausreply.svg" title="fig:" class="trk" +alt="zint -b AUSREPLY --compliantheight -d "12345678"" /> +<figcaption +aria-hidden="true"><code>zint -b AUSREPLY --compliantheight -d "12345678"</code></figcaption> +</figure> +<p>A Reply Paid version of the Australia Post 4-State Barcode (FCC 45) +which requires an 8-digit DPID input.</p> +<h4 id="routing-barcode">6.5.1.3 Routing Barcode</h4> +<figure> +<img src="images/ausroute.svg" title="fig:" class="trk" +alt="zint -b AUSROUTE --compliantheight -d "34567890"" /> +<figcaption +aria-hidden="true"><code>zint -b AUSROUTE --compliantheight -d "34567890"</code></figcaption> +</figure> +<p>A Routing version of the Australia Post 4-State Barcode (FCC 87) +which requires an 8-digit DPID input.</p> +<h4 id="redirect-barcode">6.5.1.4 Redirect Barcode</h4> +<figure> +<img src="images/ausredirect.svg" title="fig:" class="trk" +alt="zint -b AUSREDIRECT --compliantheight -d "98765432"" /> +<figcaption +aria-hidden="true"><code>zint -b AUSREDIRECT --compliantheight -d "98765432"</code></figcaption> +</figure> +<p>A Redirection version of the Australia Post 4-State Barcode (FCC 92) +which requires an 8-digit DPID input.</p> +<h3 id="dutch-post-kix-code">6.5.2 Dutch Post KIX Code</h3> +<figure> +<img src="images/kix.svg" title="fig:" class="trk" +alt="zint -b KIX --compliantheight -d "2500GG30250"" /> +<figcaption +aria-hidden="true"><code>zint -b KIX --compliantheight -d "2500GG30250"</code></figcaption> +</figure> +<p>This symbology is used by Royal Dutch TPG Post (Netherlands) for +Postal code and automatic mail sorting. Data input can consist of +numbers 0-9 and letters A-Z and needs to be 11 characters in length. No +check digit is included.</p> +<h3 id="royal-mail-4-state-customer-code-rm4scc">6.5.3 Royal Mail +4-State Customer Code (RM4SCC)</h3> +<figure> +<img src="images/rm4scc.svg" title="fig:" class="trk" +alt="zint -b RM4SCC --compliantheight -d "W1J0TR01"" /> +<figcaption +aria-hidden="true"><code>zint -b RM4SCC --compliantheight -d "W1J0TR01"</code></figcaption> +</figure> +<p>The RM4SCC standard is used by the Royal Mail in the UK to encode +postcode and customer data on mail items. Data input can consist of +numbers 0-9 and letters A-Z and usually includes delivery postcode +followed by house number. For example <code>"W1J0TR01"</code> for 1 +Piccadilly Circus in London. Check digit data is generated by Zint.</p> +<h3 id="royal-mail-4-state-mailmark">6.5.4 Royal Mail 4-State +Mailmark</h3> +<figure> +<img src="images/mailmark_4s.svg" title="fig:" class="trk" +alt="zint -b MAILMARK_4S --compliantheight -d "1100000000000XY11"" /> +<figcaption +aria-hidden="true"><code>zint -b MAILMARK_4S --compliantheight -d "1100000000000XY11"</code></figcaption> +</figure> +<p>Developed in 2014 as a replacement for RM4SCC this 4-state symbol +includes Reed- Solomon error correction. Input is a pre-formatted +alphanumeric string of 22 (for Barcode C) or 26 (for Barcode L) +characters, producing a symbol with 66 or 78 bars respectively. The +rules for the input data are complex, as summarized in the following +table.</p> +<div id="tbl:mailmark_4s_input_fields" class="tablenos"> +<table id="tbl:mailmark_4s_input_fields" style="width:100%;" +data-tag=": Royal Mail 4-State Mailmark Input Fields"> +<caption><span>Table : Royal Mail 4-State Mailmark Input Fields</span> +</caption> +<colgroup> +<col style="width: 11%" /> +<col style="width: 11%" /> +<col style="width: 17%" /> +<col style="width: 22%" /> +<col style="width: 13%" /> +<col style="width: 23%" /> +</colgroup> +<thead> +<tr> +<th style="text-align: left;">Format</th> +<th style="text-align: left;">Version ID</th> +<th style="text-align: left;">Class</th> +<th>Supply Chain ID</th> +<th style="text-align: left;">Item ID</th> +<th style="text-align: left;">Destination+DPS</th> +</tr> +</thead> +<tbody> +<tr> +<td style="text-align: left;">1 digit (0-4)</td> +<td style="text-align: left;">1 digit (0-3)</td> +<td style="text-align: left;">1 alphanum. (0-9A-E)</td> +<td>2 digits (C) or 6 digits (L)</td> +<td style="text-align: left;">8 digits</td> +<td style="text-align: left;">9 alphanumerics (1 of 6 patterns)</td> +</tr> +</tbody> +</table> +</div> +<p>The 6 Destination+DPS (Destination Post Code plus Delivery Point +Suffix) patterns are:</p> +<div id="tbl:mailmark_destination_dps" class="tablenos"> +<table id="tbl:mailmark_destination_dps" +data-tag=": Royal Mail Mailmark Destination+DPS Patterns"> +<caption><span>Table : Royal Mail Mailmark Destination+DPS +Patterns:</span> </caption> +<tbody> +<tr> +<td><code>FNFNLLNLS</code></td> +<td><code>FFNNLLNLS</code></td> +<td><code>FFNNNLLNL</code></td> +</tr> +<tr> +<td><code>FFNFNLLNL</code></td> +<td><code>FNNLLNLSS</code></td> +<td><code>FNNNLLNLS</code></td> +</tr> +</tbody> +</table> +</div> +<p>where <code>'F'</code> stands for full alphabetic (A-Z), +<code>'L'</code> for limited alphabetic (A-Z less +<code>'CIKMOV'</code>), <code>'N'</code> for numeric (0-9), and +<code>'S'</code> for space.</p> +<p>Four of the permitted patterns include a number of trailing space +characters - these will be appended by Zint if not included in the input +data.</p> +<p>For the two-dimensional Data Matrix-based version, see <a +href="#royal-mail-2d-mailmark-cmdm-data-matrix">6.6.2 Royal Mail 2D +Mailmark (CMDM) (Data Matrix)</a>.</p> +<h3 id="usps-intelligent-mail">6.5.5 USPS Intelligent Mail</h3> +<figure> +<img src="images/usps_imail.svg" title="fig:" class="trk" +alt="zint -b USPS_IMAIL --compliantheight -d "01234567094987654321-01234"" /> +<figcaption +aria-hidden="true"><code>zint -b USPS_IMAIL --compliantheight -d "01234567094987654321-01234"</code></figcaption> +</figure> +<p>Also known as the OneCode barcode and used in the U.S. by the United +States Postal Service (USPS), the Intelligent Mail system replaced the +POSTNET and PLANET symbologies in 2009. Intelligent Mail is a fixed +length (65-bar) symbol which combines routing and customer information +in a single symbol. Input data consists of a 20-digit tracking code, +followed by a dash (<code>-</code>), followed by a delivery point +zip-code which can be 0, 5, 9 or 11 digits in length. For example all of +the following inputs are valid data entries:</p> +<ul> +<li><code>"01234567094987654321"</code></li> +<li><code>"01234567094987654321-01234"</code></li> +<li><code>"01234567094987654321-012345678"</code></li> +<li><code>"01234567094987654321-01234567891"</code></li> +</ul> +<h3 id="japanese-postal-code">6.5.6 Japanese Postal Code</h3> +<figure> +<img src="images/japanpost.svg" title="fig:" class="trk" +alt="zint -b JAPANPOST --compliantheight -d "15400233-16-4-205"" /> +<figcaption +aria-hidden="true"><code>zint -b JAPANPOST --compliantheight -d "15400233-16-4-205"</code></figcaption> +</figure> +<p>Used for address data on mail items for Japan Post. Accepted values +are 0-9, A-Z and dash (<code>-</code>). A modulo 19 check digit is added +by Zint.</p> +<h3 id="daft-code">6.5.7 DAFT Code</h3> +<figure> +<img src="images/daft_rm4scc.svg" title="fig:" class="trk" +alt="zint -b DAFT -d "AAFDTTDAFADTFTTFFFDATFTADTTFFTDAFAFDTF" --height=8.494 --vers=256" /> +<figcaption +aria-hidden="true"><code>zint -b DAFT -d "AAFDTTDAFADTFTTFFFDATFTADTTFFTDAFAFDTF" --height=8.494 --vers=256</code></figcaption> +</figure> +<p>This is a method for creating 4-state codes where the data encoding +is provided by an external program. Input data should consist of the +letters <code>'D'</code>, <code>'A'</code>, <code>'F'</code> and +<code>'T'</code> where these refer to descender, ascender, full +(ascender and descender) and tracker (neither ascender nor descender) +respectively. All other characters are invalid. The ratio of the tracker +size to full height can be given in thousandths (permille) using the +<code>--vers</code> option (API <code>option_2</code>). The default +value is 250 (25%).</p> +<p>For example the following</p> +<div class="sourceCode" id="cb110"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb110-1"><a href="#cb110-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> DAFT <span class="at">-d</span> AAFDTTDAFADTFTTFFFDATFTADTTFFTDAFAFDTF <span class="at">--height</span><span class="op">=</span>8.494 <span class="at">--vers</span><span class="op">=</span>256</span></code></pre></div> +<p>produces the same barcode (see <a +href="#royal-mail-4-state-customer-code-rm4scc">6.5.3 Royal Mail 4-State +Customer Code (RM4SCC)</a>) as</p> +<div class="sourceCode" id="cb111"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb111-1"><a href="#cb111-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> RM4SCC <span class="at">--compliantheight</span> <span class="at">-d</span> <span class="st">"W1J0TR01"</span></span></code></pre></div> +<h2 id="matrix-symbols">6.6 Matrix Symbols</h2> +<h3 id="data-matrix-iso-16022">6.6.1 Data Matrix (ISO 16022)</h3> +<figure> +<img src="images/hibc_dm.svg" title="fig:" class="i2dbig" +alt="zint -b HIBC_DM -d "/ACMRN123456/V200912190833" --fast --square" /> +<figcaption +aria-hidden="true"><code>zint -b HIBC_DM -d "/ACMRN123456/V200912190833" --fast --square</code></figcaption> +</figure> +<p>Also known as Semacode this symbology was developed in 1989 by Acuity +CiMatrix in partnership with the U.S. DoD and NASA. The symbol can +encode a large amount of data in a small area. Data Matrix encodes +characters in the Latin-1 set by default but also supports encoding in +other character sets using the ECI mechanism. It can also encode GS1 +data. The size of the generated symbol can be adjusted using the +<code>--vers</code> option (API <code>option_2</code>) as shown in the +table below. A separate symbology ID (<code>BARCODE_HIBC_DM</code>) can +be used to encode Health Industry Barcode (HIBC) data. Note that only +ECC200 encoding is supported, the older standards have now been removed +from Zint.</p> +<div id="tbl:datamatrix_sizes" class="tablenos"> +<table id="tbl:datamatrix_sizes" data-tag=": Data Matrix Sizes"> +<caption><span>Table : Data Matrix Sizes</span> </caption> +<thead> +<tr> +<th>Input</th> +<th>Symbol Size</th> +<th></th> +<th>Input</th> +<th>Symbol Size</th> +<th></th> +<th>Input</th> +<th>Symbol Size</th> +</tr> +</thead> +<tbody> +<tr> +<td>1</td> +<td>10 x 10</td> +<td></td> +<td>11</td> +<td>36 x 36</td> +<td></td> +<td>21</td> +<td>104 x 104</td> +</tr> +<tr> +<td>2</td> +<td>12 x 12</td> +<td></td> +<td>12</td> +<td>40 x 40</td> +<td></td> +<td>22</td> +<td>120 x 120</td> +</tr> +<tr> +<td>3</td> +<td>14 x 14</td> +<td></td> +<td>13</td> +<td>44 x 44</td> +<td></td> +<td>23</td> +<td>132 x 132</td> +</tr> +<tr> +<td>4</td> +<td>16 x 16</td> +<td></td> +<td>14</td> +<td>48 x 48</td> +<td></td> +<td>24</td> +<td>144 x 144</td> +</tr> +<tr> +<td>5</td> +<td>18 x 18</td> +<td></td> +<td>15</td> +<td>52 x 52</td> +<td></td> +<td>25</td> +<td>8 x 18</td> +</tr> +<tr> +<td>6</td> +<td>20 x 20</td> +<td></td> +<td>16</td> +<td>64 x 64</td> +<td></td> +<td>26</td> +<td>8 x 32</td> +</tr> +<tr> +<td>7</td> +<td>22 x 22</td> +<td></td> +<td>17</td> +<td>72 x 72</td> +<td></td> +<td>28</td> +<td>12 x 26</td> +</tr> +<tr> +<td>8</td> +<td>24 x 24</td> +<td></td> +<td>18</td> +<td>80 x 80</td> +<td></td> +<td>28</td> +<td>12 x 36</td> +</tr> +<tr> +<td>9</td> +<td>26 x 26</td> +<td></td> +<td>19</td> +<td>88 x 88</td> +<td></td> +<td>29</td> +<td>16 x 36</td> +</tr> +<tr> +<td>10</td> +<td>32 x 32</td> +<td></td> +<td>20</td> +<td>96 x 96</td> +<td></td> +<td>30</td> +<td>16 x 48</td> +</tr> +</tbody> +</table> +</div> +<p>The largest version 24 (144 x 144) can encode 3116 digits, around +2335 alphanumeric characters, or 1555 bytes of data.</p> +<p>When using automatic symbol sizes you can force Zint to use square +symbols (versions 1-24) at the command line by using the option +<code>--square</code> (API <code>option_3 = DM_SQUARE</code>).</p> +<p>Data Matrix Rectangular Extension (ISO/IEC 21471) codes may be +generated with the following values as before:</p> +<div id="tbl:dmre_sizes" class="tablenos"> +<table id="tbl:dmre_sizes" data-tag=": DMRE Sizes"> +<caption><span>Table : DMRE Sizes</span> </caption> +<thead> +<tr> +<th>Input</th> +<th>Symbol Size</th> +<th></th> +<th>Input</th> +<th>Symbol Size</th> +</tr> +</thead> +<tbody> +<tr> +<td>31</td> +<td>8 x 48</td> +<td></td> +<td>40</td> +<td>20 x 36</td> +</tr> +<tr> +<td>32</td> +<td>8 x 64</td> +<td></td> +<td>41</td> +<td>20 x 44</td> +</tr> +<tr> +<td>33</td> +<td>8 x 80</td> +<td></td> +<td>42</td> +<td>20 x 64</td> +</tr> +<tr> +<td>34</td> +<td>8 x 96</td> +<td></td> +<td>43</td> +<td>22 x 48</td> +</tr> +<tr> +<td>35</td> +<td>8 x 120</td> +<td></td> +<td>44</td> +<td>24 x 48</td> +</tr> +<tr> +<td>36</td> +<td>8 x 144</td> +<td></td> +<td>45</td> +<td>24 x 64</td> +</tr> +<tr> +<td>37</td> +<td>12 x 64</td> +<td></td> +<td>46</td> +<td>26 x 40</td> +</tr> +<tr> +<td>38</td> +<td>12 x 88</td> +<td></td> +<td>47</td> +<td>26 x 48</td> +</tr> +<tr> +<td>39</td> +<td>16 x 64</td> +<td></td> +<td>48</td> +<td>26 x 64</td> +</tr> +</tbody> +</table> +</div> +<p>DMRE symbol sizes may be activated in automatic size mode using the +option <code>--dmre</code> (API <code>option_3 = DM_DMRE</code>).</p> +<p>GS1 data may be encoded using FNC1 (default) or GS (Group Separator, +ASCII 29) as separator. Use the option <code>--gssep</code> to change to +GS (API <code>output_options |= GS1_GS_SEPARATOR</code>).</p> +<p>By default Zint uses a “de facto” codeword placement for symbols of +size 144 x 144 (version 24). To override this and use the now clarified +ISO/IEC standard placement, use option <code>--dmiso144</code> (API +<code>option_3 |= DM_ISO_144</code>).</p> +<p>For a faster but less optimal encoding, the <code>--fast</code> +option (API <code>input_mode |= FAST_MODE</code>) may be used.</p> +<p>Data Matrix supports Structured Append of up to 16 symbols and a +numeric ID (file identifications), which can be set by using the +<code>--structapp</code> option (see <a href="#structured-append">4.17 +Structured Append</a>) (API <code>structapp</code>). The ID consists of +2 numbers <code>ID1</code> and <code>ID2</code>, each of which can range +from 1 to 254, and is specified as the single number +<code>ID1 * 1000 + ID2</code>, so for instance <code>ID1</code> +<code>"123"</code> and <code>ID2</code> <code>"234"</code> would be +given as <code>"123234"</code>. Note that both <code>ID1</code> and +<code>ID2</code> must be non-zero, so e.g. <code>"123000"</code> or +<code>"000123"</code> would be invalid IDs. If an ID is not given it +defaults to <code>"001001"</code>.</p> +<h3 id="royal-mail-2d-mailmark-cmdm-data-matrix">6.6.2 Royal Mail 2D +Mailmark (CMDM) (Data Matrix)</h3> +<figure> +<img src="images/mailmark_2d.svg" title="fig:" class="i2dbig" +alt="zint -b MAILMARK_2D -d "JGB 01Z999999900000001EC1A1AA1A0SN35TQ" --vers=30" /> +<figcaption +aria-hidden="true"><code>zint -b MAILMARK_2D -d "JGB 01Z999999900000001EC1A1AA1A0SN35TQ" --vers=30</code></figcaption> +</figure> +<p>This variant of Data Matrix, also known as “Complex Mail Data Mark” +(CMDM), was introduced by Royal Mail along with <a +href="#royal-mail-4-state-mailmark">6.5.4 Royal Mail 4-State +Mailmark</a>, and offers space for customer data following an initial +pre-formatted 45 character section, as summarized below.</p> +<div id="tbl:mailmark_2d_input_fields" class="tablenos"> +<table id="tbl:mailmark_2d_input_fields" +data-tag=": Royal Mail 2D Mailmark Input Fields"> +<caption><span>Table : Royal Mail 2D Mailmark Input Fields</span> +</caption> +<thead> +<tr> +<th style="text-align: left;">Field Name</th> +<th style="text-align: left;">Length</th> +<th style="text-align: left;">Values</th> +</tr> +</thead> +<tbody> +<tr> +<td style="text-align: left;">UPU Country ID</td> +<td style="text-align: left;">4</td> +<td style="text-align: left;"><code>"JGB "</code></td> +</tr> +<tr> +<td style="text-align: left;">Information Type</td> +<td style="text-align: left;">1</td> +<td style="text-align: left;">Alphanumeric</td> +</tr> +<tr> +<td style="text-align: left;">Version ID</td> +<td style="text-align: left;">1</td> +<td style="text-align: left;"><code>"1"</code></td> +</tr> +<tr> +<td style="text-align: left;">Class</td> +<td style="text-align: left;">1</td> +<td style="text-align: left;">Alphanumeric</td> +</tr> +<tr> +<td style="text-align: left;">Supply Chain ID</td> +<td style="text-align: left;">7</td> +<td style="text-align: left;">Numeric</td> +</tr> +<tr> +<td style="text-align: left;">Item ID</td> +<td style="text-align: left;">8</td> +<td style="text-align: left;">Numeric</td> +</tr> +<tr> +<td style="text-align: left;">Destination+DPS</td> +<td style="text-align: left;">9</td> +<td style="text-align: left;">Alphanumeric (1 of 6 patterns)</td> +</tr> +<tr> +<td style="text-align: left;">Service Type</td> +<td style="text-align: left;">1</td> +<td style="text-align: left;">Numeric</td> +</tr> +<tr> +<td style="text-align: left;">RTS Post Code</td> +<td style="text-align: left;">7</td> +<td style="text-align: left;">Alphanumeric (1 of 6 patterns)</td> +</tr> +<tr> +<td style="text-align: left;">Reserved</td> +<td style="text-align: left;">6</td> +<td style="text-align: left;">Spaces</td> +</tr> +<tr> +<td style="text-align: left;">Customer Data</td> +<td style="text-align: left;">6, 45 or 29</td> +<td style="text-align: left;">Anything (Latin-1)</td> +</tr> +</tbody> +</table> +</div> +<p>The 6 Destination+DPS (Destination Post Code plus Delivery Point +Suffix) patterns are the same as for the 4-state - see Table <a +href="#tbl:mailmark_destination_dps">: Royal Mail Mailmark +Destination+DPS Patterns</a>. The 6 RTS (Return to Sender) Post Code +patterns are the same also except without the additional DPS +<code>'NL'</code>, i.e.</p> +<div id="tbl:mailmark_2d_rts" class="tablenos"> +<table id="tbl:mailmark_2d_rts" +data-tag=": Royal Mail 2D Mailmark RTS Patterns"> +<caption><span>Table : Royal Mail 2D Mailmark RTS Patterns</span> +</caption> +<tbody> +<tr> +<td><code>FNFNLLS</code></td> +<td><code>FFNNLLS</code></td> +<td><code>FFNNNLL</code></td> +</tr> +<tr> +<td><code>FFNFNLL</code></td> +<td><code>FNNLLSS</code></td> +<td><code>FNNNLLS</code></td> +</tr> +</tbody> +</table> +</div> +<p>where <code>'F'</code> is full alphabetic (A-Z), <code>'L'</code> +limited alphabetic (A-Z less <code>'CIKMOV'</code>), <code>'N'</code> +numeric (0-9), and <code>'S'</code> space.</p> +<p>Three sizes are defined, one rectangular, with varying maximum +amounts of optional customer data:</p> +<div id="tbl:mailmark_2d_sizes" class="tablenos"> +<table id="tbl:mailmark_2d_sizes" +data-tag=": Royal Mail 2D Mailmark Sizes"> +<caption><span>Table : Royal Mail 2D Mailmark Sizes</span> </caption> +<thead> +<tr> +<th style="text-align: left;">Name</th> +<th style="text-align: left;">Size</th> +<th>Customer Data</th> +<th>Zint Version</th> +</tr> +</thead> +<tbody> +<tr> +<td style="text-align: left;">Type 7</td> +<td style="text-align: left;">24 x 24</td> +<td>6 characters</td> +<td>8</td> +</tr> +<tr> +<td style="text-align: left;">Type 9</td> +<td style="text-align: left;">32 x 32</td> +<td>45 characters</td> +<td>10</td> +</tr> +<tr> +<td style="text-align: left;">Type 29</td> +<td style="text-align: left;">16 x 48</td> +<td>29 characters</td> +<td>30</td> +</tr> +</tbody> +</table> +</div> +<p>Zint will automatically select a size based on the amount of customer +data, or it can be specified using the <code>--vers</code> option (API +<code>option_2</code>), which takes the Zint version number (one more +than the Royal Mail Type number). Zint will prefix the input data with +<code>"JGB "</code> if it’s missing, and also space-pad the input if the +customer data is absent or falls short. As with Data Matrix, the +rectangular symbol Type 29 can be excluded from automatic size selection +by using the option <code>--square</code> (API +<code>option_3 = DM_SQUARE</code>).</p> +<p>GS1 data, the ECI mechanism, and Structured Append are not +supported.</p> +<h3 id="qr-code-iso-18004">6.6.3 QR Code (ISO 18004)</h3> +<figure> +<img src="images/qrcode.svg" title="fig:" class="i2dbig" +alt="zint -b QRCODE -d "QR Code Symbol" --mask=5" /> +<figcaption +aria-hidden="true"><code>zint -b QRCODE -d "QR Code Symbol" --mask=5</code></figcaption> +</figure> +<p>Also known as Quick Response Code this symbology was developed by +Denso. Four levels of error correction are available using the +<code>--secure</code> option (API <code>option_1</code>) as shown in the +following table.</p> +<div id="tbl:qrcode_eccs" class="tablenos"> +<table id="tbl:qrcode_eccs" data-tag=": QR Code ECC Levels"> +<caption><span>Table : QR Code ECC Levels</span> </caption> +<thead> +<tr> +<th>Input</th> +<th>ECC Level</th> +<th>Error Correction Capacity</th> +<th>Recovery Capacity</th> +</tr> +</thead> +<tbody> +<tr> +<td>1</td> +<td>L</td> +<td>Approx 20% of symbol</td> +<td>Approx 7%</td> +</tr> +<tr> +<td>2</td> +<td>M</td> +<td>Approx 37% of symbol</td> +<td>Approx 15%</td> +</tr> +<tr> +<td>3</td> +<td>Q</td> +<td>Approx 55% of symbol</td> +<td>Approx 25%</td> +</tr> +<tr> +<td>4</td> +<td>H</td> +<td>Approx 65% of symbol</td> +<td>Approx 30%</td> +</tr> +</tbody> +</table> +</div> +<p>The size of the symbol can be specified by setting the +<code>--vers</code> option (API <code>option_2</code>) to the QR Code +version required (1-40). The size of symbol generated is shown in the +table below.</p> +<div id="tbl:qrcode_sizes" class="tablenos"> +<table id="tbl:qrcode_sizes" data-tag=": QR Code Sizes"> +<caption><span>Table : QR Code Sizes</span> </caption> +<thead> +<tr> +<th>Input</th> +<th>Symbol Size</th> +<th></th> +<th>Input</th> +<th>Symbol Size</th> +<th></th> +<th>Input</th> +<th>Symbol Size</th> +</tr> +</thead> +<tbody> +<tr> +<td>1</td> +<td>21 x 21</td> +<td></td> +<td>15</td> +<td>77 x 77</td> +<td></td> +<td>29</td> +<td>133 x 133</td> +</tr> +<tr> +<td>2</td> +<td>25 x 25</td> +<td></td> +<td>16</td> +<td>81 x 81</td> +<td></td> +<td>30</td> +<td>137 x 137</td> +</tr> +<tr> +<td>3</td> +<td>29 x 29</td> +<td></td> +<td>17</td> +<td>85 x 85</td> +<td></td> +<td>31</td> +<td>141 x 141</td> +</tr> +<tr> +<td>4</td> +<td>33 x 33</td> +<td></td> +<td>18</td> +<td>89 x 89</td> +<td></td> +<td>32</td> +<td>145 x 145</td> +</tr> +<tr> +<td>5</td> +<td>37 x 37</td> +<td></td> +<td>19</td> +<td>93 x 93</td> +<td></td> +<td>33</td> +<td>149 x 149</td> +</tr> +<tr> +<td>6</td> +<td>41 x 41</td> +<td></td> +<td>20</td> +<td>97 x 97</td> +<td></td> +<td>34</td> +<td>153 x 153</td> +</tr> +<tr> +<td>7</td> +<td>45 x 45</td> +<td></td> +<td>21</td> +<td>101 x 101</td> +<td></td> +<td>35</td> +<td>157 x 157</td> +</tr> +<tr> +<td>8</td> +<td>49 x 49</td> +<td></td> +<td>22</td> +<td>105 x 105</td> +<td></td> +<td>36</td> +<td>161 x 161</td> +</tr> +<tr> +<td>9</td> +<td>53 x 53</td> +<td></td> +<td>23</td> +<td>109 x 109</td> +<td></td> +<td>37</td> +<td>165 x 165</td> +</tr> +<tr> +<td>10</td> +<td>57 x 57</td> +<td></td> +<td>24</td> +<td>113 x 113</td> +<td></td> +<td>38</td> +<td>169 x 169</td> +</tr> +<tr> +<td>11</td> +<td>61 x 61</td> +<td></td> +<td>25</td> +<td>117 x 117</td> +<td></td> +<td>39</td> +<td>173 x 173</td> +</tr> +<tr> +<td>12</td> +<td>65 x 65</td> +<td></td> +<td>26</td> +<td>121 x 121</td> +<td></td> +<td>40</td> +<td>177 x 177</td> +</tr> +<tr> +<td>13</td> +<td>69 x 69</td> +<td></td> +<td>27</td> +<td>125 x 125</td> +<td></td> +<td></td> +<td></td> +</tr> +<tr> +<td>14</td> +<td>73 x 73</td> +<td></td> +<td>28</td> +<td>129 x 129</td> +<td></td> +<td></td> +<td></td> +</tr> +</tbody> +</table> +</div> +<p>The maximum capacity of a QR Code symbol (version 40) is 7089 numeric +digits, 4296 alphanumeric characters or 2953 bytes of data. QR Code +symbols can also be used to encode GS1 data. QR Code symbols can by +default encode either characters in the Latin-1 set or Kanji, Katakana +and ASCII characters which are members of the Shift JIS encoding scheme. +In addition QR Code supports other character sets using the ECI +mechanism. Input should usually be entered as UTF-8 with conversion to +Latin-1 or Shift JIS being carried out by Zint. A separate symbology ID +(<code>BARCODE_HIBC_QR</code>) can be used to encode Health Industry +Barcode (HIBC) data.</p> +<p>Non-ASCII data density may be maximized by using the +<code>--fullmultibyte</code> switch (API +<code>option_3 = ZINT_FULL_MULTIBYTE</code>), but check that your +barcode reader supports this before using.</p> +<p>QR Code has eight different masks designed to minimize unwanted +patterns. The best mask to use is selected automatically by Zint but may +be manually specified by using the <code>--mask</code> switch with +values 0-7, or in the API by setting +<code>option_3 = (N + 1) << 8</code> where N is 0-7. To use with +<code>ZINT_FULL_MULTIBYTE</code> set</p> +<div class="sourceCode" id="cb112"><pre +class="sourceCode c"><code class="sourceCode c"><span id="cb112-1"><a href="#cb112-1" aria-hidden="true" tabindex="-1"></a>option_3 <span class="op">=</span> ZINT_FULL_MULTIBYTE <span class="op">|</span> <span class="op">(</span>N <span class="op">+</span> <span class="dv">1</span><span class="op">)</span> <span class="op"><<</span> <span class="dv">8</span></span></code></pre></div> +<p>The <code>--fast</code> option (API +<code>input_mode |= FAST_MODE</code>) may be used when leaving Zint to +automatically select a mask to reduce the number of masks to try to four +(0, 2, 4, 7).</p> +<p>QR Code supports Structured Append of up to 16 symbols and a numeric +ID (parity), which can be set by using the <code>--structapp</code> +option (see <a href="#structured-append">4.17 Structured Append</a>) +(API <code>structapp</code>). The parity ID ranges from 0 (default) to +255, and for full compliance should be set to the value obtained by +<code>XOR</code>-ing together each byte of the complete data forming the +sequence. Currently this calculation must be done outside of Zint.</p> +<h3 id="micro-qr-code-iso-18004">6.6.4 Micro QR Code (ISO 18004)</h3> +<figure> +<img src="images/microqr.svg" title="fig:" class="i2dbig" +alt="zint -b MICROQR -d "01234567"" /> +<figcaption +aria-hidden="true"><code>zint -b MICROQR -d "01234567"</code></figcaption> +</figure> +<p>A miniature version of the QR Code symbol for short messages, Micro +QR Code symbols can encode either Latin-1 characters or Shift JIS +characters. Input should be entered as a UTF-8 stream with conversion to +Latin-1 or Shift JIS being carried out automatically by Zint. A +preferred symbol size can be selected by using the <code>--vers</code> +option (API <code>option_2</code>), as shown in the table below. Note +that versions M1 and M2 have restrictions on what characters can be +encoded.</p> +<div id="tbl:micrqr_sizes" class="tablenos"> +<table id="tbl:micrqr_sizes" style="width:93%;" +data-tag=": Micro QR Code Sizes"> +<caption><span>Table : Micro QR Code Sizes</span> </caption> +<colgroup> +<col style="width: 11%" /> +<col style="width: 13%" /> +<col style="width: 19%" /> +<col style="width: 48%" /> +</colgroup> +<thead> +<tr> +<th>Input</th> +<th>Version</th> +<th>Symbol Size</th> +<th style="text-align: left;">Allowed Characters</th> +</tr> +</thead> +<tbody> +<tr> +<td>1</td> +<td>M1</td> +<td>11 x 11</td> +<td style="text-align: left;">Numeric only</td> +</tr> +<tr> +<td>2</td> +<td>M2</td> +<td>13 x 13</td> +<td style="text-align: left;">Numeric, uppercase letters, space, and the +characters <code>"$%*+-./:"</code></td> +</tr> +<tr> +<td>3</td> +<td>M3</td> +<td>15 x 15</td> +<td style="text-align: left;">Latin-1 and Shift JIS</td> +</tr> +<tr> +<td>4</td> +<td>M4</td> +<td>17 x 17</td> +<td style="text-align: left;">Latin-1 and Shift JIS</td> +</tr> +</tbody> +</table> +</div> +<p>Version M4 can encode up to 35 digits, 21 alphanumerics, 15 bytes or +9 Kanji characters.</p> +<p>Except for version M1, which is always ECC level L, the amount of ECC +codewords can be adjusted using the <code>--secure</code> option (API +<code>option_1</code>); however ECC level H is not available for any +version, and ECC level Q is only available for version M4:</p> +<div id="tbl:micrqr_eccs" class="tablenos"> +<table id="tbl:micrqr_eccs" style="width:99%;" +data-tag=": Micro QR ECC Levels"> +<caption><span>Table : Micro QR ECC Levels</span> </caption> +<colgroup> +<col style="width: 12%" /> +<col style="width: 12%" /> +<col style="width: 33%" /> +<col style="width: 19%" /> +<col style="width: 20%" /> +</colgroup> +<thead> +<tr> +<th>Input</th> +<th style="text-align: left;">ECC Level</th> +<th style="text-align: left;">Error Correction Capacity</th> +<th style="text-align: left;">Recovery Capacity</th> +<th style="text-align: left;">Available for Versions</th> +</tr> +</thead> +<tbody> +<tr> +<td>1</td> +<td style="text-align: left;">L</td> +<td style="text-align: left;">Approx 20% of symbol</td> +<td style="text-align: left;">Approx 7%</td> +<td style="text-align: left;">M1, M2, M3, M4</td> +</tr> +<tr> +<td>2</td> +<td style="text-align: left;">M</td> +<td style="text-align: left;">Approx 37% of symbol</td> +<td style="text-align: left;">Approx 15%</td> +<td style="text-align: left;">M2, M3, M4</td> +</tr> +<tr> +<td>3</td> +<td style="text-align: left;">Q</td> +<td style="text-align: left;">Approx 55% of symbol</td> +<td style="text-align: left;">Approx 25%</td> +<td style="text-align: left;">M4</td> +</tr> +</tbody> +</table> +</div> +<p>The defaults for symbol size and ECC level depend on the input and +whether either of them is specified.</p> +<p>For barcode readers that support it, non-ASCII data density may be +maximized by using the <code>--fullmultibyte</code> switch (API +<code>option_3 = ZINT_FULL_MULTIBYTE</code>).</p> +<p>Micro QR Code has four different masks designed to minimize unwanted +patterns. The best mask to use is selected automatically by Zint but may +be manually specified by using the <code>--mask</code> switch with +values 0-3, or in the API by setting +<code>option_3 = (N + 1) << 8</code> where N is 0-3. To use with +<code>ZINT_FULL_MULTIBYTE</code> set</p> +<div class="sourceCode" id="cb113"><pre +class="sourceCode c"><code class="sourceCode c"><span id="cb113-1"><a href="#cb113-1" aria-hidden="true" tabindex="-1"></a>option_3 <span class="op">=</span> ZINT_FULL_MULTIBYTE <span class="op">|</span> <span class="op">(</span>N <span class="op">+</span> <span class="dv">1</span><span class="op">)</span> <span class="op"><<</span> <span class="dv">8</span></span></code></pre></div> +<h3 id="rectangular-micro-qr-code-rmqr-iso-23941">6.6.5 Rectangular +Micro QR Code (rMQR) (ISO 23941)</h3> +<figure> +<img src="images/rmqr.svg" title="fig:" class="i2dbig" +alt="zint -b RMQR -d "0123456"" /> +<figcaption +aria-hidden="true"><code>zint -b RMQR -d "0123456"</code></figcaption> +</figure> +<p>A rectangular version of QR Code, rMQR supports encoding of GS1 data, +and either Latin-1 characters or Shift JIS characters, and other +encodings using the ECI mechanism. As with other symbologies data should +be entered as UTF-8 with conversion being handled by Zint. The amount of +ECC codewords can be adjusted using the <code>--secure</code> option +(API <code>option_1</code>), however only ECC levels M and H are valid +for this type of symbol.</p> +<div id="tbl:rmqr_eccs" class="tablenos"> +<table id="tbl:rmqr_eccs" data-tag=": rMQR ECC Levels"> +<caption><span>Table : rMQR ECC Levels</span> </caption> +<thead> +<tr> +<th>Input</th> +<th>ECC Level</th> +<th>Error Correction Capacity</th> +<th>Recovery Capacity</th> +</tr> +</thead> +<tbody> +<tr> +<td>2</td> +<td>M</td> +<td>Approx 37% of symbol</td> +<td>Approx 15%</td> +</tr> +<tr> +<td>4</td> +<td>H</td> +<td>Approx 65% of symbol</td> +<td>Approx 30%</td> +</tr> +</tbody> +</table> +</div> +<p>The preferred symbol sizes can be selected using the +<code>--vers</code> option (API <code>option_2</code>) as shown in the +table below. Input values between 33 and 38 fix the height of the symbol +while allowing Zint to determine the minimum symbol width.</p> +<div id="tbl:rmqr_sizes" class="tablenos"> +<table id="tbl:rmqr_sizes" data-tag=": rMQR Sizes"> +<caption><span>Table : rMQR Sizes</span> </caption> +<colgroup> +<col style="width: 9%" /> +<col style="width: 12%" /> +<col style="width: 25%" /> +<col style="width: 4%" /> +<col style="width: 9%" /> +<col style="width: 12%" /> +<col style="width: 28%" /> +</colgroup> +<thead> +<tr> +<th>Input</th> +<th>Version</th> +<th>Symbol Size (HxW)</th> +<th></th> +<th>Input</th> +<th>Version</th> +<th style="text-align: left;">Symbol Size (HxW)</th> +</tr> +</thead> +<tbody> +<tr> +<td>1</td> +<td>R7x43</td> +<td>7 x 43</td> +<td></td> +<td>20</td> +<td>R13x77</td> +<td style="text-align: left;">13 x 77</td> +</tr> +<tr> +<td>2</td> +<td>R7x59</td> +<td>7 x 59</td> +<td></td> +<td>21</td> +<td>R13x99</td> +<td style="text-align: left;">13 x 99</td> +</tr> +<tr> +<td>3</td> +<td>R7x77</td> +<td>7 x 77</td> +<td></td> +<td>22</td> +<td>R13x139</td> +<td style="text-align: left;">13 x 139</td> +</tr> +<tr> +<td>4</td> +<td>R7x99</td> +<td>7 x 99</td> +<td></td> +<td>23</td> +<td>R15x43</td> +<td style="text-align: left;">15 x 43</td> +</tr> +<tr> +<td>5</td> +<td>R7x139</td> +<td>7 x 139</td> +<td></td> +<td>24</td> +<td>R15x59</td> +<td style="text-align: left;">15 x 59</td> +</tr> +<tr> +<td>6</td> +<td>R9x43</td> +<td>9 x 43</td> +<td></td> +<td>25</td> +<td>R15x77</td> +<td style="text-align: left;">15 x 77</td> +</tr> +<tr> +<td>7</td> +<td>R9x59</td> +<td>9 x 59</td> +<td></td> +<td>26</td> +<td>R15x99</td> +<td style="text-align: left;">15 x 99</td> +</tr> +<tr> +<td>8</td> +<td>R9x77</td> +<td>9 x 77</td> +<td></td> +<td>27</td> +<td>R15x139</td> +<td style="text-align: left;">15 x 139</td> +</tr> +<tr> +<td>9</td> +<td>R9x99</td> +<td>9 x 99</td> +<td></td> +<td>28</td> +<td>R17x43</td> +<td style="text-align: left;">17 x 43</td> +</tr> +<tr> +<td>10</td> +<td>R9x139</td> +<td>9 x 139</td> +<td></td> +<td>29</td> +<td>R17x59</td> +<td style="text-align: left;">17 x 59</td> +</tr> +<tr> +<td>11</td> +<td>R11x27</td> +<td>11 x 27</td> +<td></td> +<td>30</td> +<td>R17x77</td> +<td style="text-align: left;">17 x 77</td> +</tr> +<tr> +<td>12</td> +<td>R11x43</td> +<td>11 x 43</td> +<td></td> +<td>31</td> +<td>R17x99</td> +<td style="text-align: left;">17 x 99</td> +</tr> +<tr> +<td>13</td> +<td>R11x59</td> +<td>11 x 59</td> +<td></td> +<td>32</td> +<td>R17x139</td> +<td style="text-align: left;">17 x 139</td> +</tr> +<tr> +<td>14</td> +<td>R11x77</td> +<td>11 x 77</td> +<td></td> +<td>33</td> +<td>R7xW</td> +<td style="text-align: left;">7 x automatic width</td> +</tr> +<tr> +<td>15</td> +<td>R11x99</td> +<td>11 x 99</td> +<td></td> +<td>34</td> +<td>R9xW</td> +<td style="text-align: left;">9 x automatic width</td> +</tr> +<tr> +<td>16</td> +<td>R11x139</td> +<td>11 x 139</td> +<td></td> +<td>35</td> +<td>R11xW</td> +<td style="text-align: left;">11 x automatic width</td> +</tr> +<tr> +<td>17</td> +<td>R13x27</td> +<td>13 x 27</td> +<td></td> +<td>36</td> +<td>R13xW</td> +<td style="text-align: left;">13 x automatic width</td> +</tr> +<tr> +<td>18</td> +<td>R13x43</td> +<td>13 x 43</td> +<td></td> +<td>37</td> +<td>R15xW</td> +<td style="text-align: left;">15 x automatic width</td> +</tr> +<tr> +<td>19</td> +<td>R13x59</td> +<td>13 x 59</td> +<td></td> +<td>38</td> +<td>R17xW</td> +<td style="text-align: left;">17 x automatic width</td> +</tr> +</tbody> +</table> +</div> +<p>The largest version R17x139 (32) can encode up to 361 digits, 219 +alphanumerics, 150 bytes, or 92 Kanji characters.</p> +<p>For barcode readers that support it, non-ASCII data density may be +maximized by using the <code>--fullmultibyte</code> switch or in the API +by setting <code>option_3 = ZINT_FULL_MULTIBYTE</code>.</p> +<h3 id="upnqr-univerzalnega-plačilnega-naloga-qr">6.6.6 UPNQR +(Univerzalnega Plačilnega Naloga QR)</h3> +<figure> +<img src="images/upnqr.svg" title="fig:" class="i2d" +alt="zint -b UPNQR -i upn_utf8.txt --quietzones" /> +<figcaption +aria-hidden="true"><code>zint -b UPNQR -i upn_utf8.txt --quietzones</code></figcaption> +</figure> +<p>A variation of QR Code used by Združenje Bank Slovenije (Bank +Association of Slovenia). The size, error correction level and ECI are +set by Zint and do not need to be specified. UPNQR is unusual in that it +uses Latin-2 (ISO/IEC 8859-2 plus ASCII) formatted data. Zint will +accept UTF-8 data and convert it to Latin-2, or if your data is already +Latin-2 formatted use the <code>--binary</code> switch (API +<code>input_mode = DATA_MODE</code>).</p> +<p>The following example creates a symbol from data saved as a Latin-2 +file:</p> +<div class="sourceCode" id="cb114"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb114-1"><a href="#cb114-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-o</span> upnqr.png <span class="at">-b</span> 143 <span class="at">--scale</span><span class="op">=</span>3 <span class="at">--binary</span> <span class="at">-i</span> upn.txt</span></code></pre></div> +<p>A mask may be manually specified or the <code>--fast</code> option +used as with QRCODE.</p> +<h3 id="maxicode-iso-16023">6.6.7 MaxiCode (ISO 16023)</h3> +<figure> +<img src="images/maxicode.svg" title="fig:" class="i2d" +alt="zint -b MAXICODE -d "1Z00004951\GUPSN\G06X610\G159\G1234567\G1/1\G\GY\G1 MAIN ST\GNY\GNY\R\E" --esc --primary="152382802000000" --scmvv=96" /> +<figcaption +aria-hidden="true"><code>zint -b MAXICODE -d "1Z00004951\GUPSN\G06X610\G159\G1234567\G1/1\G\GY\G1 MAIN ST\GNY\GNY\R\E" --esc --primary="152382802000000" --scmvv=96</code></figcaption> +</figure> +<p>Developed by UPS the MaxiCode symbology employs a grid of hexagons +surrounding a bullseye finder pattern. This symbology is designed for +the identification of parcels. MaxiCode symbols can be encoded in one of +five modes. In modes 2 and 3 MaxiCode symbols are composed of two parts +named the primary and secondary messages. The primary message consists +of a Structured Carrier Message which includes various data about the +package being sent and the secondary message usually consists of address +data in a data structure. The format of the primary message required by +Zint is given in the following table.</p> +<div id="tbl:maxicode_scm" class="tablenos"> +<table id="tbl:maxicode_scm" +data-tag=": MaxiCode Structured Carrier Message Format"> +<caption><span>Table : MaxiCode Structured Carrier Message +Format:</span> </caption> +<thead> +<tr> +<th>Characters</th> +<th style="text-align: left;">Meaning</th> +</tr> +</thead> +<tbody> +<tr> +<td>1 - 9</td> +<td style="text-align: left;">Postcode data which can consist of up to 9 +digits (for mode 2)</td> +</tr> +<tr> +<td></td> +<td style="text-align: left;">or up to 6 alphanumeric characters (for +mode 3). Remaining</td> +</tr> +<tr> +<td></td> +<td style="text-align: left;">unused characters for mode 3 can be filled +with the SPACE</td> +</tr> +<tr> +<td></td> +<td style="text-align: left;">character (ASCII 32) or omitted.</td> +</tr> +<tr> +<td></td> +<td style="text-align: left;">(adjust the following character positions +according to postcode</td> +</tr> +<tr> +<td></td> +<td style="text-align: left;">length)</td> +</tr> +<tr> +<td>10 - 12</td> +<td style="text-align: left;">Three-digit country code according to ISO +3166-1.</td> +</tr> +<tr> +<td>13 - 15</td> +<td style="text-align: left;">Three-digit service code. This depends on +your parcel courier.</td> +</tr> +</tbody> +</table> +</div> +<p>The primary message can be set at the command prompt using the +<code>--primary</code> switch (API <code>primary</code>). The secondary +message uses the normal data entry method. For example:</p> +<div class="sourceCode" id="cb115"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb115-1"><a href="#cb115-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-o</span> test.eps <span class="at">-b</span> 57 <span class="at">--primary</span><span class="op">=</span><span class="st">"999999999840012"</span> <span class="dt">\</span></span> +<span id="cb115-2"><a href="#cb115-2" aria-hidden="true" tabindex="-1"></a> <span class="at">-d</span> <span class="st">"Secondary Message Here"</span></span></code></pre></div> +<p>When using the API the primary message must be placed in the +<code>primary</code> string. The secondary is entered in the same way as +described in <a href="#encoding-and-saving-to-file">5.2 Encoding and +Saving to File</a>. When either of these modes is selected Zint will +analyse the primary message and select either mode 2 or mode 3 as +appropriate.</p> +<p>As a convenience the secondary message for modes 2 and 3 can be set +to be prefixed by the ISO/IEC 15434 Format <code>"01"</code> +(transportation) sequence <code>"[)>\R01\Gvv"</code>, where +<code>vv</code> is a 2-digit version, by using the <code>--scmvv</code> +switch (API <code>option_2 = vv + 1</code>). For example to use the +common version <code>"96"</code> (ASC MH10/SC 8):</p> +<div class="sourceCode" id="cb116"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb116-1"><a href="#cb116-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> 57 <span class="at">--primary</span><span class="op">=</span><span class="st">"152382802840001"</span> <span class="at">--scmvv</span><span class="op">=</span>96 <span class="at">--esc</span> <span class="at">-d</span> <span class="dt">\</span></span> +<span id="cb116-2"><a href="#cb116-2" aria-hidden="true" tabindex="-1"></a> <span class="st">"1Z00004951\GUPSN\G06X610\G159\G1234567\G1/1\G\GY\G1 MAIN ST\GNY\GNY\R\E"</span></span></code></pre></div> +<p>will prefix <code>"[)>\R01\G96"</code> to the secondary message. +(<code>\R</code>, <code>\G</code> and <code>\E</code> are the escape +sequences for Record Separator, Group Separator and End of Transmission +respectively - see Table <a href="#tbl:escape_sequences">: Escape +Sequences</a>.)</p> +<p>Modes 4 to 6 can be accessed using the <code>--mode</code> switch +(API <code>option_1</code>). Modes 4 to 6 do not have a primary message. +For example:</p> +<div class="sourceCode" id="cb117"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb117-1"><a href="#cb117-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-o</span> test.eps <span class="at">-b</span> 57 <span class="at">--mode</span><span class="op">=</span>4 <span class="at">-d</span> <span class="st">"A MaxiCode Message in Mode 4"</span></span></code></pre></div> +<p>Mode 6 is reserved for the maintenance of scanner hardware and should +not be used to encode user data.</p> +<p>This symbology uses Latin-1 character encoding by default but also +supports the ECI encoding mechanism. The maximum length of text which +can be placed in a MaxiCode symbol depends on the type of characters +used in the text.</p> +<p>Example maximum data lengths are given in the table below:</p> +<div id="tbl:maxicode_data_length_maxima" class="tablenos"> +<table id="tbl:maxicode_data_length_maxima" style="width:100%;" +data-tag=": MaxiCode Data Length Maxima"> +<caption><span>Table : MaxiCode Data Length Maxima</span> </caption> +<colgroup> +<col style="width: 9%" /> +<col style="width: 30%" /> +<col style="width: 30%" /> +<col style="width: 30%" /> +</colgroup> +<thead> +<tr> +<th>Mode</th> +<th>Maximum Data Length for Capital Letters</th> +<th style="text-align: left;">Maximum Data Length for Numeric +Digits</th> +<th style="text-align: left;">Number of Error Correction Codewords</th> +</tr> +</thead> +<tbody> +<tr> +<td>2<code>*</code></td> +<td>84</td> +<td style="text-align: left;">126</td> +<td style="text-align: left;">50</td> +</tr> +<tr> +<td>3<code>*</code></td> +<td>84</td> +<td style="text-align: left;">126</td> +<td style="text-align: left;">50</td> +</tr> +<tr> +<td>4</td> +<td>93</td> +<td style="text-align: left;">138</td> +<td style="text-align: left;">50</td> +</tr> +<tr> +<td>5</td> +<td>77</td> +<td style="text-align: left;">113</td> +<td style="text-align: left;">66</td> +</tr> +<tr> +<td>6</td> +<td>93</td> +<td style="text-align: left;">138</td> +<td style="text-align: left;">50</td> +</tr> +</tbody> +</table> +</div> +<p><code>*</code> - secondary only</p> +<p>MaxiCode supports Structured Append of up to 8 symbols, which can be +set by using the <code>--structapp</code> option (see <a +href="#structured-append">4.17 Structured Append</a>) (API +<code>structapp</code>). It does not support specifying an ID.</p> +<p>MaxiCode uses a different scaling than other symbols for raster +output, see <a href="#maxicode-raster-scaling">4.9.3 MaxiCode Raster +Scaling</a>, and also for EMF vector output, when the scale is +multiplied by 20 instead of 2.</p> +<h3 id="aztec-code-iso-24778">6.6.8 Aztec Code (ISO 24778)</h3> +<figure> +<img src="images/aztec.svg" title="fig:" class="i2d" +alt="zint -b AZTEC -d "123456789012"" /> +<figcaption +aria-hidden="true"><code>zint -b AZTEC -d "123456789012"</code></figcaption> +</figure> +<p>Invented by Andrew Longacre at Welch Allyn Inc in 1995 the Aztec Code +symbol is a matrix symbol with a distinctive bullseye finder pattern. +Zint can generate Compact Aztec Code (sometimes called Small Aztec Code) +as well as ‘full-range’ Aztec Code symbols and by default will +automatically select symbol type and size dependent on the length of the +data to be encoded. Error correction codewords will normally be +generated to fill at least 23% of the symbol. Two options are available +to change this behaviour:</p> +<p>The size of the symbol can be specified using the <code>--vers</code> +option (API <code>option_2</code>) to a value between 1 and 36 according +to the following table. The symbols marked with an asterisk +(<code>*</code>) in the table below are ‘compact’ symbols, meaning they +have a smaller bullseye pattern at the centre of the symbol.</p> +<div id="tbl:aztec_sizes" class="tablenos"> +<table id="tbl:aztec_sizes" data-tag=": Aztec Code Sizes"> +<caption><span>Table : Aztec Code Sizes</span> </caption> +<thead> +<tr> +<th>Input</th> +<th>Symbol Size</th> +<th></th> +<th>Input</th> +<th>Symbol Size</th> +<th></th> +<th>Input</th> +<th>Symbol Size</th> +</tr> +</thead> +<tbody> +<tr> +<td>1</td> +<td>15 x 15<code>*</code></td> +<td></td> +<td>13</td> +<td>53 x 53</td> +<td></td> +<td>25</td> +<td>105 x 105</td> +</tr> +<tr> +<td>2</td> +<td>19 x 19<code>*</code></td> +<td></td> +<td>14</td> +<td>57 x 57</td> +<td></td> +<td>26</td> +<td>109 x 109</td> +</tr> +<tr> +<td>3</td> +<td>23 x 23<code>*</code></td> +<td></td> +<td>15</td> +<td>61 x 61</td> +<td></td> +<td>27</td> +<td>113 x 113</td> +</tr> +<tr> +<td>4</td> +<td>27 x 27<code>*</code></td> +<td></td> +<td>16</td> +<td>67 x 67</td> +<td></td> +<td>28</td> +<td>117 x 117</td> +</tr> +<tr> +<td>5</td> +<td>19 x 19</td> +<td></td> +<td>17</td> +<td>71 x 71</td> +<td></td> +<td>29</td> +<td>121 x 121</td> +</tr> +<tr> +<td>6</td> +<td>23 x 23</td> +<td></td> +<td>18</td> +<td>75 x 75</td> +<td></td> +<td>30</td> +<td>125 x 125</td> +</tr> +<tr> +<td>7</td> +<td>27 x 27</td> +<td></td> +<td>19</td> +<td>79 x 79</td> +<td></td> +<td>31</td> +<td>131 x 131</td> +</tr> +<tr> +<td>8</td> +<td>31 x 31</td> +<td></td> +<td>20</td> +<td>83 x 83</td> +<td></td> +<td>32</td> +<td>135 x 135</td> +</tr> +<tr> +<td>9</td> +<td>37 x 37</td> +<td></td> +<td>21</td> +<td>87 x 87</td> +<td></td> +<td>33</td> +<td>139 x 139</td> +</tr> +<tr> +<td>10</td> +<td>41 x 41</td> +<td></td> +<td>22</td> +<td>91 x 91</td> +<td></td> +<td>34</td> +<td>143 x 143</td> +</tr> +<tr> +<td>11</td> +<td>45 x 45</td> +<td></td> +<td>23</td> +<td>95 x 95</td> +<td></td> +<td>35</td> +<td>147 x 147</td> +</tr> +<tr> +<td>12</td> +<td>49 x 49</td> +<td></td> +<td>24</td> +<td>101 x 101</td> +<td></td> +<td>36</td> +<td>151 x 151</td> +</tr> +</tbody> +</table> +</div> +<p>Note that in symbols which have a specified size the amount of error +correction is dependent on the length of the data input and Zint will +allow error correction capacities as low as 3 codewords.</p> +<p>Alternatively the amount of error correction data can be specified by +setting the <code>--secure</code> option (API <code>option_1</code>) to +a value from the following table.</p> +<div id="tbl:aztec_eccs" class="tablenos"> +<table id="tbl:aztec_eccs" +data-tag=": Aztec Code Error Correction Modes"> +<caption><span>Table : Aztec Code Error Correction Modes</span> +</caption> +<thead> +<tr> +<th>Mode</th> +<th>Error Correction Capacity</th> +</tr> +</thead> +<tbody> +<tr> +<td>1</td> +<td>>10% + 3 codewords</td> +</tr> +<tr> +<td>2</td> +<td>>23% + 3 codewords</td> +</tr> +<tr> +<td>3</td> +<td>>36% + 3 codewords</td> +</tr> +<tr> +<td>4</td> +<td>>50% + 3 codewords</td> +</tr> +</tbody> +</table> +</div> +<p>It is not possible to select both symbol size and error correction +capacity for the same symbol. If both options are selected then the +error correction capacity selection will be ignored.</p> +<p>Aztec Code supports ECI encoding and can encode up to a maximum +length of approximately 3823 numeric or 3067 alphabetic characters or +1914 bytes of data. A separate symbology ID +(<code>BARCODE_HIBC_AZTEC</code>) can be used to encode Health Industry +Barcode (HIBC) data.</p> +<p>Aztec Code supports Structured Append of up to 26 symbols and an +optional alphanumeric ID of up to 32 characters, which can be set by +using the <code>--structapp</code> option (see <a +href="#structured-append">4.17 Structured Append</a>) (API +<code>structapp</code>). The ID cannot contain spaces. If an ID is not +given, no ID is encoded.</p> +<h3 id="aztec-runes-iso-24778">6.6.9 Aztec Runes (ISO 24778)</h3> +<figure> +<img src="images/azrune.svg" title="fig:" class="i2d" +alt="zint -b AZRUNE -d "125"" /> +<figcaption +aria-hidden="true"><code>zint -b AZRUNE -d "125"</code></figcaption> +</figure> +<p>A truncated version of compact Aztec Code for encoding whole integers +between 0 and 255, as defined in ISO/IEC 24778 Annex A. Includes +Reed-Solomon error correction. It does not support Structured +Append.</p> +<h3 id="code-one">6.6.10 Code One</h3> +<figure> +<img src="images/codeone.svg" title="fig:" class="i2d" +alt="zint -b CODEONE -d "1234567890123456789012"" /> +<figcaption +aria-hidden="true"><code>zint -b CODEONE -d "1234567890123456789012"</code></figcaption> +</figure> +<p>A matrix symbology developed by Ted Williams in 1992 which encodes +data in a way similar to Data Matrix, Code One is able to encode the +Latin-1 character set or GS1 data, and also supports the ECI mechanism. +There are two types of Code One symbol - fixed-ratio symbols which are +roughly square (versions A through to H) and variable-width versions +(versions S and T). These can be selected by using <code>--vers</code> +(API <code>option_2</code>) as shown in the table below:</p> +<div id="tbl:codeone_sizes" class="tablenos"> +<table id="tbl:codeone_sizes" style="width:88%;" +data-tag=": Code One Sizes"> +<caption><span>Table : Code One Sizes</span> </caption> +<colgroup> +<col style="width: 11%" /> +<col style="width: 13%" /> +<col style="width: 18%" /> +<col style="width: 22%" /> +<col style="width: 22%" /> +</colgroup> +<thead> +<tr> +<th>Input</th> +<th>Version</th> +<th style="text-align: left;">Size (W x H)</th> +<th style="text-align: left;">Numeric Data Capacity</th> +<th style="text-align: left;">Alphanumeric Data Capacity</th> +</tr> +</thead> +<tbody> +<tr> +<td>1</td> +<td>A</td> +<td style="text-align: left;">16 x 18</td> +<td style="text-align: left;">22</td> +<td style="text-align: left;">13</td> +</tr> +<tr> +<td>2</td> +<td>B</td> +<td style="text-align: left;">22 x 22</td> +<td style="text-align: left;">44</td> +<td style="text-align: left;">27</td> +</tr> +<tr> +<td>3</td> +<td>C</td> +<td style="text-align: left;">28 x 28</td> +<td style="text-align: left;">104</td> +<td style="text-align: left;">64</td> +</tr> +<tr> +<td>4</td> +<td>D</td> +<td style="text-align: left;">40 x 42</td> +<td style="text-align: left;">217</td> +<td style="text-align: left;">135</td> +</tr> +<tr> +<td>5</td> +<td>E</td> +<td style="text-align: left;">52 x 54</td> +<td style="text-align: left;">435</td> +<td style="text-align: left;">271</td> +</tr> +<tr> +<td>6</td> +<td>F</td> +<td style="text-align: left;">70 x 76</td> +<td style="text-align: left;">886</td> +<td style="text-align: left;">553</td> +</tr> +<tr> +<td>7</td> +<td>G</td> +<td style="text-align: left;">104 x 98</td> +<td style="text-align: left;">1755</td> +<td style="text-align: left;">1096</td> +</tr> +<tr> +<td>8</td> +<td>H</td> +<td style="text-align: left;">148 x 134</td> +<td style="text-align: left;">3550</td> +<td style="text-align: left;">2218</td> +</tr> +<tr> +<td>9</td> +<td>S</td> +<td style="text-align: left;">width x 8</td> +<td style="text-align: left;">18</td> +<td style="text-align: left;">N/A</td> +</tr> +<tr> +<td>10</td> +<td>T</td> +<td style="text-align: left;">width x 16</td> +<td style="text-align: left;">90</td> +<td style="text-align: left;">55</td> +</tr> +</tbody> +</table> +</div> +<p>Version S symbols can only encode numeric data. The width of version +S and version T symbols is determined by the length of the input +data.</p> +<p>Code One supports Structured Append of up to 128 symbols, which can +be set by using the <code>--structapp</code> option (see <a +href="#structured-append">4.17 Structured Append</a>) (API +<code>structapp</code>). It does not support specifying an ID. +Structured Append is not supported with GS1 data nor for Version S +symbols.</p> +<h3 id="grid-matrix">6.6.11 Grid Matrix</h3> +<figure> +<img src="images/gridmatrix.svg" title="fig:" class="i2d" +alt="zint -b GRIDMATRIX --eci=29 -d "AAT2556 电池充电器+降压转换器 200mA至2A tel:86 019 82512738"" /> +<figcaption +aria-hidden="true"><code>zint -b GRIDMATRIX --eci=29 -d "AAT2556 电池充电器+降压转换器 200mA至2A tel:86 019 82512738"</code></figcaption> +</figure> +<p>Grid Matrix groups modules in a chequerboard pattern, and by default +supports the GB 2312 standard set, which includes Hanzi, ASCII and a +small number of ISO/IEC 8859-1 characters. Input should be entered as +UTF-8 with conversion to GB 2312 being carried out automatically by +Zint. Up to around 1529 alphanumeric characters or 2751 digits may be +encoded. The symbology also supports the ECI mechanism. Support for GS1 +data has not yet been implemented.</p> +<p>The size of the symbol and the error correction capacity can be +specified. If you specify both of these values then Zint will make a +‘best-fit’ attempt to satisfy both conditions. The symbol size can be +specified using the <code>--vers</code> option (API +<code>option_2</code>), and the error correction capacity can be +specified by using the <code>--secure</code> option (API +<code>option_1</code>), according to the following tables.</p> +<div id="tbl:gridmatrix_sizes" class="tablenos"> +<table id="tbl:gridmatrix_sizes" data-tag=": Grid Matrix Sizes"> +<caption><span>Table : Grid Matrix Sizes</span> </caption> +<thead> +<tr> +<th>Input</th> +<th>Symbol Size</th> +<th></th> +<th>Input</th> +<th>Symbol Size</th> +</tr> +</thead> +<tbody> +<tr> +<td>1</td> +<td>18 x 18</td> +<td></td> +<td>8</td> +<td>102 x 102</td> +</tr> +<tr> +<td>2</td> +<td>30 x 30</td> +<td></td> +<td>9</td> +<td>114 x 114</td> +</tr> +<tr> +<td>3</td> +<td>42 x 42</td> +<td></td> +<td>10</td> +<td>126 x 126</td> +</tr> +<tr> +<td>4</td> +<td>54 x 54</td> +<td></td> +<td>11</td> +<td>138 x 138</td> +</tr> +<tr> +<td>5</td> +<td>66 x 66</td> +<td></td> +<td>12</td> +<td>150 x 150</td> +</tr> +<tr> +<td>6</td> +<td>78 x 78</td> +<td></td> +<td>13</td> +<td>162 x 162</td> +</tr> +<tr> +<td>7</td> +<td>90 x 90</td> +<td></td> +<td></td> +<td></td> +</tr> +</tbody> +</table> +</div> +<div id="tbl:gridmatrix_eccs" class="tablenos"> +<table id="tbl:gridmatrix_eccs" +data-tag=": Grid Matrix Error Correction Modes"> +<caption><span>Table : Grid Matrix Error Correction Modes</span> +</caption> +<thead> +<tr> +<th>Mode</th> +<th>Error Correction Capacity</th> +</tr> +</thead> +<tbody> +<tr> +<td>1</td> +<td>Approximately 10%</td> +</tr> +<tr> +<td>2</td> +<td>Approximately 20%</td> +</tr> +<tr> +<td>3</td> +<td>Approximately 30%</td> +</tr> +<tr> +<td>4</td> +<td>Approximately 40%</td> +</tr> +<tr> +<td>5</td> +<td>Approximately 50%</td> +</tr> +</tbody> +</table> +</div> +<p>Non-ASCII data density may be maximized by using the +<code>--fullmultibyte</code> switch (API +<code>option_3 = ZINT_FULL_MULTIBYTE</code>), but check that your +barcode reader supports this before using.</p> +<p>Grid Matrix supports Structured Append of up to 16 symbols and a +numeric ID (file signature), which can be set by using the +<code>--structapp</code> option (see <a href="#structured-append">4.17 +Structured Append</a>) (API <code>structapp</code>). The ID ranges from +0 (default) to 255.</p> +<h3 id="dotcode">6.6.12 DotCode</h3> +<figure> +<img src="images/dotcode.svg" title="fig:" class="i2d" +alt="zint -b DOTCODE -d "[01]00012345678905[17]201231[10]ABC123456" --gs1" /> +<figcaption +aria-hidden="true"><code>zint -b DOTCODE -d "[01]00012345678905[17]201231[10]ABC123456" --gs1</code></figcaption> +</figure> +<p>DotCode uses a grid of dots in a rectangular formation to encode +characters up to a maximum of approximately 450 characters (or 900 +numeric digits). The symbology supports ECI encoding and GS1 data +encoding. By default Zint will produce a symbol which is approximately +square, however the width of the symbol can be adjusted by using the +<code>--cols</code> option (API <code>option_2</code>) (maximum 200). +Outputting DotCode to raster images (BMP, GIF, PCX, PNG, TIF) will +require setting the scale of the image to a larger value than the +default (e.g. approximately 10) for the dots to be plotted correctly. +Approximately 33% of the resulting symbol is comprised of error +correction codewords.</p> +<p>DotCode has two sets of 4 masks, designated 0-3 and 0’-3’, the second +<code>"prime"</code> set being the same as the first with corners lit. +The best mask to use is selected automatically by Zint but may be +manually specified by using the <code>--mask</code> switch with values +0-7, where 4-7 denote 0’-3’, or in the API by setting +<code>option_3 = (N + 1) << 8</code> where N is 0-7.</p> +<p>DotCode supports Structured Append of up to 35 symbols, which can be +set by using the <code>--structapp</code> option (see <a +href="#structured-append">4.17 Structured Append</a>) (API +<code>structapp</code>). It does not support specifying an ID.</p> +<h3 id="han-xin-code-iso-20830">6.6.13 Han Xin Code (ISO 20830)</h3> +<figure> +<img src="images/hanxin.svg" title="fig:" class="i2d" +alt="zint -b HANXIN -d "Hanxin Code symbol"" /> +<figcaption +aria-hidden="true"><code>zint -b HANXIN -d "Hanxin Code symbol"</code></figcaption> +</figure> +<p>Also known as Chinese Sensible Code, Han Xin is capable of encoding +characters in either the Latin-1 character set or the GB 18030 character +set (which is a UTF, i.e. includes all Unicode characters, optimized for +Chinese characters) and is also able to support the ECI mechanism. +Support for the encoding of GS1 data has not yet been implemented.</p> +<p>The size of the symbol can be specified using the <code>--vers</code> +option (API <code>option_2</code>) to a value between 1 and 84 according +to the following table.</p> +<div id="tbl:hanxin_sizes" class="tablenos"> +<table id="tbl:hanxin_sizes" data-tag=": Han Xin Sizes"> +<caption><span>Table : Han Xin Sizes</span> </caption> +<thead> +<tr> +<th>Input</th> +<th>Symbol Size</th> +<th></th> +<th>Input</th> +<th>Symbol Size</th> +<th></th> +<th>Input</th> +<th>Symbol Size</th> +</tr> +</thead> +<tbody> +<tr> +<td>1</td> +<td>23 x 23</td> +<td></td> +<td>29</td> +<td>79 x 79</td> +<td></td> +<td>57</td> +<td>135 x 135</td> +</tr> +<tr> +<td>2</td> +<td>25 x 25</td> +<td></td> +<td>30</td> +<td>81 x 81</td> +<td></td> +<td>58</td> +<td>137 x 137</td> +</tr> +<tr> +<td>3</td> +<td>27 x 27</td> +<td></td> +<td>31</td> +<td>83 x 83</td> +<td></td> +<td>59</td> +<td>139 x 139</td> +</tr> +<tr> +<td>4</td> +<td>29 x 29</td> +<td></td> +<td>32</td> +<td>85 x 85</td> +<td></td> +<td>60</td> +<td>141 x 141</td> +</tr> +<tr> +<td>5</td> +<td>31 x 31</td> +<td></td> +<td>33</td> +<td>87 x 87</td> +<td></td> +<td>61</td> +<td>143 x 143</td> +</tr> +<tr> +<td>6</td> +<td>33 x 33</td> +<td></td> +<td>34</td> +<td>89 x 89</td> +<td></td> +<td>62</td> +<td>145 x 145</td> +</tr> +<tr> +<td>7</td> +<td>35 x 35</td> +<td></td> +<td>35</td> +<td>91 x 91</td> +<td></td> +<td>63</td> +<td>147 x 147</td> +</tr> +<tr> +<td>8</td> +<td>37 x 37</td> +<td></td> +<td>36</td> +<td>93 x 93</td> +<td></td> +<td>64</td> +<td>149 x 149</td> +</tr> +<tr> +<td>9</td> +<td>39 x 39</td> +<td></td> +<td>37</td> +<td>95 x 95</td> +<td></td> +<td>65</td> +<td>151 x 151</td> +</tr> +<tr> +<td>10</td> +<td>41 x 41</td> +<td></td> +<td>38</td> +<td>97 x 97</td> +<td></td> +<td>66</td> +<td>153 x 153</td> +</tr> +<tr> +<td>11</td> +<td>43 x 43</td> +<td></td> +<td>39</td> +<td>99 x 99</td> +<td></td> +<td>67</td> +<td>155 x 155</td> +</tr> +<tr> +<td>12</td> +<td>45 x 45</td> +<td></td> +<td>40</td> +<td>101 x 101</td> +<td></td> +<td>68</td> +<td>157 x 157</td> +</tr> +<tr> +<td>13</td> +<td>47 x 47</td> +<td></td> +<td>41</td> +<td>103 x 103</td> +<td></td> +<td>69</td> +<td>159 x 159</td> +</tr> +<tr> +<td>14</td> +<td>49 x 49</td> +<td></td> +<td>42</td> +<td>105 x 105</td> +<td></td> +<td>70</td> +<td>161 x 161</td> +</tr> +<tr> +<td>15</td> +<td>51 x 51</td> +<td></td> +<td>43</td> +<td>107 x 107</td> +<td></td> +<td>71</td> +<td>163 x 163</td> +</tr> +<tr> +<td>16</td> +<td>53 x 53</td> +<td></td> +<td>44</td> +<td>109 x 109</td> +<td></td> +<td>72</td> +<td>165 x 165</td> +</tr> +<tr> +<td>17</td> +<td>55 x 55</td> +<td></td> +<td>45</td> +<td>111 x 111</td> +<td></td> +<td>73</td> +<td>167 x 167</td> +</tr> +<tr> +<td>18</td> +<td>57 x 57</td> +<td></td> +<td>46</td> +<td>113 x 113</td> +<td></td> +<td>74</td> +<td>169 x 169</td> +</tr> +<tr> +<td>19</td> +<td>59 x 59</td> +<td></td> +<td>47</td> +<td>115 x 115</td> +<td></td> +<td>75</td> +<td>171 x 171</td> +</tr> +<tr> +<td>20</td> +<td>61 x 61</td> +<td></td> +<td>48</td> +<td>117 x 117</td> +<td></td> +<td>76</td> +<td>173 x 173</td> +</tr> +<tr> +<td>21</td> +<td>63 x 63</td> +<td></td> +<td>49</td> +<td>119 x 119</td> +<td></td> +<td>77</td> +<td>175 x 175</td> +</tr> +<tr> +<td>22</td> +<td>65 x 65</td> +<td></td> +<td>50</td> +<td>121 x 121</td> +<td></td> +<td>78</td> +<td>177 x 177</td> +</tr> +<tr> +<td>23</td> +<td>67 x 67</td> +<td></td> +<td>51</td> +<td>123 x 123</td> +<td></td> +<td>79</td> +<td>179 x 179</td> +</tr> +<tr> +<td>24</td> +<td>69 x 69</td> +<td></td> +<td>52</td> +<td>125 x 125</td> +<td></td> +<td>80</td> +<td>181 x 181</td> +</tr> +<tr> +<td>25</td> +<td>71 x 71</td> +<td></td> +<td>53</td> +<td>127 x 127</td> +<td></td> +<td>81</td> +<td>183 x 183</td> +</tr> +<tr> +<td>26</td> +<td>73 x 73</td> +<td></td> +<td>54</td> +<td>129 x 129</td> +<td></td> +<td>82</td> +<td>185 x 185</td> +</tr> +<tr> +<td>27</td> +<td>75 x 75</td> +<td></td> +<td>55</td> +<td>131 x 131</td> +<td></td> +<td>83</td> +<td>187 x 187</td> +</tr> +<tr> +<td>28</td> +<td>77 x 77</td> +<td></td> +<td>56</td> +<td>133 x 133</td> +<td></td> +<td>84</td> +<td>189 x 189</td> +</tr> +</tbody> +</table> +</div> +<p>The largest version (84) can encode 7827 digits, 4350 ASCII +characters, up to 2175 Chinese characters, or 3261 bytes, making it the +most capacious of all the barcodes supported by Zint.</p> +<p>There are four levels of error correction capacity available for Han +Xin Code which can be set by using the <code>--secure</code> option (API +<code>option_1</code>) to a value from the following table.</p> +<div id="tbl:hanxin_eccs" class="tablenos"> +<table id="tbl:hanxin_eccs" data-tag=": Han Xin Error Correction Modes"> +<caption><span>Table : Han Xin Error Correction Modes</span> </caption> +<thead> +<tr> +<th>Mode</th> +<th>Recovery Capacity</th> +</tr> +</thead> +<tbody> +<tr> +<td>1</td> +<td>Approx 8%</td> +</tr> +<tr> +<td>2</td> +<td>Approx 15%</td> +</tr> +<tr> +<td>3</td> +<td>Approx 23%</td> +</tr> +<tr> +<td>4</td> +<td>Approx 30%</td> +</tr> +</tbody> +</table> +</div> +<p>Non-ASCII data density may be maximized by using the +<code>--fullmultibyte</code> switch (API +<code>option_3 = ZINT_FULL_MULTIBYTE</code>), but check that your +barcode reader supports this before using.</p> +<p>Han Xin has four different masks designed to minimize unwanted +patterns. The best mask to use is selected automatically by Zint but may +be manually specified by using the <code>--mask</code> switch with +values 0-3, or in the API by setting +<code>option_3 = (N + 1) << 8</code> where N is 0-3. To use with +<code>ZINT_FULL_MULTIBYTE</code> set</p> +<div class="sourceCode" id="cb118"><pre +class="sourceCode c"><code class="sourceCode c"><span id="cb118-1"><a href="#cb118-1" aria-hidden="true" tabindex="-1"></a>option_3 <span class="op">=</span> ZINT_FULL_MULTIBYTE <span class="op">|</span> <span class="op">(</span>N <span class="op">+</span> <span class="dv">1</span><span class="op">)</span> <span class="op"><<</span> <span class="dv">8</span></span></code></pre></div> +<h3 id="ultracode">6.6.14 Ultracode</h3> +<figure> +<img src="images/ultra.svg" title="fig:" class="ultra" +alt="zint -b ULTRA -d "HEIMASÍÐA KENNARAHÁSKÓLA ÍSLANDS"" /> +<figcaption +aria-hidden="true"><code>zint -b ULTRA -d "HEIMASÍÐA KENNARAHÁSKÓLA ÍSLANDS"</code></figcaption> +</figure> +<p>This symbology uses a grid of coloured elements to encode data. ECI +and GS1 modes are supported. The amount of error correction can be set +using the <code>--secure</code> option (API <code>option_1</code>) to a +value as shown in the following table.</p> +<div id="tbl:ultra_eccs" class="tablenos"> +<table id="tbl:ultra_eccs" +data-tag=": Ultracode Error Correction Values"> +<caption><span>Table : Ultracode Error Correction Values</span> +</caption> +<thead> +<tr> +<th>Value</th> +<th>EC Level</th> +<th>Amount of symbol holding error correction data</th> +</tr> +</thead> +<tbody> +<tr> +<td>1</td> +<td>EC0</td> +<td>0% - Error detection only</td> +</tr> +<tr> +<td>2</td> +<td>EC1</td> +<td>Approx 5%</td> +</tr> +<tr> +<td>3</td> +<td>EC2</td> +<td>Approx 9% - Default value</td> +</tr> +<tr> +<td>4</td> +<td>EC3</td> +<td>Approx 17%</td> +</tr> +<tr> +<td>5</td> +<td>EC4</td> +<td>Approx 25%</td> +</tr> +<tr> +<td>6</td> +<td>EC5</td> +<td>Approx 33%</td> +</tr> +</tbody> +</table> +</div> +<p>Zint does not currently implement data compression by default, but +this can be initiated through the API by setting</p> +<div class="sourceCode" id="cb119"><pre +class="sourceCode c"><code class="sourceCode c"><span id="cb119-1"><a href="#cb119-1" aria-hidden="true" tabindex="-1"></a>symbol<span class="op">-></span>option_3 <span class="op">=</span> ULTRA_COMPRESSION<span class="op">;</span></span></code></pre></div> +<p>With compression, up to 504 digits, 375 alphanumerics or 252 bytes +can be encoded.</p> +<p>Revision 2 of Ultracode (2023) may be specified using +<code>--vers=2</code> (API <code>option_2 = 2</code>).</p> +<hr /> +<p>WARNING: Revision 2 of Ultracode was only finalized December 2023 and +Zint has not yet been updated to support it. Do not use.</p> +<hr /> +<p>Ultracode supports Structured Append of up to 8 symbols and an +optional numeric ID (File Number), which can be set by using the +<code>--structapp</code> option (see <a href="#structured-append">4.17 +Structured Append</a>) (API <code>structapp</code>). The ID ranges from +1 to 80088. If an ID is not given, no ID is encoded.</p> +<h2 id="other-barcode-like-markings">6.7 Other Barcode-Like +Markings</h2> +<h3 id="facing-identification-mark-fim">6.7.1 Facing Identification Mark +(FIM)</h3> +<figure> +<img src="images/fim.svg" title="fig:" class="trk" +alt="zint -b FIM --compliantheight -d "C"" /> +<figcaption +aria-hidden="true"><code>zint -b FIM --compliantheight -d "C"</code></figcaption> +</figure> +<p>Used by the United States Postal Service (USPS), the FIM symbology is +used to assist automated mail processing. There are only 5 valid symbols +which can be generated using the characters A-E as shown in the table +below.</p> +<div id="tbl:fim_characters" class="tablenos"> +<table id="tbl:fim_characters" data-tag=": Valid FIM Characters"> +<caption><span>Table : Valid FIM Characters</span> </caption> +<thead> +<tr> +<th>Code Letter</th> +<th style="text-align: left;">Usage</th> +</tr> +</thead> +<tbody> +<tr> +<td>A</td> +<td style="text-align: left;">Used for courtesy reply mail and metered +reply mail with a</td> +</tr> +<tr> +<td></td> +<td style="text-align: left;">pre-printed POSTNET symbol.</td> +</tr> +<tr> +<td>B</td> +<td style="text-align: left;">Used for business reply mail without a +pre-printed zip code.</td> +</tr> +<tr> +<td>C</td> +<td style="text-align: left;">Used for business reply mail with a +pre-printed zip code.</td> +</tr> +<tr> +<td>D</td> +<td style="text-align: left;">Used for Information Based Indicia (IBI) +postage.</td> +</tr> +<tr> +<td>E</td> +<td style="text-align: left;">Used for customized mail with a USPS +Intelligent Mail barcode.</td> +</tr> +</tbody> +</table> +</div> +<h3 id="flattermarken">6.7.2 Flattermarken</h3> +<figure> +<img src="images/flat.svg" title="fig:" class="lin" +alt="zint -b FLAT -d "1304056"" /> +<figcaption +aria-hidden="true"><code>zint -b FLAT -d "1304056"</code></figcaption> +</figure> +<p>Used for the recognition of page sequences in print-shops, the +Flattermarken is not a true barcode symbol and requires precise +knowledge of the position of the mark on the page. The Flattermarken +system can encode numeric data up to a maximum of 128 digits and does +not include a check digit.</p> +<h1 id="legal-and-version-information">7. Legal and Version +Information</h1> +<h2 id="license">7.1 License</h2> +<p>Zint, libzint and Zint Barcode Studio are Copyright © 2024 Robin +Stuart. All historical versions are distributed under the GNU General +Public License version 3 or later. Versions 2.5 and later are released +under a dual license: the encoding library is released under the BSD (3 +clause) license whereas the GUI, Zint Barcode Studio, and the CLI are +released under the GNU General Public License version 3 or later.</p> +<p>Telepen is a trademark of SB Electronic Systems Ltd.</p> +<p>QR Code is a registered trademark of Denso Wave Incorporated.</p> +<p>Mailmark is a registered trademark of Royal Mail Group Ltd.</p> +<p>Microsoft, Windows and the Windows logo are either registered +trademarks or trademarks of Microsoft Corporation in the United States +and/or other countries.</p> +<p>Linux is the registered trademark of Linus Torvalds in the U.S. and +other countries.</p> +<p>Mac and macOS are trademarks of Apple Inc., registered in the U.S. +and other countries.</p> +<p>The Zint logo is derived from “SF Planetary Orbiter” font by +ShyFoundary.</p> +<p>Zint.org.uk website design and hosting provided by Robert +Elliott.</p> +<h2 id="patent-issues">7.2 Patent Issues</h2> +<p>All of the code in Zint is developed using information in the public +domain, usually freely available on the Internet. Some of the techniques +used may be subject to patents and other intellectual property +legislation. It is my belief that any patents involved in the technology +underlying symbologies utilised by Zint are ‘unadopted’, that is the +holder does not object to their methods being used.</p> +<p>Any methods patented or owned by third parties or trademarks or +registered trademarks used within Zint or in this document are and +remain the property of their respective owners and do not indicate +endorsement or affiliation with those owners, companies or +organisations.</p> +<h2 id="version-information">7.3 Version Information</h2> +<p>The current stable version of Zint is 2.13.0, released on 18th +December 2023.</p> +<p>See <code>"ChangeLog"</code> in the project root directory for +information on all releases.</p> +<h2 id="sources-of-information">7.4 Sources of Information</h2> +<p>Below is a list of some of the sources used in rough chronological +order:</p> +<ul> +<li>Nick Johnson’s Barcode Specifications</li> +<li>Bar Code 1 Specification Source Page</li> +<li>SB Electronic Systems Telepen website</li> +<li>Pharmacode specifications from Laetus</li> +<li>Morovia RM4SCC specification</li> +<li>Australia Post’s ‘A Guide to Printing the 4-State Barcode’ and +bcsample source code</li> +<li>Plessey algorithm from GNU-Barcode v0.98 by Leonid A. Broukhis</li> +<li>GS1 General Specifications v 8.0 Issue 2</li> +<li>PNG: The Definitive Guide and wpng source code by Greg Reolofs</li> +<li>PDF417 specification and pdf417 source code by Grand Zebu</li> +<li>Barcode Reference, TBarCode/X User Documentation and TBarCode/X +demonstration program from Tec-It</li> +<li>IEC16022 source code by Stefan Schmidt et al</li> +<li>United States Postal Service Specification USPS-B-3200</li> +<li>Adobe Systems Incorporated Encapsulated PostScript File Format +Specification</li> +<li>BSI Online Library</li> +<li>Libdmtx Data Matrix ECC200 decoding library</li> +</ul> +<h2 id="standards-compliance">7.5 Standards Compliance</h2> +<p>Zint was developed to provide compliance with the following British +and international standards:</p> +<h3 id="symbology-standards">7.5.1 Symbology Standards</h3> +<ul> +<li>ISO/IEC 24778:2008 Information technology - Automatic identification +and data capture techniques - Aztec Code bar code symbology +specification</li> +<li>SEMI T1-95 Specification for Back Surface Bar Code Marking of +Silicon Wafers (BC412) (1996)</li> +<li>ANSI/AIM BC12-1998 - Uniform Symbology Specification Channel +Code</li> +<li>BS EN 798:1996 Bar coding - Symbology specifications - +‘Codabar’</li> +<li>AIM Europe ISS-X-24 - Uniform Symbology Specification Codablock-F +(1995)</li> +<li>ISO/IEC 15417:2007 Information technology - Automatic identification +and data capture techniques - Code 128 bar code symbology +specification</li> +<li>BS EN 12323:2005 AIDC technologies - Symbology specifications - Code +16K</li> +<li>ISO/IEC 16388:2007 Information technology - Automatic identification +and data capture techniques - Code 39 bar code symbology +specification</li> +<li>ANSI/AIM BC6-2000 - Uniform Symbology Specification Code 49</li> +<li>ANSI/AIM BC5-1995 - Uniform Symbology Specification Code 93</li> +<li>AIM Uniform Symbology Specification Code One (1994)</li> +<li>ISO/IEC 16022:2006 Information technology - Automatic identification +and data capture techniques - Data Matrix ECC200 bar code symbology +specification</li> +<li>ISO/IEC 21471:2020 Information technology - Automatic identification +and data capture techniques - Extended rectangular data matrix (DMRE) +bar code symbology specification</li> +<li>AIM TSC1705001 (v 4.0 Draft 0.15) - Information technology - +Automatic identification and data capture techniques - Bar code +symbology specification - DotCode (Revised 28th May 2019)</li> +<li>ISO/IEC 15420:2009 Information technology - Automatic identification +and data capture techniques - EAN/UPC bar code symbology +specification</li> +<li>AIMD014 (v 1.63) - Information technology, Automatic identification +and data capture techniques - Bar code symbology specification - Grid +Matrix (Released 9th Dec 2008)</li> +<li>ISO/IEC 24723:2010 Information technology - Automatic identification +and data capture techniques - GS1 Composite bar code symbology +specification</li> +<li>ISO/IEC 24724:2011 Information technology - Automatic identification +and data capture techniques - GS1 DataBar bar code symbology +specification</li> +<li>ISO/IEC 20830:2021 Information technology - Automatic identification +and data capture techniques - Han Xin Code bar code symbology +specification</li> +<li>ISO/IEC 16390:2007 Information technology - Automatic identification +and data capture techniques - Interleaved 2 of 5 bar code symbology +specification</li> +<li>ISO/IEC 16023:2000 Information technology - International symbology +specification - MaxiCode</li> +<li>ISO/IEC 24728:2006 Information technology - Automatic identification +and data capture techniques - MicroPDF417 bar code symbology +specification</li> +<li>ISO/IEC 15438:2015 Information technology - Automatic identification +and data capture techniques - PDF417 bar code symbology +specification</li> +<li>ISO/IEC 18004:2015 Information technology - Automatic identification +and data capture techniques - QR Code bar code symbology +specification</li> +<li>ISO/IEC 23941:2022 Information technology - Automatic identification +and data capture techniques - Rectangular Micro QR Code (rMQR) bar code +symbology specification</li> +<li>AIMD/TSC15032-43 (v 0.99c) - International Technical Specification - +Ultracode Symbology (Draft) (Released 4th Nov 2015)</li> +</ul> +<p>A number of other specification documents have also been referenced, +such as MIL-STD-1189 Rev. B (1989) (LOGMARS), USPS DMM 300 2006 (2011) +(POSTNET, PLANET, FIM) and USPS-B-3200 (2015) (IMAIL). Those not named +include postal and delivery company references in particular.</p> +<h3 id="general-standards">7.5.2 General Standards</h3> +<ul> +<li>AIM ITS/04-001 International Technical Standard - Extended Channel +Interpretations Part 1: Identification Schemes and Protocol (Released +24th May 2004)</li> +<li>AIM ITS/04-023 International Technical Standard - Extended Channel +Interpretations Part 3: Register (Version 2, February 2022)</li> +<li>GS1 General Specifications Release 24.0 (Jan 2024)</li> +<li>ANSI/HIBC 2.6-2016 - The Health Industry Bar Code (HIBC) Supplier +Labeling Standard</li> +</ul> +<h1 id="annex-a.-character-encoding">Annex A. Character Encoding</h1> +<p>This section is intended as a quick reference to the character sets +used by Zint. All symbologies use standard ASCII input as shown in +section A.1, but some support extended characters as shown in the +subsequent section <a href="#a.2-latin-alphabet-no.-1-isoiec-8859-1">A.2 +Latin Alphabet No. 1 (ISO/IEC 8859-1)</a>.</p> +<h2 id="a.1-ascii-standard">A.1 ASCII Standard</h2> +<p>The ubiquitous ASCII standard is well known to most computer users. +It’s reproduced here for reference.</p> +<div id="tbl:ascii" class="tablenos"> +<table id="tbl:ascii" data-tag=": ASCII"> +<caption><span>Table : ASCII</span> </caption> +<thead> +<tr> +<th>Hex</th> +<th style="text-align: left;">0</th> +<th style="text-align: left;">1</th> +<th style="text-align: left;">2</th> +<th style="text-align: left;">3</th> +<th style="text-align: left;">4</th> +<th style="text-align: left;">5</th> +<th style="text-align: left;">6</th> +<th style="text-align: left;">7</th> +</tr> +</thead> +<tbody> +<tr> +<td>0</td> +<td style="text-align: left;"><code>NUL</code></td> +<td style="text-align: left;"><code>DLE</code></td> +<td style="text-align: left;"><code>SPACE</code></td> +<td style="text-align: left;"><code>0</code></td> +<td style="text-align: left;"><code>@</code></td> +<td style="text-align: left;"><code>P</code></td> +<td style="text-align: left;"><code>`</code></td> +<td style="text-align: left;"><code>p</code></td> +</tr> +<tr> +<td>1</td> +<td style="text-align: left;"><code>SOH</code></td> +<td style="text-align: left;"><code>DC1</code></td> +<td style="text-align: left;"><code>!</code></td> +<td style="text-align: left;"><code>1</code></td> +<td style="text-align: left;"><code>A</code></td> +<td style="text-align: left;"><code>Q</code></td> +<td style="text-align: left;"><code>a</code></td> +<td style="text-align: left;"><code>q</code></td> +</tr> +<tr> +<td>2</td> +<td style="text-align: left;"><code>STX</code></td> +<td style="text-align: left;"><code>DC2</code></td> +<td style="text-align: left;"><code>"</code></td> +<td style="text-align: left;"><code>2</code></td> +<td style="text-align: left;"><code>B</code></td> +<td style="text-align: left;"><code>R</code></td> +<td style="text-align: left;"><code>b</code></td> +<td style="text-align: left;"><code>r</code></td> +</tr> +<tr> +<td>3</td> +<td style="text-align: left;"><code>ETX</code></td> +<td style="text-align: left;"><code>DC3</code></td> +<td style="text-align: left;"><code>#</code></td> +<td style="text-align: left;"><code>3</code></td> +<td style="text-align: left;"><code>C</code></td> +<td style="text-align: left;"><code>S</code></td> +<td style="text-align: left;"><code>c</code></td> +<td style="text-align: left;"><code>s</code></td> +</tr> +<tr> +<td>4</td> +<td style="text-align: left;"><code>EOT</code></td> +<td style="text-align: left;"><code>DC4</code></td> +<td style="text-align: left;"><code>$</code></td> +<td style="text-align: left;"><code>4</code></td> +<td style="text-align: left;"><code>D</code></td> +<td style="text-align: left;"><code>T</code></td> +<td style="text-align: left;"><code>d</code></td> +<td style="text-align: left;"><code>t</code></td> +</tr> +<tr> +<td>5</td> +<td style="text-align: left;"><code>ENQ</code></td> +<td style="text-align: left;"><code>NAK</code></td> +<td style="text-align: left;"><code>%</code></td> +<td style="text-align: left;"><code>5</code></td> +<td style="text-align: left;"><code>E</code></td> +<td style="text-align: left;"><code>U</code></td> +<td style="text-align: left;"><code>e</code></td> +<td style="text-align: left;"><code>u</code></td> +</tr> +<tr> +<td>6</td> +<td style="text-align: left;"><code>ACK</code></td> +<td style="text-align: left;"><code>SYN</code></td> +<td style="text-align: left;"><code>&</code></td> +<td style="text-align: left;"><code>6</code></td> +<td style="text-align: left;"><code>F</code></td> +<td style="text-align: left;"><code>V</code></td> +<td style="text-align: left;"><code>f</code></td> +<td style="text-align: left;"><code>v</code></td> +</tr> +<tr> +<td>7</td> +<td style="text-align: left;"><code>BEL</code></td> +<td style="text-align: left;"><code>ETB</code></td> +<td style="text-align: left;"><code>'</code></td> +<td style="text-align: left;"><code>7</code></td> +<td style="text-align: left;"><code>G</code></td> +<td style="text-align: left;"><code>W</code></td> +<td style="text-align: left;"><code>g</code></td> +<td style="text-align: left;"><code>w</code></td> +</tr> +<tr> +<td>8</td> +<td style="text-align: left;"><code>BS</code></td> +<td style="text-align: left;"><code>CAN</code></td> +<td style="text-align: left;"><code>(</code></td> +<td style="text-align: left;"><code>8</code></td> +<td style="text-align: left;"><code>H</code></td> +<td style="text-align: left;"><code>X</code></td> +<td style="text-align: left;"><code>h</code></td> +<td style="text-align: left;"><code>x</code></td> +</tr> +<tr> +<td>9</td> +<td style="text-align: left;"><code>TAB</code></td> +<td style="text-align: left;"><code>EM</code></td> +<td style="text-align: left;"><code>)</code></td> +<td style="text-align: left;"><code>9</code></td> +<td style="text-align: left;"><code>I</code></td> +<td style="text-align: left;"><code>Y</code></td> +<td style="text-align: left;"><code>i</code></td> +<td style="text-align: left;"><code>y</code></td> +</tr> +<tr> +<td>A</td> +<td style="text-align: left;"><code>LF</code></td> +<td style="text-align: left;"><code>SUB</code></td> +<td style="text-align: left;"><code>*</code></td> +<td style="text-align: left;"><code>:</code></td> +<td style="text-align: left;"><code>J</code></td> +<td style="text-align: left;"><code>Z</code></td> +<td style="text-align: left;"><code>j</code></td> +<td style="text-align: left;"><code>z</code></td> +</tr> +<tr> +<td>B</td> +<td style="text-align: left;"><code>VT</code></td> +<td style="text-align: left;"><code>ESC</code></td> +<td style="text-align: left;"><code>+</code></td> +<td style="text-align: left;"><code>;</code></td> +<td style="text-align: left;"><code>K</code></td> +<td style="text-align: left;"><code>[</code></td> +<td style="text-align: left;"><code>k</code></td> +<td style="text-align: left;"><code>{</code></td> +</tr> +<tr> +<td>C</td> +<td style="text-align: left;"><code>FF</code></td> +<td style="text-align: left;"><code>FS</code></td> +<td style="text-align: left;"><code>,</code></td> +<td style="text-align: left;"><code><</code></td> +<td style="text-align: left;"><code>L</code></td> +<td style="text-align: left;"><code>\</code></td> +<td style="text-align: left;"><code>l</code></td> +<td style="text-align: left;"><code>|</code></td> +</tr> +<tr> +<td>D</td> +<td style="text-align: left;"><code>CR</code></td> +<td style="text-align: left;"><code>GS</code></td> +<td style="text-align: left;"><code>-</code></td> +<td style="text-align: left;"><code>=</code></td> +<td style="text-align: left;"><code>M</code></td> +<td style="text-align: left;"><code>]</code></td> +<td style="text-align: left;"><code>m</code></td> +<td style="text-align: left;"><code>}</code></td> +</tr> +<tr> +<td>E</td> +<td style="text-align: left;"><code>SO</code></td> +<td style="text-align: left;"><code>RS</code></td> +<td style="text-align: left;"><code>.</code></td> +<td style="text-align: left;"><code>></code></td> +<td style="text-align: left;"><code>N</code></td> +<td style="text-align: left;"><code>^</code></td> +<td style="text-align: left;"><code>n</code></td> +<td style="text-align: left;"><code>~</code></td> +</tr> +<tr> +<td>F</td> +<td style="text-align: left;"><code>SI</code></td> +<td style="text-align: left;"><code>US</code></td> +<td style="text-align: left;"><code>/</code></td> +<td style="text-align: left;"><code>?</code></td> +<td style="text-align: left;"><code>O</code></td> +<td style="text-align: left;"><code>_</code></td> +<td style="text-align: left;"><code>o</code></td> +<td style="text-align: left;"><code>DEL</code></td> +</tr> +</tbody> +</table> +</div> +<h2 id="a.2-latin-alphabet-no.-1-isoiec-8859-1">A.2 Latin Alphabet No. 1 +(ISO/IEC 8859-1)</h2> +<p>ISO/IEC 8859-1 defines additional characters common in western +European languages like French, German, Italian and Spanish. This +extension is the default encoding of many barcodes (see Table <a +href="#tbl:default_character_sets">: Default Character Sets</a>) when a +codepoint above hex 9F is encoded. Note that codepoints hex 80 to 9F are +not defined.</p> +<div id="tbl:iso_iec_8869_1" class="tablenos"> +<table id="tbl:iso_iec_8869_1" data-tag=": ISO/IEC 8859-1"> +<caption><span>Table : ISO/IEC 8859-1</span> </caption> +<thead> +<tr> +<th>Hex</th> +<th style="text-align: left;">8</th> +<th style="text-align: left;">9</th> +<th style="text-align: left;">A</th> +<th style="text-align: left;">B</th> +<th style="text-align: left;">C</th> +<th style="text-align: left;">D</th> +<th style="text-align: left;">E</th> +<th style="text-align: left;">F</th> +</tr> +</thead> +<tbody> +<tr> +<td>0</td> +<td style="text-align: left;"></td> +<td style="text-align: left;"></td> +<td style="text-align: left;"><code>NBSP</code></td> +<td style="text-align: left;"><code>°</code></td> +<td style="text-align: left;"><code>À</code></td> +<td style="text-align: left;"><code>Ð</code></td> +<td style="text-align: left;"><code>à</code></td> +<td style="text-align: left;"><code>ð</code></td> +</tr> +<tr> +<td>1</td> +<td style="text-align: left;"></td> +<td style="text-align: left;"></td> +<td style="text-align: left;"><code>¡</code></td> +<td style="text-align: left;"><code>±</code></td> +<td style="text-align: left;"><code>Á</code></td> +<td style="text-align: left;"><code>Ñ</code></td> +<td style="text-align: left;"><code>á</code></td> +<td style="text-align: left;"><code>ñ</code></td> +</tr> +<tr> +<td>2</td> +<td style="text-align: left;"></td> +<td style="text-align: left;"></td> +<td style="text-align: left;"><code>¢</code></td> +<td style="text-align: left;"><code>²</code></td> +<td style="text-align: left;"><code>Â</code></td> +<td style="text-align: left;"><code>Ò</code></td> +<td style="text-align: left;"><code>â</code></td> +<td style="text-align: left;"><code>ò</code></td> +</tr> +<tr> +<td>3</td> +<td style="text-align: left;"></td> +<td style="text-align: left;"></td> +<td style="text-align: left;"><code>£</code></td> +<td style="text-align: left;"><code>³</code></td> +<td style="text-align: left;"><code>Ã</code></td> +<td style="text-align: left;"><code>Ó</code></td> +<td style="text-align: left;"><code>ã</code></td> +<td style="text-align: left;"><code>ó</code></td> +</tr> +<tr> +<td>4</td> +<td style="text-align: left;"></td> +<td style="text-align: left;"></td> +<td style="text-align: left;"><code>¤</code></td> +<td style="text-align: left;"><code>´</code></td> +<td style="text-align: left;"><code>Ä</code></td> +<td style="text-align: left;"><code>Ô</code></td> +<td style="text-align: left;"><code>ä</code></td> +<td style="text-align: left;"><code>ô</code></td> +</tr> +<tr> +<td>5</td> +<td style="text-align: left;"></td> +<td style="text-align: left;"></td> +<td style="text-align: left;"><code>¥</code></td> +<td style="text-align: left;"><code>μ</code></td> +<td style="text-align: left;"><code>Å</code></td> +<td style="text-align: left;"><code>Õ</code></td> +<td style="text-align: left;"><code>å</code></td> +<td style="text-align: left;"><code>õ</code></td> +</tr> +<tr> +<td>6</td> +<td style="text-align: left;"></td> +<td style="text-align: left;"></td> +<td style="text-align: left;"><code>¦</code></td> +<td style="text-align: left;"><code>¶</code></td> +<td style="text-align: left;"><code>Æ</code></td> +<td style="text-align: left;"><code>Ö</code></td> +<td style="text-align: left;"><code>æ</code></td> +<td style="text-align: left;"><code>ö</code></td> +</tr> +<tr> +<td>7</td> +<td style="text-align: left;"></td> +<td style="text-align: left;"></td> +<td style="text-align: left;"><code>§</code></td> +<td style="text-align: left;"><code>·</code></td> +<td style="text-align: left;"><code>Ç</code></td> +<td style="text-align: left;"><code>×</code></td> +<td style="text-align: left;"><code>ç</code></td> +<td style="text-align: left;"><code>÷</code></td> +</tr> +<tr> +<td>8</td> +<td style="text-align: left;"></td> +<td style="text-align: left;"></td> +<td style="text-align: left;"><code>¨</code></td> +<td style="text-align: left;"><code>¸</code></td> +<td style="text-align: left;"><code>È</code></td> +<td style="text-align: left;"><code>Ø</code></td> +<td style="text-align: left;"><code>è</code></td> +<td style="text-align: left;"><code>ø</code></td> +</tr> +<tr> +<td>9</td> +<td style="text-align: left;"></td> +<td style="text-align: left;"></td> +<td style="text-align: left;"><code>©</code></td> +<td style="text-align: left;"><code>¹</code></td> +<td style="text-align: left;"><code>É</code></td> +<td style="text-align: left;"><code>Ù</code></td> +<td style="text-align: left;"><code>é</code></td> +<td style="text-align: left;"><code>ù</code></td> +</tr> +<tr> +<td>A</td> +<td style="text-align: left;"></td> +<td style="text-align: left;"></td> +<td style="text-align: left;"><code>ª</code></td> +<td style="text-align: left;"><code>º</code></td> +<td style="text-align: left;"><code>Ê</code></td> +<td style="text-align: left;"><code>Ú</code></td> +<td style="text-align: left;"><code>ê</code></td> +<td style="text-align: left;"><code>ú</code></td> +</tr> +<tr> +<td>B</td> +<td style="text-align: left;"></td> +<td style="text-align: left;"></td> +<td style="text-align: left;"><code>«</code></td> +<td style="text-align: left;"><code>»</code></td> +<td style="text-align: left;"><code>Ë</code></td> +<td style="text-align: left;"><code>Û</code></td> +<td style="text-align: left;"><code>ë</code></td> +<td style="text-align: left;"><code>û</code></td> +</tr> +<tr> +<td>C</td> +<td style="text-align: left;"></td> +<td style="text-align: left;"></td> +<td style="text-align: left;"><code>¬</code></td> +<td style="text-align: left;"><code>¼</code></td> +<td style="text-align: left;"><code>Ì</code></td> +<td style="text-align: left;"><code>Ü</code></td> +<td style="text-align: left;"><code>ì</code></td> +<td style="text-align: left;"><code>ü</code></td> +</tr> +<tr> +<td>D</td> +<td style="text-align: left;"></td> +<td style="text-align: left;"></td> +<td style="text-align: left;"><code>SHY</code></td> +<td style="text-align: left;"><code>½</code></td> +<td style="text-align: left;"><code>Í</code></td> +<td style="text-align: left;"><code>Ý</code></td> +<td style="text-align: left;"><code>í</code></td> +<td style="text-align: left;"><code>ý</code></td> +</tr> +<tr> +<td>E</td> +<td style="text-align: left;"></td> +<td style="text-align: left;"></td> +<td style="text-align: left;"><code>®</code></td> +<td style="text-align: left;"><code>¾</code></td> +<td style="text-align: left;"><code>Î</code></td> +<td style="text-align: left;"><code>Þ</code></td> +<td style="text-align: left;"><code>î</code></td> +<td style="text-align: left;"><code>þ</code></td> +</tr> +<tr> +<td>F</td> +<td style="text-align: left;"></td> +<td style="text-align: left;"></td> +<td style="text-align: left;"><code>¯</code></td> +<td style="text-align: left;"><code>¿</code></td> +<td style="text-align: left;"><code>Ï</code></td> +<td style="text-align: left;"><code>ß</code></td> +<td style="text-align: left;"><code>ï</code></td> +<td style="text-align: left;"><code>ÿ</code></td> +</tr> +</tbody> +</table> +</div> +<h1 id="annex-b.-qt-backend-qzint">Annex B. Qt Backend QZint</h1> +<p>Used internally by Zint Barcode Studio to display the preview, the Qt +Backend <code>QZint</code> renders a barcode by drawing the vector +representation (see <a href="#buffering-symbols-in-memory-vector">5.5 +Buffering Symbols in Memory (vector)</a>) provided by the Zint library +<code>libzint</code>.</p> +<p>The main class is <code>Zint::QZint</code>, which has getter/setter +properties that correspond to the <code>zint_symbol</code> structure +(see <a href="#setting-options">5.7 Setting Options</a>), and a main +method <code>render()</code> which takes a Qt <code>QPainter</code> to +paint with, and a <code>QRectF</code> rectangular area specifying where +to paint into:</p> +<div class="sourceCode" id="cb120"><pre +class="sourceCode cpp"><code class="sourceCode cpp"><span id="cb120-1"><a href="#cb120-1" aria-hidden="true" tabindex="-1"></a><span class="co">/* Encode and display barcode in `paintRect` using `painter`.</span></span> +<span id="cb120-2"><a href="#cb120-2" aria-hidden="true" tabindex="-1"></a><span class="co"> Note: legacy argument `mode` is not used */</span></span> +<span id="cb120-3"><a href="#cb120-3" aria-hidden="true" tabindex="-1"></a><span class="dt">void</span> render<span class="op">(</span><span class="ex">QPainter</span><span class="op">&</span> painter<span class="op">,</span> <span class="at">const</span> <span class="ex">QRectF</span><span class="op">&</span> paintRect<span class="op">,</span></span> +<span id="cb120-4"><a href="#cb120-4" aria-hidden="true" tabindex="-1"></a> AspectRatioMode mode <span class="op">=</span> IgnoreAspectRatio<span class="op">);</span></span></code></pre></div> +<p><code>render()</code> will emit one of two Qt signals - +<code>encoded</code> on successful encoding and drawing, or +<code>errored</code> on failure. The client can connect and act +appropriately, for instance:</p> +<div class="sourceCode" id="cb121"><pre +class="sourceCode cpp"><code class="sourceCode cpp"><span id="cb121-1"><a href="#cb121-1" aria-hidden="true" tabindex="-1"></a><span class="fu">connect</span><span class="op">(</span>qzint<span class="op">,</span> <span class="ex">SIGNAL</span><span class="op">(</span>encoded<span class="op">()),</span> <span class="ex">SLOT</span><span class="op">(</span>on_encoded<span class="op">()));</span></span> +<span id="cb121-2"><a href="#cb121-2" aria-hidden="true" tabindex="-1"></a><span class="fu">connect</span><span class="op">(</span>qzint<span class="op">,</span> <span class="ex">SIGNAL</span><span class="op">(</span>errored<span class="op">()),</span> <span class="ex">SLOT</span><span class="op">(</span>on_errored<span class="op">()));</span></span></code></pre></div> +<p>where <code>qzint</code> is an instance of <code>Zint::QZint</code> +and <code>on_encoded()</code> and <code>on_error()</code> are Qt slot +methods provided by the caller. On error, the error value and message +can be retrieved by the methods <code>getError()</code> and +<code>lastError()</code> respectively.</p> +<p>The other main method is <code>save_to_file()</code>:</p> +<div class="sourceCode" id="cb122"><pre +class="sourceCode cpp"><code class="sourceCode cpp"><span id="cb122-1"><a href="#cb122-1" aria-hidden="true" tabindex="-1"></a><span class="co">/* Encode and print barcode to file `filename`.</span></span> +<span id="cb122-2"><a href="#cb122-2" aria-hidden="true" tabindex="-1"></a><span class="co"> Only sets `getError()` on error, not on warning */</span></span> +<span id="cb122-3"><a href="#cb122-3" aria-hidden="true" tabindex="-1"></a><span class="dt">bool</span> save_to_file<span class="op">(</span><span class="at">const</span> <span class="ex">QString</span><span class="op">&</span> filename<span class="op">);</span> <span class="co">// `ZBarcode_Print()`</span></span></code></pre></div> +<p>which takes a <code>filename</code> to output to. It too will emit an +<code>errored</code> signal on failure, returning <code>false</code> +(but nothing on success, which just returns <code>true</code>). Note +that rotation is achieved through the setter method +<code>setRotateAngleValue()</code> (as opposed to the +<code>rotate_angle</code> argument used by +<code>ZBarcode_Print()</code>).</p> +<p>Various other methods are available, for instance methods for testing +symbology capabilities, and utility methods such as +<code>defaultXdim()</code> and <code>getAsCLI()</code>.</p> +<p>For full details, see <code>"backend_qt/qzint.h"</code>.</p> +<h1 id="annex-c.-tcl-backend-binding">Annex C. Tcl Backend Binding</h1> +<p>A Tcl binding is available in the <code>"backend_tcl</code>” +sub-directory. To make on Unix:</p> +<div class="sourceCode" id="cb123"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb123-1"><a href="#cb123-1" aria-hidden="true" tabindex="-1"></a><span class="bu">cd</span> backend_tcl</span> +<span id="cb123-2"><a href="#cb123-2" aria-hidden="true" tabindex="-1"></a><span class="fu">autoconf</span></span> +<span id="cb123-3"><a href="#cb123-3" aria-hidden="true" tabindex="-1"></a><span class="ex">./configure</span></span> +<span id="cb123-4"><a href="#cb123-4" aria-hidden="true" tabindex="-1"></a><span class="fu">make</span></span> +<span id="cb123-5"><a href="#cb123-5" aria-hidden="true" tabindex="-1"></a><span class="fu">sudo</span> make install</span></code></pre></div> +<p>For Windows, a Visual Studio 6.0 project file is available at +<code>"backend_tcl\zint_tcl.dsp"</code>. This can also be opened (and +converted) by more modern Visual Studio versions, though some fixing up +of the project configuration will likely be required.</p> +<p>Once built and installed, invoke the Tcl/Tk CLI +<code>"wish"</code>:</p> +<div class="sourceCode" id="cb124"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb124-1"><a href="#cb124-1" aria-hidden="true" tabindex="-1"></a><span class="ex">wish</span></span></code></pre></div> +<p>and ignoring the Tk window click back to the command prompt +<code>"%"</code> and type:</p> +<div class="sourceCode" id="cb125"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb125-1"><a href="#cb125-1" aria-hidden="true" tabindex="-1"></a><span class="ex">require</span> package zint</span> +<span id="cb125-2"><a href="#cb125-2" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> help</span></code></pre></div> +<p>which will show the usage message, with options very similiar to the +Zint CLI. (One notable difference is that boolean options such as +<code>-bold</code> take a <code>1</code> or <code>0</code> as an +argument.)</p> +<p>A demonstration Tcl/Tk program which is also useful in itself is +available at <code>"backend_tcl/demo/demo.tcl"</code>. To run type:</p> +<div class="sourceCode" id="cb126"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb126-1"><a href="#cb126-1" aria-hidden="true" tabindex="-1"></a><span class="ex">wish</span> demo/demo.tcl</span></code></pre></div> +<p>which will display the following window.</p> +<figure> +<img src="images/tcl_demo.png" title="fig:" class="pop" +alt="Tcl/Tk demonstration program window" /> +<figcaption aria-hidden="true">Tcl/Tk demonstration program +window</figcaption> +</figure> +<p>You can select the symbology, enter the data to encode, and set +options (which are the same as those given in the usage message). A +raster preview of the configured barcode is displayed once the +<code>"Generate"</code> button is pressed.</p> +<h1 id="annex-d.-man-page-zint1">Annex D. Man Page ZINT(1)</h1> + +<h2 id="name">NAME</h2> +<p><code>zint</code> - encode data as a barcode image</p> +<h2 id="synopsis">SYNOPSIS</h2> +<div class="line-block"><code>zint</code> [<code>-h</code> | +<code>--help</code>]<br /> +<code>zint</code> [<em>options</em>]</div> +<h2 id="description">DESCRIPTION</h2> +<p>zint takes input data from the command line or a file to encode in a +barcode which is then output to an image file.</p> +<p>Input data is UTF-8, unless <code>--binary</code> is specified.</p> +<p>Human Readable Text (HRT) is displayed by default for those barcodes +that support HRT, unless <code>--notext</code> is specified.</p> +<p>The output image file (specified with <code>-o</code> | +<code>--output</code>) may be in one of these formats: Windows Bitmap +(<code>BMP</code>), Enhanced Metafile Format (<code>EMF</code>), +Encapsulated PostScript (<code>EPS</code>), Graphics Interchange Format +(<code>GIF</code>), ZSoft Paintbrush (<code>PCX</code>), Portable +Network Format (<code>PNG</code>), Scalable Vector Graphic +(<code>SVG</code>), or Tagged Image File Format (<code>TIF</code>).</p> +<h2 id="options">OPTIONS</h2> +<dl> +<dt><code>-h</code>, <code>--help</code></dt> +<dd> +<p>Print usage information summarizing command line options.</p> +</dd> +<dt><code>-b TYPE</code>, <code>--barcode=TYPE</code></dt> +<dd> +<p>Set the barcode symbology that will be used to encode the data. +<em>TYPE</em> is the number or name of the barcode symbology. If not +given, the symbology defaults to 20 (Code 128). To see what types are +available, use the <code>-t</code> | <code>--types</code> option. Type +names are case-insensitive, and non-alphanumerics are ignored.</p> +</dd> +<dt><code>--addongap=INTEGER</code></dt> +<dd> +<p>For EAN/UPC symbologies, set the gap between the main data and the +add-on. <em>INTEGER</em> is in integral multiples of the X-dimension. +The maximum gap that can be set is 12. The minimum is 7, except for +UPC-A, when the minimum is 9.</p> +</dd> +<dt><code>--batch</code></dt> +<dd> +<p>Treat each line of an input file specified with <code>-i</code> | +<code>--input</code> as a separate data set and produce a barcode image +for each one. The barcode images are outputted by default to numbered +filenames starting with “00001.png”, “00002.png” etc., which can be +changed by using the <code>-o</code> | <code>--output</code> option.</p> +</dd> +<dt><code>--bg=COLOUR</code></dt> +<dd> +<p>Specify a background (paper) colour where <em>COLOUR</em> is in +hexadecimal <code>RRGGBB</code> or <code>RRGGBBAA</code> format or in +decimal <code>C,M,Y,K</code> percentages format.</p> +</dd> +<dt><code>--binary</code></dt> +<dd> +<p>Treat input data as raw 8-bit binary data instead of the default +UTF-8. Automatic code page translation to an ECI page is disabled, and +no validation of the data’s character encoding takes place.</p> +</dd> +<dt><code>--bind</code></dt> +<dd> +<p>Add horizontal boundary bars (also known as bearer bars) to the +symbol. The width of the boundary bars is specified by the +<code>--border</code> option. <code>--bind</code> can also be used to +add row separator bars to symbols stacked with multiple <code>-d</code> +| <code>--data</code> inputs, in which case the width of the separator +bars is specified with the <code>--separator</code> option.</p> +</dd> +<dt><code>--bindtop</code></dt> +<dd> +<p>Add a horizontal boundary bar to the top of the symbol. The width of +the boundary bar is specified by the <code>--border</code> option.</p> +</dd> +<dt><code>--bold</code></dt> +<dd> +<p>Use a bold font for the Human Readable Text (HRT).</p> +</dd> +<dt><code>--border=INTEGER</code></dt> +<dd> +<p>Set the width of boundary bars (<code>--bind</code> or +<code>--bindtop</code>) or box borders (<code>--box</code>), where +<em>INTEGER</em> is in integral multiples of the X-dimension. The +default is zero.</p> +</dd> +<dt><code>--box</code></dt> +<dd> +<p>Add a box around the symbol. The width of the borders is specified by +the <code>--border</code> option.</p> +</dd> +<dt><code>--cmyk</code></dt> +<dd> +<p>Use the CMYK colour space when outputting to Encapsulated PostScript +(EPS) or TIF files.</p> +</dd> +<dt><code>--cols=INTEGER</code></dt> +<dd> +<p>Set the number of data columns in the symbol to <em>INTEGER</em>. +Affects Codablock-F, DotCode, GS1 DataBar Expanded Stacked +(DBAR_EXPSTK), MicroPDF417 and PDF417 symbols.</p> +</dd> +<dt><code>--compliantheight</code></dt> +<dd> +<p>Warn if the height specified by the <code>--height</code> option is +not compliant with the barcode’s specification, or if +<code>--height</code> is not given, default to the height specified by +the specification (if any).</p> +</dd> +<dt><code>-d</code>, <code>--data=DATA</code></dt> +<dd> +<p>Specify the input <em>DATA</em> to encode. The <code>--esc</code> +option may be used to enter non-printing characters using escape +sequences. The <em>DATA</em> should be UTF-8, unless the +<code>--binary</code> option is given, in which case it can be +anything.</p> +</dd> +<dt><code>--direct</code></dt> +<dd> +<p>Send output to stdout, which in most cases should be re-directed to a +pipe or a file. Use <code>--filetype</code> to specify output +format.</p> +</dd> +<dt><code>--dmiso144</code></dt> +<dd> +<p>For Data Matrix symbols, use the standard ISO/IEC codeword placement +for 144 x 144 (<code>--vers=24</code>) sized symbols, instead of the +default “de facto” placement (which rotates the placement of ECC +codewords).</p> +</dd> +<dt><code>--dmre</code></dt> +<dd> +<p>For Data Matrix symbols, allow Data Matrix Rectangular Extended +(DMRE) sizes when considering automatic sizes. See also +<code>--square</code>.</p> +</dd> +<dt><code>--dotsize=NUMBER</code></dt> +<dd> +<p>Set the radius of the dots in dotty mode (<code>--dotty</code>). +<em>NUMBER</em> is in X-dimensions, and may be floating-point. The +default is 0.8.</p> +</dd> +<dt><code>--dotty</code></dt> +<dd> +<p>Use dots instead of squares for matrix symbols. DotCode is always in +dotty mode.</p> +</dd> +<dt><code>--dump</code></dt> +<dd> +<p>Dump a hexadecimal representation of the symbol’s encodation to +stdout. The same representation may be outputted to a file by using a +<code>.txt</code> extension with <code>-o</code> | <code>--output</code> +or by specifying <code>--filetype=txt</code>.</p> +</dd> +<dt><code>-e</code>, <code>--ecinos</code></dt> +<dd> +<p>Display the table of ECIs (Extended Channel Interpretations).</p> +</dd> +<dt><code>--eci=INTEGER</code></dt> +<dd> +<p>Set the ECI code for the input data to <em>INTEGER</em>. See +<code>-e</code> | <code>--ecinos</code> for a list of the ECIs +available. ECIs are supported by Aztec Code, Code One, Data Matrix, +DotCode, Grid Matrix, Han Xin Code, MaxiCode, MicroPDF417, PDF417, QR +Code, rMQR and Ultracode.</p> +</dd> +<dt><code>--embedfont</code></dt> +<dd> +<p>For vector output, embed the font in the file for portability. +Currently only available for SVG output.</p> +</dd> +<dt><code>--esc</code></dt> +<dd> +<p>Process escape characters in the input data. The escape sequences +are:</p> +<pre><code>\0 (0x00) NUL Null character +\E (0x04) EOT End of Transmission +\a (0x07) BEL Bell +\b (0x08) BS Backspace +\t (0x09) HT Horizontal Tab +\n (0x0A) LF Line Feed +\v (0x0B) VT Vertical Tab +\f (0x0C) FF Form Feed +\r (0x0D) CR Carriage Return +\e (0x1B) ESC Escape +\G (0x1D) GS Group Separator +\R (0x1E) RS Record Separator +\\ (0x5C) \ Backslash +\dNNN (NNN) Any 8-bit character where NNN is + decimal (000-255) +\oNNN (0oNNN) Any 8-bit character where NNN is + octal (000-377) +\xNN (0xNN) Any 8-bit character where NN is + hexadecimal (00-FF) +\uNNNN (U+NNNN) Any 16-bit Unicode BMP character + where NNNN is hexadecimal +\UNNNNNN (U+NNNNNN) Any 21-bit Unicode character + where NNNNNN is hexadecimal</code></pre> +</dd> +<dt><code>--extraesc</code></dt> +<dd> +<p>For Code 128 only, as well as processing the normal escape sequences +above, process the special escape sequences <code>\^A</code>, +<code>\^B</code>, <code>\^C</code> and <code>\^@</code> that allow +manual switching of Code Sets, and the special escape sequence +<code>\^1</code> that inserts an <code>FNC1</code> character. The +sequence <code>\@</code> turns off manual switching. The sequence +<code>\^^</code> can be used to encode data that contains special escape +sequences.</p> +</dd> +<dt><code>--fast</code></dt> +<dd> +<p>Use faster if less optimal encodation or other shortcuts (affects +Data Matrix, MicroPDF417, PDF417, QRCODE & UPNQR only).</p> +</dd> +<dt><code>--fg=COLOUR</code></dt> +<dd> +<p>Specify a foreground (ink) colour where <em>COLOUR</em> is in +hexadecimal <code>RRGGBB</code> or <code>RRGGBBAA</code> format or in +decimal <code>C,M,Y,K</code> percentages format.</p> +</dd> +<dt><code>--filetype=TYPE</code></dt> +<dd> +<p>Set the output file type to <em>TYPE</em>, which is one of +<code>BMP</code>, <code>EMF</code>, <code>EPS</code>, <code>GIF</code>, +<code>PCX</code>, <code>PNG</code>, <code>SVG</code>, <code>TIF</code>, +<code>TXT</code>.</p> +</dd> +<dt><code>--fullmultibyte</code></dt> +<dd> +<p>Use the multibyte modes of Grid Matrix, Han Xin and QR Code for +non-ASCII data.</p> +</dd> +<dt><code>--gs1</code></dt> +<dd> +<p>Treat input as GS1 compatible data. Application Identifiers (AIs) +should be placed in square brackets <code>"[]"</code> (but see +<code>--gs1parens</code>).</p> +</dd> +<dt><code>--gs1nocheck</code></dt> +<dd> +<p>Do not check the validity of GS1 data.</p> +</dd> +<dt><code>--gs1parens</code></dt> +<dd> +<p>Process parentheses <code>"()"</code> as GS1 AI delimiters, rather +than square brackets <code>"[]"</code>. The input data must not +otherwise contain parentheses.</p> +</dd> +<dt><code>--gssep</code></dt> +<dd> +<p>For Data Matrix in GS1 mode, use <code>GS</code> (0x1D) as the GS1 +data separator instead of <code>FNC1</code>.</p> +</dd> +<dt><code>--guarddescent=NUMBER</code></dt> +<dd> +<p>For EAN/UPC symbols, set the height the guard bars descend below the +main bars, where <em>NUMBER</em> is in X-dimensions. <em>NUMBER</em> may +be floating-point.</p> +</dd> +<dt><code>--guardwhitespace</code></dt> +<dd> +<p>For EAN/UPC symbols, add quiet zone indicators <code>"<"</code> +and/or <code>">"</code> to HRT where applicable.</p> +</dd> +<dt><code>--height=NUMBER</code></dt> +<dd> +<p>Set the height of the symbol in X-dimensions. <em>NUMBER</em> may be +floating-point.</p> +</dd> +<dt><code>--heightperrow</code></dt> +<dd> +<p>Treat height as per-row. Affects Codablock-F, Code 16K, Code 49, GS1 +DataBar Expanded Stacked (DBAR_EXPSTK), MicroPDF417 and PDF417.</p> +</dd> +<dt><code>-i</code>, <code>--input=FILE</code></dt> +<dd> +<p>Read the input data from <em>FILE</em>. Specify a single hyphen +(<code>-</code>) for <em>FILE</em> to read from stdin.</p> +</dd> +<dt><code>--init</code></dt> +<dd> +<p>Create a Reader Initialisation (Programming) symbol.</p> +</dd> +<dt><code>--mask=INTEGER</code></dt> +<dd> +<p>Set the masking pattern to use for DotCode, Han Xin or QR Code to +<em>INTEGER</em>, overriding the automatic selection.</p> +</dd> +<dt><code>--mirror</code></dt> +<dd> +<p>Use the batch data to determine the filename in batch mode +(<code>--batch</code>). The <code>-o</code> | <code>--output</code> +option can be used to specify an output directory (any filename will be +ignored).</p> +</dd> +<dt><code>--mode=INTEGER</code></dt> +<dd> +<p>For MaxiCode and GS1 Composite symbols, set the encoding mode to +<em>INTEGER</em>.</p> +<p>For MaxiCode (SCM is Structured Carrier Message, with 3 fields: +postcode, 3-digit ISO 3166-1 country code, 3-digit service code):</p> +<pre><code>2 SCM with 9-digit numeric postcode +3 SCM with 6-character alphanumeric postcode +4 Enhanced ECC for the primary part of the message +5 Enhanced ECC for all of the message +6 Reader Initialisation (Programming)</code></pre> +<p>For GS1 Composite symbols (names end in <code>_CC</code>, +i.e. EANX_CC, GS1_128_CC, DBAR_OMN_CC etc.):</p> +<pre><code>1 CC-A +2 CC-B +3 CC-C (GS1_128_CC only)</code></pre> +</dd> +<dt><code>--nobackground</code></dt> +<dd> +<p>Remove the background colour (EMF, EPS, GIF, PNG, SVG and TIF +only).</p> +</dd> +<dt><code>--noquietzones</code></dt> +<dd> +<p>Disable any quiet zones for symbols that define them by default.</p> +</dd> +<dt><code>--notext</code></dt> +<dd> +<p>Remove the Human Readable Text (HRT).</p> +</dd> +<dt><code>-o</code>, <code>--output=FILE</code></dt> +<dd> +<p>Send the output to <em>FILE</em>. When not in batch mode, the default +is “out.png” (or “out.gif” if zint built without PNG support). When in +batch mode (<code>--batch</code>), special characters can be used to +format the output filenames:</p> +<pre><code>~ Insert a number or 0 +# Insert a number or space +@ Insert a number or * (+ on Windows) +Any other Insert literally</code></pre> +</dd> +<dt><code>--primary=STRING</code></dt> +<dd> +<p>For MaxiCode, set the content of the primary message. For GS1 +Composite symbols, set the content of the linear symbol.</p> +</dd> +<dt><code>--quietzones</code></dt> +<dd> +<p>Add compliant quiet zones for symbols that specify them. This is in +addition to any whitespace specified by <code>-w</code> | +<code>--whitesp</code> or <code>--vwhitesp</code>.</p> +</dd> +<dt><code>-r</code>, <code>--reverse</code></dt> +<dd> +<p>Reverse the foreground and background colours (white on black). Known +as “reflectance reversal” or “reversed reflectance”.</p> +</dd> +<dt><code>--rotate=INTEGER</code></dt> +<dd> +<p>Rotate the symbol by <em>INTEGER</em> degrees, where <em>INTEGER</em> +can be 0, 90, 270 or 360.</p> +</dd> +<dt><code>--rows=INTEGER</code></dt> +<dd> +<p>Set the number of rows for Codablock-F or PDF417 to <em>INTEGER</em>. +It will also set the minimum number of rows for Code 16K or Code 49, and +the maximum number of rows for GS1 DataBar Expanded Stacked +(DBAR_EXPSTK).</p> +</dd> +<dt><code>--scale=NUMBER</code></dt> +<dd> +<p>Adjust the size of the X-dimension. <em>NUMBER</em> may be +floating-point, and is multiplied by 2 (except for MaxiCode) before +being applied. The default scale is 1.</p> +<p>For MaxiCode, the scale is multiplied by 10 for raster output, by 40 +for EMF output, and by 2 otherwise.</p> +<p>Increments of 0.5 (half-integers) are recommended for non-MaxiCode +raster output (BMP, GIF, PCX, PNG and TIF).</p> +<p>See also <code>--scalexdimdp</code> below.</p> +</dd> +<dt><code>--scalexdimdp=X[,R]</code></dt> +<dd> +<p>Scale the image according to X-dimension <em>X</em> and resolution +<em>R</em>, where <em>X</em> is in mm and <em>R</em> is in dpmm (dots +per mm). <em>X</em> and <em>R</em> may be floating-point. <em>R</em> is +optional and defaults to 12 dpmm (approximately 300 dpi). <em>X</em> may +be zero in which case a symbology-specific default is used.</p> +<p>The scaling takes into account the output filetype, and deals with +all the details mentioned above. Units may be specified for <em>X</em> +by appending “in” (inch) or “mm”, and for <em>R</em> by appending “dpi” +(dots per inch) or “dpmm” - +e.g. <code>--scalexdimdp=0.013in,300dpi</code>.</p> +</dd> +<dt><code>--scmvv=INTEGER</code></dt> +<dd> +<p>For MaxiCode, prefix the Structured Carrier Message (SCM) with +<code>"[)>\R01\Gvv"</code>, where <code>vv</code> is a 2-digit +<em>INTEGER</em>.</p> +</dd> +<dt><code>--secure=INTEGER</code></dt> +<dd> +<p>Set the error correction level (ECC) to <em>INTEGER</em>. The meaning +is specific to the following matrix symbols (all except PDF417 are +approximate):</p> +<pre><code>Aztec Code 1 to 4 (10%, 23%, 36%, 50%) +Grid Matrix 1 to 5 (10% to 50%) +Han Xin 1 to 4 (8%, 15%, 23%, 30%) +Micro QR 1 to 3 (7%, 15%, 25%) (L, M, Q) +PDF417 0 to 8 (2^(INTEGER + 1) codewords) +QR Code 1 to 4 (7%, 15%, 25%, 30%) (L, M, Q, H) +rMQR 2 or 4 (15% or 30%) (M or H) +Ultracode 1 to 6 (0%, 5%, 9%, 17%, 25%, 33%)</code></pre> +</dd> +<dt><code>--segN=ECI,DATA</code></dt> +<dd> +<p>Set the <em>ECI</em> & <em>DATA</em> content for segment N, where +N is 1 to 9. <code>-d</code> | <code>--data</code> must still be given, +and counts as segment 0, its ECI given by <code>--eci</code>. Segments +must be consecutive.</p> +</dd> +<dt><code>--separator=INTEGER</code></dt> +<dd> +<p>Set the height of row separator bars for stacked symbologies, where +<em>INTEGER</em> is in integral multiples of the X-dimension. The +default is zero.</p> +</dd> +<dt><code>--small</code></dt> +<dd> +<p>Use a smaller font for Human Readable Text (HRT).</p> +</dd> +<dt><code>--square</code></dt> +<dd> +<p>For Data Matrix symbols, exclude rectangular sizes when considering +automatic sizes. See also <code>--dmre</code>.</p> +</dd> +<dt><code>--structapp=I,C[,ID]</code></dt> +<dd> +<p>Set Structured Append info, where <em>I</em> is the 1-based index, +<em>C</em> is the total number of symbols in the sequence, and +<em>ID</em>, which is optional, is the identifier that all symbols in +the sequence share. Structured Append is supported by Aztec Code, Code +One, Data Matrix, DotCode, Grid Matrix, MaxiCode, MicroPDF417, PDF417, +QR Code and Ultracode.</p> +</dd> +<dt><code>-t</code>, <code>--types</code></dt> +<dd> +<p>Display the table of barcode types (symbologies). The numbers or +names can be used with <code>-b</code> | <code>--barcode</code>.</p> +</dd> +<dt><code>--textgap=NUMBER</code></dt> +<dd> +<p>Adjust the gap between the barcode and the Human Readable Text (HRT). +<em>NUMBER</em> is in X-dimensions, and may be floating-point. Maximum +is 10 and minimum is -5. The default is 1.</p> +</dd> +<dt><code>--vers=INTEGER</code></dt> +<dd> +<p>Set the symbol version (size, check digits, other options) to +<em>INTEGER</em>. The meaning is symbol-specific.</p> +<p>For most matrix symbols, it specifies size:</p> +<pre><code>Aztec Code 1 to 36 (1 to 4 compact) + 1 15x15 13 53x53 25 105x105 + 2 19x19 14 57x57 26 109x109 + 3 23x23 15 61x61 27 113x113 + 4 27x27 16 67x67 28 117x117 + 5 19x19 17 71x71 29 121x121 + 6 23x23 18 75x75 30 125x125 + 7 27x27 19 79x79 31 131x131 + 8 31x31 20 83x83 32 135x135 + 9 37x37 21 87x87 33 139x139 + 10 41x41 22 91x91 34 143x143 + 11 45x45 23 95x95 35 147x147 + 12 49x49 24 101x101 36 151x151 + +Code One 1 to 10 (9 and 10 variable width) (WxH) + 1 16x18 6 70x76 + 2 22x22 7 104x98 + 3 28x28 8 148x134 + 4 40x42 9 Wx8 + 5 52x54 10 Wx16 + +Data Matrix 1 to 48 (31 to 48 DMRE) (HxW) + 1 10x10 17 72x72 33 8x80 + 2 12x12 18 80x80 34 8x96 + 3 14x14 19 88x88 35 8x120 + 4 16x16 20 96x96 36 8x144 + 5 18x18 21 104x104 37 12x64 + 6 20x20 22 120x120 38 12x88 + 7 22x22 23 132x132 39 16x64 + 8 24x24 24 144x144 40 20x36 + 9 26x26 25 8x18 41 20x44 + 10 32x32 26 8x32 42 20x64 + 11 36x36 28 12x26 43 22x48 + 12 40x40 28 12x36 44 24x48 + 13 44x44 29 16x36 45 24x64 + 14 48x48 30 16x48 46 26x40 + 15 52x52 31 8x48 47 26x48 + 16 64x64 32 8x64 48 26x64 + +Grid Matrix 1 to 13 + 1 18x18 6 78x78 11 138x138 + 2 30x30 7 90x90 12 150x150 + 3 42x42 8 102x102 13 162x162 + 4 54x54 9 114x114 + 5 66x66 10 126x126 + +Han Xin 1 to 84 + 1 23x23 29 79x79 57 135x135 + 2 25x25 30 81x81 58 137x137 + 3 27x27 31 83x83 59 139x139 + 4 29x29 32 85x85 60 141x141 + 5 31x31 33 87x87 61 143x143 + 6 33x33 34 89x89 62 145x145 + 7 35x35 35 91x91 63 147x147 + 8 37x37 36 93x93 64 149x149 + 9 39x39 37 95x95 65 151x151 + 10 41x41 38 97x97 66 153x153 + 11 43x43 39 99x99 67 155x155 + 12 45x45 40 101x101 68 157x157 + 13 47x47 41 103x103 69 159x159 + 14 49x49 42 105x105 70 161x161 + 15 51x51 43 107x107 71 163x163 + 16 53x53 44 109x109 72 165x165 + 17 55x55 45 111x111 73 167x167 + 18 57x57 46 113x113 74 169x169 + 19 59x59 47 115x115 75 171x171 + 20 61x61 48 117x117 76 173x173 + 21 63x63 49 119x119 77 175x175 + 22 65x65 50 121x121 78 177x177 + 23 67x67 51 123x123 79 179x179 + 24 69x69 52 125x125 80 181x181 + 25 71x71 53 127x127 81 183x183 + 26 73x73 54 129x129 82 185x185 + 27 75x75 55 131x131 83 187x187 + 28 77x77 56 133x133 84 189x189 + +Micro QR 1 to 4 (M1, M2, M3, M4) + 1 11x11 3 15x15 + 2 13x13 4 17x17 + +QR Code 1 to 40 + 1 21x21 15 77x77 29 133x133 + 2 25x25 16 81x81 30 137x137 + 3 29x29 17 85x85 31 141x141 + 4 33x33 18 89x89 32 145x145 + 5 37x37 19 93x93 33 149x149 + 6 41x41 20 97x97 34 153x153 + 7 45x45 21 101x101 35 157x157 + 8 49x49 22 105x105 36 161x161 + 9 53x53 23 109x109 37 165x165 + 10 57x57 24 113x113 38 169x169 + 11 61x61 25 117x117 39 173x173 + 12 65x65 26 121x121 40 177x177 + 13 69x69 27 125x125 + 14 73x73 28 129x129 + +rMQR 1 to 38 (33 to 38 automatic width) (HxW) + 1 7x43 14 11x77 27 15x139 + 2 7x59 15 11x99 28 17x43 + 3 7x77 16 11x139 29 17x59 + 4 7x99 17 13x27 30 17x77 + 5 7x139 18 13x43 31 17x99 + 6 9x43 19 13x59 32 17x139 + 7 9x59 20 13x77 33 7xW + 8 9x77 21 13x99 34 9xW + 9 9x99 22 13x139 35 11xW + 10 9x139 23 15x43 36 13xW + 11 11x27 24 15x59 37 15xW + 12 11x43 25 15x77 38 17xW + 13 11x59 26 15x99</code></pre> +<p>For a number of linear symbols, it specifies check character options +(“hide” or “hidden” means don’t show in HRT, “visible” means do display +in HRT):</p> +<pre><code>C25IATA 1 or 2 (add visible or hidden check digit) +C25IND ditto +C25INTER ditto +C25LOGIC ditto +C25STANDARD ditto +Codabar 1 or 2 (add hidden or visible check digit) +Code 11 0 to 2 (2 visible check digits to none) + 0 (default 2 visible check digits) + 1 (1 visible check digit) + 2 (no check digits) +Code 39 1 or 2 (add visible or hidden check digit) +Code 93 1 (hide the default check characters) +EXCODE39 1 or 2 (add visible or hidden check digit) +LOGMARS 1 or 2 (add visible or hidden check digit) +MSI Plessey 0 to 6 (none to various visible options) + 1, 2 (mod-10, mod-10 + mod-10) + 3, 4 (mod-11 IBM, mod-11 IBM + mod-10) + 5, 6 (mod-11 NCR, mod-11 NCR + mod-10) + +10 (hide)</code></pre> +<p>For a few other symbologies, it specifies other characteristics:</p> +<pre><code>Channel Code 3 to 8 (no. of channels) +DAFT 50 to 900 (permille tracker ratio) +DPD 1 (relabel) +PZN 1 (PZN7 instead of default PZN8) +Ultracode 2 (revision 2) +VIN 1 (add international prefix)</code></pre> +</dd> +<dt><code>-v</code>, <code>--version</code></dt> +<dd> +<p>Display zint version.</p> +</dd> +<dt><code>--vwhitesp=INTEGER</code></dt> +<dd> +<p>Set the height of vertical whitespace above and below the barcode, +where <em>INTEGER</em> is in integral multiples of the X-dimension.</p> +</dd> +<dt><code>-w</code>, <code>--whitesp=INTEGER</code></dt> +<dd> +<p>Set the width of horizontal whitespace either side of the barcode, +where <em>INTEGER</em> is in integral multiples of the X-dimension.</p> +</dd> +<dt><code>--werror</code></dt> +<dd> +<p>Convert all warnings into errors.</p> +</dd> +</dl> +<h2 id="exit-status">EXIT STATUS</h2> +<dl> +<dt><code>0</code></dt> +<dd> +Success (including when given informational options <code>-h</code> | +<code>--help</code>, <code>-e</code> | <code>--ecinos</code>, +<code>-t</code> | <code>--types</code>, <code>-v</code> | +<code>--version</code>). +</dd> +<dt><code>1</code></dt> +<dd> +Human Readable Text was truncated (maximum 199 bytes) +(<code>ZINT_WARN_HRT_TRUNCATED</code>) +</dd> +<dt><code>2</code></dt> +<dd> +Invalid option given but overridden by Zint +(<code>ZINT_WARN_INVALID_OPTION</code>) +</dd> +<dt><code>3</code></dt> +<dd> +Automatic ECI inserted by Zint (<code>ZINT_WARN_USES_ECI</code>) +</dd> +<dt><code>4</code></dt> +<dd> +Symbol created not compliant with standards +(<code>ZINT_WARN_NONCOMPLIANT</code>) +</dd> +<dt><code>5</code></dt> +<dd> +Input data wrong length (<code>ZINT_ERROR_TOO_LONG</code>) +</dd> +<dt><code>6</code></dt> +<dd> +Input data incorrect (<code>ZINT_ERROR_INVALID_DATA</code>) +</dd> +<dt><code>7</code></dt> +<dd> +Input check digit incorrect (<code>ZINT_ERROR_INVALID_CHECK</code>) +</dd> +<dt><code>8</code></dt> +<dd> +Incorrect option given (<code>ZINT_ERROR_INVALID_OPTION</code>) +</dd> +<dt><code>9</code></dt> +<dd> +Internal error (should not happen) +(<code>ZINT_ERROR_ENCODING_PROBLEM</code>) +</dd> +<dt><code>10</code></dt> +<dd> +Error opening output file (<code>ZINT_ERROR_FILE_ACCESS</code>) +</dd> +<dt><code>11</code></dt> +<dd> +Memory allocation (malloc) failure (<code>ZINT_ERROR_MEMORY</code>) +</dd> +<dt><code>12</code></dt> +<dd> +Error writing to output file (<code>ZINT_ERROR_FILE_WRITE</code>) +</dd> +<dt><code>13</code></dt> +<dd> +Error counterpart of warning if <code>--werror</code> given +(<code>ZINT_ERROR_USES_ECI</code>) +</dd> +<dt><code>14</code></dt> +<dd> +Error counterpart of warning if <code>--werror</code> given +(<code>ZINT_ERROR_NONCOMPLIANT</code>) +</dd> +<dt><code>15</code></dt> +<dd> +Error counterpart of warning if <code>--werror</code> given +(<code>ZINT_ERROR_HRT_TRUNCATED</code>) +</dd> +</dl> +<h2 id="examples">EXAMPLES</h2> +<p>Create “out.png” (or “out.gif” if zint built without PNG support) in +the current directory, as a Code 128 symbol.</p> +<div class="sourceCode" id="cb135"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb135-1"><a href="#cb135-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-d</span> <span class="st">'This Text'</span></span></code></pre></div> +<p>Create “qr.svg” in the current directory, as a QR Code symbol.</p> +<div class="sourceCode" id="cb136"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb136-1"><a href="#cb136-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> QRCode <span class="at">-d</span> <span class="st">'This Text'</span> <span class="at">-o</span> <span class="st">'qr.svg'</span></span></code></pre></div> +<p>Use batch mode to read from an input file “ean13nos.txt” containing a +list of 13-digit GTINs, each on a separate line, to create a series of +EAN-13 barcodes, formatting the output filenames to “ean001.gif”, +“ean002.gif” etc. using the special character “~”.</p> +<div class="sourceCode" id="cb137"><pre +class="sourceCode bash"><code class="sourceCode bash"><span id="cb137-1"><a href="#cb137-1" aria-hidden="true" tabindex="-1"></a><span class="ex">zint</span> <span class="at">-b</span> EANX <span class="at">--batch</span> <span class="at">-i</span> <span class="st">'ean13nos.txt'</span> <span class="at">-o</span> <span class="st">'ean~~~.gif'</span></span></code></pre></div> +<h2 id="bugs">BUGS</h2> +<p>Please send bug reports to +https://sourceforge.net/p/zint/tickets/.</p> +<h2 id="see-also">SEE ALSO</h2> +<p>Full documention for <code>zint</code> (and the API +<code>libzint</code> and the GUI <code>zint-qt</code>) is available +from</p> +<pre><code> https://zint.org.uk/manual/</code></pre> +<p>and at</p> +<pre><code> https://sourceforge.net/p/zint/docs/manual.txt</code></pre> +<h2 id="conforming-to">CONFORMING TO</h2> +<p>Zint is designed to be compliant with a number of international +standards, including:</p> +<p>ISO/IEC 24778:2008, ANSI/AIM BC12-1998, EN 798:1996, AIM ISS-X-24 +(1995), ISO/IEC 15417:2007, EN 12323:2005, ISO/IEC 16388:2007, ANSI/AIM +BC6-2000, ANSI/AIM BC5-1995, AIM USS Code One (1994), ISO/IEC +16022:2006, ISO/IEC 21471:2019, ISO/IEC 15420:2009, AIMD014 (v 1.63) +(2008), ISO/IEC 24723:2010, ISO/IEC 24724:2011, ISO/IEC 20830:2021, +ISO/IEC 16390:2007, ISO/IEC 16023:2000, ISO/IEC 24728:2006, ISO/IEC +15438:2015, ISO/IEC 18004:2015, ISO/IEC 23941:2022, AIM ITS/04-023 +(2022)</p> +<h2 id="copyright">COPYRIGHT</h2> +<p>Copyright © 2024 Robin Stuart. Released under GNU GPL 3.0 or +later.</p> +<h2 id="author">AUTHOR</h2> +<p>Robin Stuart <a href="mailto:robin@zint.org.uk" +class="email">robin@zint.org.uk</a></p> +<section id="footnotes" class="footnotes footnotes-end-of-document" +role="doc-endnotes"> +<hr /> +<ol> +<li id="fn1"><p>See the Homebrew website <a +href="https://brew.sh">https://brew.sh</a>.<a href="#fnref1" +class="footnote-back" role="doc-backlink">↩︎</a></p></li> +<li id="fn2"><p>In Unicode contexts, BMP stands for Basic Multilingual +Plane, the plane 0 codeset from U+0000 to U+D7FF and U+E000 to U+FFFF +(i.e. excluding surrogates). Not to be confused with the Windows Bitmap +file format BMP!<a href="#fnref2" class="footnote-back" +role="doc-backlink">↩︎</a></p></li> +<li id="fn3"><p>The symbologies marked with an asterisk (<code>*</code>) +in Table <a href="#tbl:barcode_types">: Barcode Types (Symbologies)</a> +above used different names in Zint before version 2.9.0. For example, +symbology 29 used the name <code>BARCODE_RSS14</code>. These names are +now deprecated but are still recognised by Zint and will continue to be +supported in future versions.<a href="#fnref3" class="footnote-back" +role="doc-backlink">↩︎</a></p></li> +<li id="fn4"><p>The background is omitted for vector outputs EMF, EPS +and SVG when <code>--nobackground</code> is given. For raster outputs +GIF, PCX, PNG and TIF, the background’s alpha channel is set to zero +(fully transparent).<a href="#fnref4" class="footnote-back" +role="doc-backlink">↩︎</a></p></li> +<li id="fn5"><p>Shift JIS (JIS X 0201 Roman) re-maps two ASCII +characters: backslash (<code>\</code>) to the yen sign (¥), and tilde +(<code>~</code>) to overline (U+203E).<a href="#fnref5" +class="footnote-back" role="doc-backlink">↩︎</a></p></li> +<li id="fn6"><p>ISO/IEC 646 Invariant is a subset of ASCII with 12 +characters undefined: <code>#</code>, <code>$</code>, <code>@</code>, +<code>[</code>, <code>\</code>, <code>]</code>, <code>^</code>, +<code>`</code>, <code>{</code>, <code>|</code>, <code>}</code>, +<code>~</code>.<a href="#fnref6" class="footnote-back" +role="doc-backlink">↩︎</a></p></li> +<li id="fn7"><p>BARCODE_MEMORY_FILE textual formats EPS and SVG will +have Unix newlines (LF) on both Windows and Unix, i.e. not CR+LF on +Windows.<a href="#fnref7" class="footnote-back" +role="doc-backlink">↩︎</a></p></li> +<li id="fn8"><p>The <code>height</code> value is ignored for Aztec +(including HIBC and Aztec Rune), Code One, Data Matrix (including HIBC), +DotCode, Grid Matrix, Han Xin, MaxiCode, QR Code (including HIBC, Micro +QR, rMQR and UPNQR), and Ultracode - all of which have a fixed +width-to-height ratio (or, in the case of Code One, a fixed height).<a +href="#fnref8" class="footnote-back" role="doc-backlink">↩︎</a></p></li> +<li id="fn9"><p>For Windows, <code>outfile</code> is assumed to be UTF-8 +encoded.<a href="#fnref9" class="footnote-back" +role="doc-backlink">↩︎</a></p></li> +<li id="fn10"><p>The <code>BARCODE_BIND_TOP</code> flag is set by +default for DPD - see <a href="#dpd-code">6.1.10.7 DPD Code</a>.<a +href="#fnref10" class="footnote-back" role="doc-backlink">↩︎</a></p></li> +<li id="fn11"><p>The <code>BARCODE_BIND</code> flag is always set for +Codablock-F, Code 16K and Code 49. Special considerations apply to +ITF-14 - see <a href="#itf-14">6.1.2.6 ITF-14</a>.<a href="#fnref11" +class="footnote-back" role="doc-backlink">↩︎</a></p></li> +<li id="fn12"><p>Codablock-F, Code 16K, Code 49, EAN-2 to EAN-13, ISBN, +ITF-14, UPC-A and UPC-E have compliant quiet zones added by default.<a +href="#fnref12" class="footnote-back" role="doc-backlink">↩︎</a></p></li> +<li id="fn13"><p><code>ZINT_CAP_EANUPC</code> was previously named +<code>ZINT_CAP_EXTENDABLE</code>, which is still recognised.<a +href="#fnref13" class="footnote-back" role="doc-backlink">↩︎</a></p></li> +<li id="fn14"><p><code>BARCODE_CODE128AB</code> previously used the name +<code>BARCODE_CODE128B</code>, which is still recognised.<a +href="#fnref14" class="footnote-back" role="doc-backlink">↩︎</a></p></li> +<li id="fn15"><p>The DX Number may be looked up in The (Modified) Big +Film Database at <a +href="https://thebigfilmdatabase.merinorus.com">https://thebigfilmdatabase.merinorus.com</a>.<a +href="#fnref15" class="footnote-back" role="doc-backlink">↩︎</a></p></li> +</ol> +</section> +</body> +</html>
