<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "document-v20.dtd">
<document>
  <header>
    <title>DataMatrix</title>
  </header>
  <body>
    <p>also known as: ISO/IEC 16022:2000(E)</p>
    <section id="example">
      <title>Example</title>
      <figure src="../images/example-datamatrix-square.png" alt="Example DataMatrix symbol (square)"/>
      <figure src="../images/example-datamatrix-rect.png" alt="Example DataMatrix symbol (rectangular)"/>
    </section>
    <section id="structure">
      <title>Structure</title>
      <p>The configuration for the default implementation is:</p>
      <source>&#60;barcode&#62;
  &#60;<strong>datamatrix</strong>&#62;
      &#60;module-width&#62;{<a href="barcode-xml.html#length">length</a>:0.352777mm}&#60;/module-width&#62; &#60;!-- 1 pixel at 72dpi --&#62;
      &#60;quiet-zone enabled="{<a href="barcode-xml.html#boolean">boolean</a>:true}"&#62;{<a href="barcode-xml.html#length">length</a>:1mw}&#60;/quiet-zone&#62;
      &#60;shape&#62;{<a href="barcode-xml.html#shape">shape</a>:force-none}&#60;/shape&#62;
      &#60;min-symbol-size&#62;{<a href="barcode-xml.html#dimension">dimension</a>}&#60;/min-symbol-size&#62;
      &#60;max-symbol-size&#62;{<a href="barcode-xml.html#dimension">dimension</a>}&#60;/max-symbol-size&#62;
  &#60;/<strong>datamatrix</strong>&#62;
&#60;/barcode&#62;</source>
    </section>
    <section>
      <title>Notes</title>
      <ul>
        <li>This symbology has no human-readable part!</li>
        <li>The algorithm always chooses the smallest possible symbol arrangement.</li>
        <li>Structured append functionality is not implemented, yet.</li>
        <li>
          "min-symbol-size" and "max-symbol-size" are both optional and can be used to restrict
          the size of the generated DataMatrix symbols. If you omit either one, there's no
          constraint for either bigger or smaller symbols. This feature is particularly useful
          if you want to generate DataMatrix symbols for the German Post. They require the symbols
          to be either 22x22 or 26x26, depending on the message size. Since Barcode4J usually
          tries to always generate the smallest possible symbol, you might actually end up with
          a 24x24 symbol if the message can be encoded very efficiently. Specifying "26x26"
          for both "min-symbol-size" and "max-symbol-size" ensures that the symbol is always
          the right size. If the message doesn't fit inside a symbol that matches these constraints,
          an error will be generated. If the symbol is much larger than necessary to encode the
          message, padding codewords are automatically added. These padding codewords don't affect
          the decoded message.
        </li>
      </ul>
    </section>
    <section>
      <title>Message format</title>
      <ul>
        <li>All ISO-8859-1 characters are valid message characters.</li>
        <li>Using only numeric characters allows for smaller symbol sizes.</li>
        <li>Currently, no ECI functionality is available. Only characters in the "ISO-8859-1" encoding can be used.</li>
        <li>Currently, the FNC1 and reader programming signal cannot be encoded.</li>
        <li>
          Some applications use special ASCII characters like &lt;GS&gt; (group separator) or
          &lt;RS&gt; (record separator). Just send them as is to Barcode4J. In Java a preamble of
          such an application ("[)&gt;<sup>R</sup><sub>S</sub>05<sup>G</sup><sub>S</sub>") can be
          expressed as "[)>\u001E05\u001D". The same encoded as part of an URL (when using the
          barcode servlet) will be "%5B%29%3E%1E05%1D".
        </li>
        <li>
          Binary data can be supplied through URLs if they are enclosed in "url()".
          <a href="http://www.faqs.org/rfcs/rfc2397.html">RFC 2397</a> data URLs can be used to
          encode inline data.
          An example to encode the text "~Test~": <code>url(data:;base64,flRlc3R+)</code> or
          <code>url(data:text/plain;charset=iso-8859-1,%7ETest%7E)</code>
          (the "charset="iso-8859-1" is important to get characters above the 7bit US-ASCII set
          correctly!).
        </li>
      </ul>
    </section>
  </body>
</document>

