<h2>Manual Page</h2>

<verbatim>
    package require tzint ?1.0?
    tzint::Encode version
    tzint::Encode symbologies
    tzint::Encode bits | eps | svg | xbm varName data ?-option value ...?
    tzint::RcsId
</verbatim>

<p> Performs one of several barcode encoding operations, depending on option. The legal commands and options (which may be abbreviated) are:</p>

<table class="">
	<tbody>
		<tr class="">

			<td>command returns the version of underlaying libzint.</td>
		</tr>
		<tr class="">

			<td>command returns a list of symbology names that can be encoded.</td>
		</tr>
		<tr class="">
			<td><b>bits</b> | <b>eps</b> | <b>svg</b> |
			<td>command encodes a barcode into
		</tr>
	</tbody>
</table>


<p><b>tzint::Encode</b> will return 0 if no error occurs. More infomation can be obtainted by option

<p>Selecting which type of barcode you wish to produce (i.e. which symbology to use) can be done using the <b>-symbology</b>

<p>The height of a 1d symbol can be adjusted using the <b>-height</b>

<p>The amount of whitespace to the left and right of the generated barcode can be altered using <b>-whitespace</b>

<p>tzint allows the symbol to be bound with 'boundary bars' using the option <b>-bind</b> <i>boolean</i>. 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. tzint can also put a border right around the symbol and its whitespace with the <b>-box</b> <i>boolean</i> option. This option is automatically selected for ITF-14 symbols.<br>The width of the boundary or box can be specified using the <b>-border</b> <i>integer</i> switch.</p>

<p>The default colours of a symbol are a black symbol on a white background. tzint allows you to change this. For more specific needs the foreground and background colours can be specified using the <b>-foreground</b> or <b>-fg</b> or <b>-background</b> or <b>-bg</b> options followed by a number in RGB hexadecimal notation (the same system used in HTML).</p>

<p>The symbol can be rotated through four orientations using the <b>-rotate</b> option followed by the angle <i>0</i> | <i>90</i> | <i>180</i> | <i>270</i> of rotation.</p>

<p>The scale of the image can be altered using the <b>-scale</b> <i>integer</i> option followed by a multiple of the default x-dimension.</p>

<p><b>Input modes

<p>GS1 data can be encoded in a number of symbologies. Application identifiers are enclosed in <nowiki>[</nowiki>square brackets<nowiki>]</nowiki> followed by the data to be encoded. To encode GS1 data use <b>-format</b> <i>gs1</i>. GS1 mode is assumed (and doesn't need to be set) for EAN-128, DataBar and Composite symbologies but is also available for Code 16k, Data Matrix (ECC 200 only), Aztec Code and QR Code.</p>

<p>QR Code, Micro QR Code and Grid Matrix standards can encode Kanji characters. These can be given in Unicode <b>-format</b> <i>unicode</i> (default) format as part of the input data string. Conversion from Unicode to Shift- JIS or GB 2312 as appropriate is handled by tzint. </p>

<p>If the input data is not Unicode encoded or should be interpreted as an 8-bit data stream then the <b>-format</b> <i>binary</i> option can be used to achieve this.</p>

<p>Barcode specific options:</p>

<table>
	<tbody>
		<tr>


			<td>number of columns PDF417 <em> (same as
		</tr>
		<tr>


			<td>option QR Code and Plessy <em> (same as
		</tr>
		<tr>


			<td>error correction level PDF417 and QR Code <em> (same as
		</tr>
		<tr>


			<td>tructured primary data mode Maxicode and Composite <em> (same as
		</tr>
		<tr>


			<td>structured primary data Maxicode and Composite</td>
		</tr>
		<tr>


			<td>no interpretation line</td>
		</tr>
		<tr>


			<td>force DataMatrix symbols to be square <em> (same as
		</tr>
		<tr>


			<td>create reader initialisation symbol Code128 and DataMatrix</td>
		</tr>
		<tr>


			<td>tiny interpretation line font</td>
		</tr>
		<tr>


			<td>see zint manual</td>
		</tr>
		<tr>


			<td>see zint manual</td>
		</tr>
		<tr>


			<td>see zint manual</td>
		</tr>
	</tbody>
</table>

<p>Changing the '0'/'1' character when using the bits command then the <b>-onchar</b> and/or <b>-offchar</b> <i>char</i> option can be used.</p>

<p><b>MSI

<p>Based on Plessey and developed by MSE Data Corporation, MSI Plessey is available with a range of check digit options available by using the <b>-vers</b> <i>integer</i>' option. Any length numeric (digits 0-9) input can be encoded. The table below shows the options available:</p>

<table>
	<tbody>
		<tr>
			<th>Value</th>
			<th>Check Digits</th>
		</tr>
		<tr>
			<td>0</td>
			<td>None</td>
		</tr>
		<tr>
			<td>1</td>
			<td>Modulo-10</td>
		</tr>
		<tr>
			<td>2</td>
			<td>Modulo-10 &amp; Modulo-10</td>
		</tr>
		<tr>
			<td>3</td>
			<td>Modulo-11</td>
		</tr>
		<tr>
			<td>4</td>
			<td>Modulo-11 &amp; Modulo-10</td>
		</tr>
	</tbody>
</table>

<p><b>Standard Code 39 (ISO

<p>Standard Code 39 was developed in 1974 by Intermec. Input data can be of any length and supports the characters 0-9, A- Z, dash (-), full stop (.), space, asterisk (*), dollar ($), slash (/), plus (+) and percent (%). The standard does not require a check digit but a modulo-43 check digit can be added if required by using <b>-vers</b>

<p><b>Extended Code
Also known as Code 39e and Code39+, this symbology expands on Standard Code 39 to provide support to the full ASCII character set. The standard does not require a check digit but a modulo-43 check digit can be added if required by using <b>-vers</b> <i>1</i>.

<p><b>GS1 DataBar (ISO

<p>Also known as RSS (Reduced Spaced Symbology) these symbols are due to replace GS1-128 symbols starting in 2010 in accordance with the GS1 General Specification. If a GS1 DataBar symbol is to be printed with a 2D component as specified in ISO 24723 set option <b>-mode</b> <i>2</i> at the command prompt.</p>

<p><b>PDF417 (ISO

<p>Heavily used in the parcel industry, the PDF417 symbology can encode a vast amount of data into a small space. tzint supports encoding up to the ISO standard maximum symbol size of 925 codewords which (at error correction level 0) allows a maximum data size of 1850 text characters, or 2710 digits. The width of the generated PDF417 symbol can be specified at the command line using the <b>-cols</b> switch followed by a number between 1 and 30, and the amount of check digit information can be specified by using the '-security switch followed by a number between 0 and 8 where the number of codewords used for check information is determined by 2(value + 1). The default level of check information is determined by the amount of data being encoded. International text support is provided using the Latin-1 character set as described in Appendix A. A separate symbology ID can be used to encode Health Industry Barcode (HIBC) data which adds a leading '+' character and a modulo-49 check digit to the encoded data.</p>

<p><b>Channel

<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 <b>-vers</b>. 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>

<table>
	<thead>
		<tr>
			<th>Channels</th>
			<th>Minimum Value</th>
			<th>Maximum Value</th>
		</tr>
	</thead>
	<tbody>
		<tr>
			<td>3</td>
			<td>00</td>
			<td>26</td>
		</tr>
		<tr>
			<td>4</td>
			<td>000</td>
			<td>292</td>
		</tr>
		<tr>
			<td>5</td>
			<td>0000</td>
			<td>3493</td>
		</tr>
		<tr>
			<td>6</td>
			<td>00000</td>
			<td>44072</td>
		</tr>
		<tr>
			<td>7</td>
			<td>000000</td>
			<td>576688</td>
		</tr>
		<tr>
			<td>8</td>
			<td>0000000</td>
			<td>7742862</td>
		</tr>
	</tbody>
</table>

<p>Note that 7 and 8 channel codes require a processor intensive algorithm to generate and so response times when generating these codes will be relatively slow.</p>

<p><b>QR Code (ISO

<p>Also known as Quick Response Code this symbology was developed by Denso. Four levels of error correction are available using the <b>-security</b> option as shown in the following table.</p>

<table>
	<thead>
		<tr>
			<th>Input</th>
			<th>ECC Level Error</th>
			<th>Correction Capacity</th>
			<th>Recovery Capacity</th>
		</tr>
	</thead>
	<tbody>
		<tr>
			<td>1</td>
			<td>L (default)</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>

<p>The size of the symbol can be set by using the <b>-vers</b> option to the QR Code version required (1-40). 1 = 21 x 21 and 40 = 177 x 177.
The maximum capacity for a (version 40) QR Code symbol 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 encode characters in the Latin-1 set and Kanji characters which are members of the Shift-JIS encoding scheme. Input should be entered as a UTF-8 stream with conversion to Shift-JIS being carried out automatically by tzint. A separate symbology ID can be used to encode Health Industry Barcode (HIBC) data which adds a leading '+' character and a modulo-49 check digit to the encoded data.</p>

<p><b>GS1 DataBar Expanded Stacked (ISO

<p>A stacked variation of the GS1 DataBar Expanded symbol for smaller packages. In addition the width of the symbol can be altered using the <b>-cols</b> option. In this case the number of columns relates to the number of character pairs on each row of the symbol. For symbols with a 2D component the number of columns must be at least 2. This symbol can be generated with a two-dimensional component to make a composite symbol.

<p><b>Composite Symbols (ISO

<p>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 Specification. Composite symbols consist of a linear component which can be an EAN, UPC, GS1-128 or GS1 DataBar symbol, a 2D component which is based on PDF417 or MicroPDF417, and a separator pattern. The type of linear component to be used is determined using the <b>-symbology</b> option as with other encoding methods.<br>Valid values are: <i>eanx_cc</i>, <i>ean128_cc</i>, <i>rss14_cc</i>, <i>rss_ltd_cc</i>, <i>rss_exp_cc</i>, <i>upca_cc</i>, <i>upce_cc</i>, <i>rss14stack_cc</i>, <i>rss14_omni_cc</i> and <i>rss_expstack_cc</i>.<br>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 (see exmpample below).</p>