<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8"> <TITLE>Two-Dimensional Symbols</TITLE> </HEAD> <BODY LANG="en-GB" TEXT="#000000" LINK="#0000ff" VLINK="#840084" BGCOLOR="#ffffff" DIR="LTR"> <TABLE WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0 STYLE="page-break-before: always"> <TR> <TH COLSPAN=3> <P ALIGN=CENTER>Zint Barcode Generator</P> </TH> </TR> <TR VALIGN=BOTTOM> <TD WIDTH=10%> <P ALIGN=LEFT><A HREF="fourstate.html">Prev</A></P> </TD> <TD WIDTH=80%></TD> <TD WIDTH=10%> <P ALIGN=RIGHT><A HREF="markings.html">Next</A></P> </TD> </TR> </TABLE> <HR> <H1>5.6 Two-Dimensional Symbols</H1> <P><A NAME="DMATRIX"></A><FONT SIZE=5><B>5.6.1 Data Matrix (ISO 16022)</B></FONT></P> <P>Also known as Semacode this symbology was developed in 1989 by Acuity CiMatrix in partnership with the US DoD and NASA. The symbol can encode a large amount of data in a small area. Zint supports all versions of the standard from ISO 16022 as shown in the following table. <B>Note that ECC 000 to ECC 140 are legacy standards and that their use is depreciated</B>. Symbols encoded using ECC 000 to ECC 140 will probably not be readable by most barcode readers manufactured since the early 1990s – use ECC 200 instead. The different modes are accessed using the <FONT FACE="Courier, monospace">mode=</FONT> option or by setting <FONT FACE="Courier, monospace">option_1</FONT>.</P> <TABLE WIDTH=60% BORDER=1 ALIGN=CENTER> <TR ALIGN=CENTER> <TH>Input</TH><TH>Mode</TH><TH>Error Correction Capacity</TH><TH>Recovery Capacity</TH> </TR><TR ALIGN=CENTER> <TD>1 (default)</TD><TD>ECC 200</TD><TD>28 - 62%</TD><TD>30 - 40%</TD> </TR><TR ALIGN=CENTER> <TD>2</TD><TD>ECC 000</TD><TD>0%</TD><TD>0%</TD> </TR><TR ALIGN=CENTER> <TD>3</TD><TD>ECC 050</TD><TD>25%</TD><TD>2.8%</TD> </TR><TR ALIGN=CENTER> <TD>4</TD><TD>ECC 080</TD><TD>33%</TD><TD>5.5%</TD> </TR><TR ALIGN=CENTER> <TD>5</TD><TD>ECC 100</TD><TD>50%</TD><TD>12.6%</TD> </TR><TR ALIGN=CENTER> <TD>6</TD><TD>ECC 140</TD><TD>75%</TD><TD>25%</TD> </TR> </TABLE> <P>The size of the generated symbol can also be adjusted using the <FONT FACE="Courier, monospace">--ver=</FONT> option or by setting <FONT FACE="Courier, monospace">option_2</FONT> as shown in the table below.</P> <TABLE WIDTH=100% BORDER=0 ALIGN=CENTER> <TR ALIGN=CENTER> <TH>ECC 200</TH><TH>ECC 000 - 140</TH> </TR><TR ALIGN=CENTER> <TD VALIGN=TOP><TABLE WIDTH=100% BORDER=1> <TR ALIGN=CENTER> <TH>Input</TH><TH>Symbol Size</TH><TH>Input</TH><TH>Symbol Size</TH> </TR><TR ALIGN=CENTER> <TD>1</TD><TD>10 x 10</TD><TD>16</TD><TD>64 x 64</TD> </TR><TR ALIGN=CENTER> <TD>2</TD><TD>12 x 12</TD><TD>17</TD><TD>72 x 72</TD> </TR><TR ALIGN=CENTER> <TD>3</TD><TD>14 x 14</TD><TD>18</TD><TD>80 x 80</TD> </TR><TR ALIGN=CENTER> <TD>4</TD><TD>16 x 16</TD><TD>19</TD><TD>88 x 88</TD> </TR><TR ALIGN=CENTER> <TD>5</TD><TD>18 x 18</TD><TD>20</TD><TD>96 x 96</TD> </TR><TR ALIGN=CENTER> <TD>6</TD><TD>20 x 20</TD><TD>21</TD><TD>104 x 104</TD> </TR><TR ALIGN=CENTER> <TD>7</TD><TD>22 x 22</TD><TD>22</TD><TD>120 x 120</TD> </TR><TR ALIGN=CENTER> <TD>8</TD><TD>24 x 24</TD><TD>23</TD><TD>132 x 132</TD> </TR><TR ALIGN=CENTER> <TD>9</TD><TD>26 x 26</TD><TD>24</TD><TD>144 x 144</TD> </TR><TR ALIGN=CENTER> <TD>10</TD><TD>32 x 32</TD><TD>25</TD><TD>8 x 18</TD> </TR><TR ALIGN=CENTER> <TD>11</TD><TD>36 x 36</TD><TD>26</TD><TD>8 x 32</TD> </TR><TR ALIGN=CENTER> <TD>12</TD><TD>40 x 40</TD><TD>27</TD><TD>12 x 26</TD> </TR><TR ALIGN=CENTER> <TD>13</TD><TD>44 x 44</TD><TD>28</TD><TD>12 x 36</TD> </TR><TR ALIGN=CENTER> <TD>14</TD><TD>48 x 48</TD><TD>29</TD><TD>16 x 36</TD> </TR><TR ALIGN=CENTER> <TD>15</TD><TD>52 x 52</TD><TD>30</TD><TD>16 x 48</TD> </TR> </TABLE></TD><TD VALIGN=TOP><TABLE WIDTH=100% BORDER=1> <TR ALIGN=CENTER> <TH>Input</TH><TH>Symbol Size</TH><TH>Input</TH><TH>Symbol Size</TH> </TR><TR ALIGN=CENTER> <TD>1</TD><TD>7 x 7</TD><TD>12</TD><TD>29 x 29</TD> </TR><TR ALIGN=CENTER> <TD>2</TD><TD>9 x 9</TD><TD>13</TD><TD>31 x 31</TD> </TR><TR ALIGN=CENTER> <TD>3</TD><TD>11 x 11</TD><TD>14</TD><TD>33 x 33</TD> </TR><TR ALIGN=CENTER> <TD>4</TD><TD>13 x 13</TD><TD>15</TD><TD>35 x 35</TD> </TR><TR ALIGN=CENTER> <TD>5</TD><TD>15 x 15</TD><TD>16</TD><TD>37 x 37</TD> </TR><TR ALIGN=CENTER> <TD>6</TD><TD>17 x 17</TD><TD>17</TD><TD>39 x 39</TD> </TR><TR ALIGN=CENTER> <TD>7</TD><TD>19 x 19</TD><TD>18</TD><TD>41 x 41</TD> </TR><TR ALIGN=CENTER> <TD>8</TD><TD>21 x 21</TD><TD>19</TD><TD>43 x 43</TD> </TR><TR ALIGN=CENTER> <TD>9</TD><TD>23 x 23</TD><TD>20</TD><TD>45 x 45</TD> </TR><TR ALIGN=CENTER> <TD>10</TD><TD>25 x 25</TD><TD>21</TD><TD>47 x 47</TD> </TR><TR ALIGN=CENTER> <TD>11</TD><TD>27 x 27</TD> </TR> </TABLE></TD> </TR> </TABLE> <IMG SRC="matrix.png" NAME="graphics1" ALIGN=LEFT WIDTH=44 HEIGHT=44 BORDER=0><BR CLEAR=LEFT> <P><A NAME="QRCODE"></A><FONT SIZE=5><B>5.6.2 QR Code (ISO 18004)</B></FONT></P> <P>Also known as Quick Response Code this symbology was developed by Denso. QR Code support in Zint relies on <I>libqrencode</I> (version 2.0.0 or later) which is available from <A HREF="http://megaui.net/fukuchi/works/qrencode/index.en.html">http://megaui.net/fukuchi/works/qrencode/index.en.html</A>. Support for QR Code through <I>libzint</I> means that developers only need to write handlers for one API which covers QR Code as well as all of the other code symbologies provided by <I>libzint</I>. Four levels of error correction are available using the <FONT FACE="Courier, monospace">security=</FONT> option or setting <FONT FACE="Courier, monospace">option_1</FONT> as shown in the following table.</P> <TABLE WIDTH=60% BORDER=1 ALIGN=CENTER> <TR ALIGN=CENTER> <TH>Input</TH><TH>ECC Level</TH><TH>Error Correction Capacity</TH><TH>Recovery Capacity</TH> </TR><TR ALIGN=CENTER> <TD>1</TD><TD>L (default)</TD><TD>Approx 20% of symbol</TD><TD>Approx 7%</TD> </TR><TR ALIGN=CENTER> <TD>2</TD><TD>M</TD><TD>Approx 37% of symbol</TD><TD>Approx 15%</TD> </TR><TR ALIGN=CENTER> <TD>3</TD><TD>Q</TD><TD>Approx 55% of symbol</TD><TD>Approx 25%</TD> </TR><TR ALIGN=CENTER> <TD>4</TD><TD>H</TD><TD>Approx 65% of symbol</TD><TD>Approx 30%</TD> </TR> </TABLE> <P>The size of the symbol can be set by using the <FONT FACE="Courier, monospace">vers=</FONT> option or setting <FONT FACE="Courier, monospace">option_2</FONT> to the QR Code version required (1-40). The maximum capacity of a (version 40) QR Code symbol is 7089 numeric digits, 4296 alphanumeric characters or 2953 bytes of data.</P> <IMG SRC="qr.png" NAME="graphics5" ALIGN=LEFT WIDTH=50 HEIGHT=50 BORDER=0><BR CLEAR=LEFT> <P><A NAME="MICROQR"></A><FONT SIZE=5><B>5.6.3 Micro QR Code (ISO 18004)</B></FONT></P> <P ALIGN=LEFT>A miniature version of the QR Code symbol for short messages. ECC levels can be selected as for QR Code (above). Micro QR Code support does not require <I>libqrencode</I>.</P> <IMG SRC="microqr.png" NAME="graphics2" ALIGN=LEFT WIDTH=30 HEIGHT=30 BORDER=0><BR CLEAR=LEFT> <P><A NAME="MAXI"></A><FONT SIZE=5><B>5.6.4 Maxicode (ISO 16023)</B></FONT></P> <P ALIGN=LEFT>Developed by UPS the Maxicode symbology employs a grid of hexagons surrounding a 'bulls-eye' finder pattern. This symbology is designed for the identification of parcels. Zint encodes Maxicode symbols in Mode 2 or Mode 3 depending on the postcode data entered. In these modes Maxicode symbols are composed of two parts named the primary and secondary messages. The primary message consists of a structured data field which includes various data about the package being sent, the secondary message usually consists of address data in a data structure. The format of the primary message is given in the following table: </P> <TABLE WIDTH=60% BORDER=1 ALIGN=CENTER> <TR ALIGN=CENTER> <TH>Characters</TH><TH>Meaning</TH> </TR><TR ALIGN=CENTER> <TD>1-9</TD><TD> <P>Postcode data which can consist of up to 9 digits (for mode 2) or up to 6 alphanumeric characters (for mode 3). Remaining unused characters should be filled with the SPACE character (ASCII 32).</P></TD> </TR><TR ALIGN=CENTER> <TD>10-12</TD><TD> <P ALIGN=CENTER>Three digit country code according to ISO 3166 (see <A HREF="appxb.html">Appendix B</A>).</P></TD> </TR><TR ALIGN=CENTER> <TD>13-15</TD><TD> <P ALIGN=CENTER>Three digit service code. This depends on your parcel courier.</P></TD> </TR> </TABLE> <P ALIGN=LEFT>The primary message can be designated at the command prompt using the <FONT FACE="Courier, monospace">--primary=</FONT> switch. The secondary message uses the normal data entry method. For example:</P> <P ALIGN=LEFT><FONT FACE="Courier, monospace">zint -o test.eps -b 57 --primary='999999999840012' -d 'Secondary Message Here'</FONT></P> <P ALIGN=LEFT>When using the API the primary message must be placed in the <FONT FACE="Courier, monospace">symbol->primary</FONT> string. The secondary is entered in the same way as described in section 4.2.</P> <P ALIGN=LEFT>Modes 4 to 6 can be encoded using the <FONT FACE="Courier, monospace">--mode=</FONT> switch or by setting <FONT FACE="Courier, monospace">option_1</FONT>. Modes 4 to 6 do not require a primary message. For example:</P> <P ALIGN=LEFT><FONT FACE="Courier, monospace">zint -o test.eps -b 57 --mode=4 -d 'A MaxiCode Message in Mode 4'</FONT></P> <P ALIGN=LEFT>Mode 6 is reserved for the maintenance of scanner hardware and should not be used to encode user data. All modes support extended ASCII characters and number compression. The maximum length of text which can be placed in a Maxicode symbol depends on the type of characters used in the text. Example maximum data lengths are given in the table below:</P> <TABLE WIDTH=60% BORDER=1 ALIGN=CENTER> <TR ALIGN=CENTER> <TH>Mode</TH><TH>Maximum Data Length for Capital Letters</TH><TH>Maximum Data Length for Numeric Digits</TH><TH>Number of Error Correction Codewords</TH> </TR><TR ALIGN=CENTER> <TD>2 (secondary only)</TD><TD>84</TD><TD>126</TD><TD>50</TD> </TR><TR ALIGN=CENTER> <TD>3 (secondary only)</TD><TD>84</TD><TD>126</TD><TD>50</TD> </TR><TR ALIGN=CENTER> <TD>4</TD><TD>93</TD><TD>135</TD><TD>50</TD> </TR><TR ALIGN=CENTER> <TD>5</TD><TD>77</TD><TD>110</TD><TD>66</TD> </TR><TR ALIGN=CENTER> <TD>6</TD><TD>93</TD><TD>135</TD><TD>50</TD> </TR> </TABLE> <P ALIGN=LEFT><B>PLEASE NOTE</B> that due to the unique style of the Maxicode symbol not all of the options available for other symbologies are available. Settings for height and scale will be ignored. Colour options are available as with other symbologies. PNG output is set at a resolution of 12 pixels per millimetre (approx 300 dpi) and uses the methods set out in Annex J of the ISO/IEC standard.</P> <IMG SRC="maxicode.png" NAME="graphics3" ALIGN=LEFT WIDTH=200 HEIGHT=200 BORDER=0><BR CLEAR=LEFT> <P><A NAME="AZTEC"></A><FONT SIZE=5><B>5.6.5 Aztec Code (ISO 24778)</B></FONT></P> <P ALIGN=LEFT>Invented by Andrew Longacre at Welch Allyn Inc in 1995 the Aztec Code symbol is a matrix symbol with a distinctive bulls-eye finder pattern. Zint can generate Compact Aztec Code (sometimes called Small Aztec Code) as well as “full-range” Aztec Code symbols and by default will automatically select symbol type and size dependent on the length of the data to be encoded. Error correction codewords will normally be generated to fill at least 23% of the symbol. Two options are available to change this behaviour:</P> <P ALIGN=LEFT>The size of the symbol can be specified using the <FONT FACE="Courier, monospace">--ver=</FONT> switch followed by (or setting <FONT FACE="Courier, monospace">option_2</FONT> to) a value between 1 and 36 according to the following table:</P> <TABLE WIDTH=60% BORDER=1 ALIGN=CENTER> <TR ALIGN=CENTER> <TH>Value Entered</TH><TH>Symbol Generated</TH> </TR><TR ALIGN=CENTER> <TD>1-4</TD><TD>Compact Aztec Code with [value] layers</TD> </TR><TR ALIGN=CENTER> <TD>5-36</TD><TD>“Full-Range” Aztec Code with [value – 4] layers</TD> </TR> </TABLE> <P ALIGN=LEFT>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 ALIGN=LEFT>Alternatively the amount of error correction data can be specified by use of the <FONT FACE="Courier, monospace">--mode=</FONT> switch followed by (or setting <FONT FACE="Courier, monospace">option_1</FONT> to) a value from the following table:</P> <TABLE WIDTH=60% BORDER=1 ALIGN=CENTER> <TR ALIGN=CENTER> <TH>Mode</TH><TH>Error Correction Capacity</TH> </TR><TR ALIGN=CENTER> <TD>1</TD><TD>>10% + 3 codewords</TD> </TR><TR ALIGN=CENTER> <TD>2</TD><TD>>23% + 3 codewords</TD> </TR><TR ALIGN=CENTER> <TD>3</TD><TD>>36% + 3 codewords</TD> </TR><TR ALIGN=CENTER> <TD>4</TD><TD>>50% + 3 codewords</TD> </TR> </TABLE> <P ALIGN=LEFT>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 ALIGN=LEFT>Aztec Code is able to encode any extended ASCII character data up to a maximum length of approximately 3823 numeric or 3067 alphabetic characters or 1914 bytes of data.</P> <IMG SRC="aztec.png" NAME="graphics4" ALIGN=LEFT WIDTH=46 HEIGHT=46 BORDER=0><BR CLEAR=LEFT> <P><A NAME="AZRUNE"></A><FONT SIZE=5><B>5.6.6 Aztec Runes</B></FONT></P> <P ALIGN=LEFT>A truncated version of compact Aztec Code for encoding whole integers between 0 and 255. Includes Reed-Solomon error correction. As defined in ISO/IEC 24778 Annex A.</P> <IMG SRC="azrune.png" NAME="graphics6" ALIGN=LEFT WIDTH=22 HEIGHT=22 BORDER=0><BR CLEAR=LEFT> <HR> <TABLE WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0> <TR> <TD WIDTH=33% HEIGHT=5> <P ALIGN=LEFT><A HREF="fourstate.html">Prev</A></P> </TD> <TD WIDTH=34%> <P ALIGN=CENTER><A HREF="index.html">Home</A></P> </TD> <TD WIDTH=33%> <P ALIGN=RIGHT><A HREF="markings.html">Next</A></P> </TD> </TR> <TR> <TD WIDTH=33%> <P ALIGN=LEFT>4-State Codes</P> </TD> <TD WIDTH=34%> <P ALIGN=CENTER> </P> </TD> <TD WIDTH=33%> <P ALIGN=RIGHT>Markings</P> </TD> </TR> </TABLE> </BODY> </HTML>