The package J4L-Micro QRCode contains the classes you need to create Micro QRCode barcodes within your jsp or java applications.
The Micro QR Code format (also specified in this International Standard), is a variant of QR Code with a reduced number of overhead modules and a restricted range of sizes. A single finder pattern, is located at the upper left corner of the symbol as illustrated in the following figure.
Micro QR Code symbols have 4 version (version 1 to 4). The sizes of the barcodes are:
version M1: 11 x 11 modules.
version M2: 13 x 13 modules.
version M3: 15 x 15 modules.
version M4: 17 x 17 modules.
The maximum barcode capacity of Micro QR Code the largest barcode symbol size, (Version 4 error correction level L):
numeric data (digits 0-9): 35 characters
aphanumeric data (digits 0 - 9 , upper case letters A -Z and nine other characters: space, $ % * + - . /): 21 characters
Byte data ( (bytes 0-255): 15 characters
Kanji data ( hexadecimal values 8140 -9FFC and E040 - EBBF ): 9 characters
Supports 4 error correction levels:
In order to install the software you just need to unzip the ZIP file in an empty directory (your must unzip with pathname so that the subdirectories are properly created.
In order to run the sample application you must execute runDEMO.bat. The sample application requires JDK 1.3 or later.
In the sample application you can set all properties of the Micro QRCode symbology.
You can execute the following commands:
- Apply: repaint the symbol using the new properties.
- Print: send image to printer at the selected resolution.
- Save: save the symbol in jpg format. We recommend you to use gif or png formats,however the sample application uses JPG because it does not require you to download any additional package. In order to create gif or png files you must download an external encoder (see javadoc).
- Exit: terminate application.
Micro QRCode comes with a standard servlet (com.java4less.microqrcode.QRCodeServlet) you can use to create Micro QRCode images. The parameters for the servlet can be sent using GET or POST commands. The parameters are:
For example, if you want to test the servlet using Tomcat 4.1 you must do the following:
http://localhost:8080/examples/servlet/MicroQRCodeServlet?DATA=ABC&ENCODING=NORMAL
In order to property print a barcode created with the servlet you must use the <IMG> tag. In this way you can embed the image in your HTML page. Note that you will need to use the attibutes height and width in order to achieve the correct size of the barcode on the printed page.
This is a simple HTML page that contains a qrcode symbol:
<HTML>
<HEAD><TITLE>Servlet Example META http-equiv=Content-Type content="text/html; charset=windows-1252">
</HEAD>
<BODY bgColor=#ffffff>This is your Barcode:
<IMG height=100 width=100 src="http://localhost:8080/examples/servlet/MicroQRCodeServlet?DATA=TEST" ></BODY>
</HTML>
You must add the following code in your html pages to use the applet:
<APPLET
CODEBASE = "./"
CODE = "com.java4less.microqrcode.QRCodeApplet.class"
ARCHIVE = "microqrcode.jar"
NAME = "TestApplet"
WIDTH = 300
HEIGHT = 250
HSPACE = 0
VSPACE = 0
ALIGN = middle
><PARAM NAME = "DATA" VALUE = "123411">
</APPLET>
Note that the microqrcode.jar file must be located in the directory referenced by the CODEBASE parameter.
The available paramete are the same as those used by the servlet (see description in the previous section):
Table — Data capacity for Micro QRCode versions
Version
|
Error
Correction Level
|
Numeric |
Alphanumeric |
Byte |
Kanji |
1 |
|
5 |
- |
- |
- |
2 |
L |
10 |
6 |
- |
- |
3 |
L |
23 |
14 |
9 |
6 |
4 |
L |
35
|
21
|
15
|
9 |
Alphanumeric mode is not available in Version M1 Micro QR Code symbols.
Byte mode is not available in Version M1 or M2 Micro QR Code symbols.
Kanji mode is not available in version M1 or M2 Micro QR Code symbols.