DataMatrix is a two-dimensional
(2D) barcode symbology which can store from 1 to about 2,000 characters.
DataMatrix ECC200 version supports advanced encoding error checking and
correction algorithms (reed-solomon). Those algorithms allow the recognition of
barcodes that are up to 60% damaged.
DataMatrix is being used to encode product and serial number
information on electrical rating plates; to mark of surgical instruments in
Japan; to identify lenses, circuit boards, and other items during
manufacturing.
Barcode Library supports all DataMatrix Formats and the
data represented in the symbol can be compressed using one of following
algorithms.
Auto (0): Barcode library will decide the best data mode for you.
ASCII (1): it is used to encode data that mainly contains ASCII characters (0-127). This is the default encoding format by Barcode Library.
C40 (2): it is used to encode data that mainly contains numeric and upper case
characters.
Text (3): it is used to encode data that mainly contains numeric and lower case
characters.
X12 (4):it is used to encode the standard ANSI X12 electronic data interchange characters.
EDIFACT (5): it is used to encode 63 ASCII values (values from 32 to 94) plus an Unlatch character (binary 011111).
There are two ways to create barcode images in your Java web applications.
This is the simplest way to stream barcode image using our provided barcode servlet classes.
And it will not save barcode images in your server side.
Under demo package, copy barcode folder to your java servlet container like tomcat.
To test your installation, goto http://YourDomain:Port/barcode/datamatrix?Data=123456789
To create barcode image in your JSP or html page, you can pass the url to IMG tag src value.
For example, <img src="http://YourDomain:Port/barcode/datamatrix?Data=123456789" />
The second method is similar with the way to generate barcode in Java applications.
Set the data property with the value to encode. Type is String.
Servlet Parameter: "Data".
Set the dataMode property.
Valid value is DataMatrix.MODE_AUTO (default),
DataMatrix.MODE_ASCII, DataMatrix.MODE_C40,
DataMatrix.MODE_TEXT,
DataMatrix.MODE_X12, DataMatrix.MODE_EDIFACT, DataMatrix.MODE_BASE256.
Auto (0): Barcode library will decide the best data mode for you.
ASCII (1): it is used to encode data that mainly contains ASCII characters (0-127). This is the default encoding format by Barcode Library.
C40 (2): it is used to encode data that mainly contains numeric and upper case
characters.
Text (3): it is used to encode data that mainly contains numeric and lower case
characters.
X12 (4):it is used to encode the standard ANSI X12 electronic data interchange characters.
EDIFACT (5): it is used to encode 63 ASCII values (values from 32 to 94) plus an Unlatch character (binary 011111).
Base256 (6): it is used to encode 8 bit values.
Servlet Parameter: "DataMode".
Set the format property. Type is int. Default is DataMatrix.FORMAT_10X10.
Specifies the Data Matrix Format to use on that symbology.
Valid values see class DataMatrix.FORMAT_*x*;
Servlet Parameter: "Format".
Data Matrix can be divided into multiple data areas. Conversely, information stored in multiple Data Matrix symbols can be reconstructed as single data symbols.
One data symbol can be divided into up to 16 symbols.
Set
isStructuredAppend property to true, then Structured Append is enabled.
Servlet Parameter: "IsStructuredAppend".
Set
symbolCount property to the number of total symbols which make the sequence.
Servlet Parameter: "SymbolCount".
Set
symbolIndex property to the position of current symbol in the secuence (Start with 0).
Servlet Parameter: "SymbolIndex".
Set
fileID property to be identified to the same file.
Servlet Parameter: "FileID".
Set the FNC1Mode property.
DataMatrix.FNC1_NONE (0)
DataMatrix.FNC1_ENABLE (1)
Servlet Parameter: "FNC1Mode".
Set the applicationIndicator property. Please set this property, if property FNC1Mode value is DataMatrix.FNC1_ENABLE (1).
Servlet Parameter: "ApplicationIndicator".
Setting up barcode image size:
Set property uom (Unit of Measure) for properties moduleSize, leftMargin, rightMargin, topMargin and bottomMargin.
Default is DataMatrix.UOM_PIXEL (0). Valid values are DataMatrix.UOM_PIXEL (0), DataMatrix.UOM_CM (1), DataMatrix.UOM_Inch (2).
Servlet Parameter: "UOM".
Set the moduleSize (for bar cell width and height). Type is float. Default is 5.
Servlet Parameter: "ModuleSize".
Set the leftMargin, rightMargin, topMargin and bottomMargin properties.
Types are all float. Default are 5 * moduleSize.
Servlet Parameter: "LeftMargin", "RightMargin", "TopMargin", "BottomMargin".
Set the barcodeWidth (barcode image width) and barcodeHeight (barcode image height) properties. Both types are float.
Servlet Parameter: "BarcodeWidth", "BarcodeHeight".
Set the resolution property (Value is expressed in DPI - Dots per inch).
Servlet Parameter: "Resolution".
Set rotate property, if you want to rotate barcode image.
Value can be 0 (DataMatrix.ANGLE_0),
1 (DataMatrix.ANGLE_90),
2 (DataMatrix.ANGLE_180),
3 (DataMatrix.ANGLE_270)
Servlet Parameter: "Rotate".
Set the processTilde property to true, if you want use the tilde character "~" to specify special characters in the input data. Default is false.
~3: is used only at the very beginning of the symbol for the reader programming
purpose.
~5: is used only at the very beginning of the symbol, the header [)> + ASCII 30
+ ASCII 05 + ASCII 29 will be transmitted by the barcode reader before the data
in the message and the trailer ASCII 30 + ASCII 4 will be transmitted
afterwards.
~6: is used only at the very beginning of the symbol, the header [)> + ASCII 30
+ ASCII 06 + ASCII 29 will be transmitted by the barcode reader before the data
in the message and the trailer ASCII 30 + ASCII 4 will be transmitted
afterwards.
~7NNNNNN: is used to specify the Extended Channel Interpretations and NNNNNN is a value between
000000 and 999999.
~NNN: is used to represent the ASCII character with the value of NNN. NNN is from 000 to 255
To set barcode image width and height, there are two ways to do it.
1) You can set barcode image width and height through properties barcodeWidth and barcodeHeight values, barcode library will render the barcode image for you.
or
2) You can set moduleSize value (barcode module width and height value), barcode library will calculate the barcodeWidth and barcodeHeight values for you, and render the barcode image.