<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.1//EN" "document-v11.dtd">
<document>
  <header>
    <title>Barcode Servlet</title>
    <authors>
      <person id="jmaerki" name="Jeremias Märki" email="jmaerki@users.sourceforge.net"/>
    </authors>
  </header>
  <body>
    <section>
      <title>Introdcution</title>
      <p>
        <strong>Barcode4J</strong> provides a simple Servlet that can be used to generate 
      	barcodes in SVG, EPS or any supported bitmap format with a URL.
      </p>
    </section>
    <section>
      <title>Try it</title>
      <p>
        <strong>Barcode4J</strong> comes with a sample web application that allows you to
    		play with the Barcode Servlet. See the <link href="../examples.html">Examples</link> page for
    		instructions.
    	</p>
    </section>
    <section>
      <title>Usage</title>
      <p>
    		If you follow the example of the sample web application a URL for a barcode generated from
    		a locally installed web container could look like this:
    	</p>
      <source><![CDATA[
  http://localhost:8080/barcode4j/gensvg?type=code128&msg=Barcode]]></source>
      <table>
        <caption>Supported parameters</caption>
        <tr>
          <th>Parameter</th>
          <th>Cardinality</th>
          <th>Description</th>
        </tr>
        <tr>
          <td>type</td>
          <td>required</td>
          <td>
            Type of the barcode. Examples: code128 (for Code 128), ean-13, upc-e etc. 
            The values are the same used for the <code>org.krysalis.barcode4j.BarcodeClassResolver</code>.
          </td>
        </tr>
        <tr>
          <td>fmt</td>
          <td>defaults to SVG</td>
          <td>
            Output format of the barcode. You can use either MIME types (such as "image/svg+xml") 
            or short format types (such as "svg" or "eps"). Supported output formats for this 
            servlet are: SVG, EPS and any supported bitmap format.
          </td>
        </tr>
        <tr>
          <td>msg</td>
          <td>required</td>
          <td>The message to encode.</td>
        </tr>
        <tr>
          <td>height</td>
          <td>optional</td>
          <td>Specifies the desired overall height of the barcode.</td>
        </tr>
        <tr>
          <td>mw</td>
          <td>optional</td>
          <td>The desired module width (normally the width of the narrow module). Example: 0.21mm</td>
        </tr>
        <tr>
          <td>wf</td>
          <td>optional</td>
          <td>The desired wide factor. Example: 2 or 2.5</td>
        </tr>
        <tr>
          <td>qz</td>
          <td>optional</td>
          <td>
            Determines the quiet zone. Example: 10mw (10 times the module width) or 1.5cm. "disable" 
            suppressed the quiet zone.
          </td>
        </tr>
        <tr>
          <td>hrp</td>
          <td>optional</td>
          <td>Determines the placement of the human-readable part. Possible values: "top", "bottom" or "none"</td>
        </tr>
        <tr>
          <td>hrsize</td>
          <td>optional</td>
          <td>Determines the font size for the human-readable part. Example: 12pt</td>
        </tr>
        <tr>
          <td>hrfont</td>
          <td>optional</td>
          <td>Determines the font to use for the human-readable part. Example: CourierNew</td>
        </tr>
        <tr>
          <td>res</td>
          <td>defaults to 300dpi</td>
          <td>(Applies to bitmaps only) Determines the resolution in dpi (dots per inch) for bitmaps.</td>
        </tr>
        <tr>
          <td>gray</td>
          <td>defaults to false</td>
          <td>
            (Applies to bitmaps only) Determines whether the bitmap should be created in grayscales 
            instread of monochrome (black and white). Valid values: "true" and "false".
          </td>
        </tr>
      </table>
      <note>
        Not all parameters are supported by every barcode type. For example, UPC and EAN barcodes don't 
        support the wide factor parameter because the wide factors are fixed.
      </note>
    </section>
  </body>
</document>
