RMaxicode

 

Contents

Introduction

Sample application

The class

The servlet

References

Introduction

The package RMaxicode contains the classes you need to create Maxicode barcodes within your Java[TM] applications.

Maxicode is a two-dimensional (2D) and fixed-size matrix symbology which is made up of offset rows of hexagonal modules arranged around a unique finder pattern. The size of Maxicode is 1.11 x 1.054 inches and it can contain up to 93 data characters of information (a total of 144 including error correction codewords).

The symbol was created by United Parcel Service for fast scanning and sorting of packages.RMaxicode supports the following features:

  • modes 2,3,4,5 and 6.
  • structured append
  • full character set.

 

Symbol structure

MaxiCode symbols are divided into a primary and a secondary message, each of which contains data and error correction codewords. The primary message is made of 10 codewords and 10 error correction codewords. The primary message is used in mode 2 and 3 to encode the Postal Code, the Service class and the country.

Error correction

MaxiCode symbols have error correction codewords, based on Reed-Solomon error correction algorithms, which can be used to detect errors and correct erroneous symbols. There are two error levels; standard and enhanced (mode 5).

Maxicode modes

Modes 2 and 3 are designed for use in the transport industry. They encode the destination address and the class of service as defined by the carrier. Mode 2 uses a 9 digit numeric postal code and mode 3 uses a 6 character alphanumeric postal code. The Service class and the country are both a 3 digit number in both modes.

Mode 4 can encode up to 93 characters or 138 digits. Mode 5 can only encode up to 77 characters but it provides more error correction capabilities (enhanced mode than mode 4.

Mode 6 indicates that the symbol encodes a message used to program the reader system (scanner).

Structured append

Up to eight MaxiCode symbols may be appended in a structured format. This allows files of data to be represented in up to 8 MaxiCode symbols.

 

Sample application

In order to run the sample application you must execute example.bat. You need to use JDK 1.3. The reason is the following:

Maxicode must be printed at a minimum resolution of 200 dpi. The sample application uses the PageAttributes class of Java[TM] platform 1.3 in order to set the resolution of the printer and print the barcode. The Java[TM] development kit 1.1 and 1.2 always print at 72 dpi which is too low.

Note: the sample application requires the Java[TM] platform 1.3, not RMaxicode, the Java[TM] bean or the servlet can work with the Java[TM] platform 1.1 or later

 

In the sample application you can set following properties:

  • Mode to be used
  • Printer resolution (dots per inch).
  • Service class, Country and Postal code (for modes 2 and 3).
  • Data to be encoded.
  • Number of symbols in the secuence (if you use structured append)
  • Position of the symbol within the secuence.

and execute the following command:

  • Apply: repaint the symbol using the new properties.
  • Print: print using the given resolution.
  • Save: save the symbol in GIF format using the given resolution.

 

The class

 

Click here to see the Java[TM] documentation on the RMaxiCode class.

 

The Servlet

 

RMaxicode comes with a standard servlet (RMaxicodeServlet) you can use to create maxicode images. The paramters for the servlet can be sent using GET or POST commands. The parameters are:

  • MODE: values 2 to 6.
  • POSTALCODE.
  • COUNTRY.
  • SERVICE.
  • DATA. Data to be encoded.
  • ROTATION. rotation angle, 0, 90, 180 or 270.
  • NUMBER. Number of symbols in the secuence (if you use structured append).
  • POSITION. Position of the symbol within the secuence.

For example, if you want to test the servlet using JSWDK 1.0 you must do the following:

  1. copy the RMaxicode classes to /jswdk-1.0.1/examples/Web-inf/servlets
  2. Add the following line to the file /jswdk-1.0.1/examples/Web-inf/servlets.properties :

    RMaxicodeServlet.code=com.java4less.rmaxicode.RMaxicodeServlet

  3. Start the server an test the servlet entering the following address and parameters in your browser:

    http://localhost:8080/examples/servlet/RMaxicodeServlet?ZIPCODE=B1050&SERVICE=999&COUNTRY=056&DATA=TEST

 

References

You can find more information about maxicode at: