Java Data Matrix Barcode Generator Library
Create, encode data matrix 2d barcode using java barcode encoder with free java open source example source code


How to generate, display, print gs1 compatible Data Matrix 2d barcode labels in Java class, Apache web application



  • Robust and reliable Java library for Data Matrix generation
  • Completely created and written in Java
  • Support Java SDK 1.4.2 and later versions
  • Compatible with the latest Data Matrix barcode specification
  • Easy to create Data Matrix barcodes in Java class, iReport and Eclipse BIRT
  • Allow users to adjust the parameters of Data Matrix barcode image freely
  • Easy to rotate barcode image into 0, 90, 180 & 270 degrees
Java Data Matrix Barcode Creator Overview
Data Matrix barcode generator for Java, a professional and advanced barcode generator, creates standard Data Matrix barcodes in Java class. The barcodes are generated in accordance with the latest Data Matrix barcode specification. Additionally, rich barcode settings are provided for users to customize their barcodes.
Data Matrix Barcode Overview in Java
Data Matrix is a widely used 2D barcode which is invented by International Data Matrix (ID Matrix) in 1989. It is widely used to mark small items and label small electronic components recommended by the United States of America's Electronic Industries Alliance (EIA).
Data Matrix Encodable Characters in Java
  • All ASCII characters, including 0-9, A-Z, a-z and special characters like $ , % + / : * etc
  • Double-byte characters, binary data and 8 bit values
Download Data Matrix Java Barcode Generator
Please download and unzip KA.Barcode for Java evaluation version, with which users can create 20+ linear and two-dimensional barcode images in Java. The free evaluation version includes:
  • com.keepautomation.barcode.jar
  • "barcode" folder & "java-barcode-api" folder
  • End user license agreement, user manual, and order page
Note: This evaluation version is designed to insert and add barcode images in Java implementations. But the generated barcode images may include a "KA Barcode" watermark at random.
Data Matrix Introduction
Data Matrix, also known as Data Matrix ECC200, is a two-dimensional (2D) matrix symbology, which is defined in "ISO/IEC 16022"

KeepAutomation Java Data Matrix generator library supports Data Matrix barcodes generating in Java class, web app, servlet, web service, Java reporting applications. And all of the generated Data Matrix barcodes are compatible with ISO standards.
Data Matrix Code Encoding in Java

Encoded character set
Data Matrix barcode supports full ASCII characters and extended ASCII character set encoding.

  • Full ASCII chars code values 0 - 127 in accordance with the US national version of ISO/IEC 646
  • Extended ASCII chars code values 128 - 255 in accordance with ISO 8859-1. These are referred to as extended ASCII.
  • Other character sets (e.g. Arabic, Cyrillic, Greek, Hebrew) may be supported when using the Extended Channel Interpretation (ECI) protocol
  • Unicode text in byte array
Using Data Matrix generate Java API, you can easily encode the above characters into Data Matrix, and generate high resolution Data Matrix images in your Java Windows or Web program.



Maximum data length of Data Matrix
It depends on the encoding Data Matrix characters type, Data Matrix supports maximum data length from 1,555 to 3,116 characters.
  • Alphanumeric data: up to 2,335 characters
  • Byte data (8-bit): 1,555 characters
  • Numeric data: 3,116 digits
If your encoding Data Matrix character set has exceeded the maximum data length of Data Matrix, the java library will produce an empty image with text "Invalid Barcode Settings" printed.



Data Matrix data mode
To encode data efficiently into the Data Matrix symbology, the Data Matrix will convert the input data into codewords with the following 6 data modes applied.
  • ASCII (double digit numerics; ASCII values 0 – 127; Extended ASCII values 128 – 255)
  • C40 (Upper-case alphanumeric; Lower case and special characters;)
  • Text (Lower-case alphanumeric; Upper case and special characters)
  • X12 (ANSI X12 EDI data set)
  • EDIFACT (ASCII values 32 – 94)
  • Base 256 (All byte values 0 - 255)
Java barcode generator for Data Matrix API provides an easy method to encode data matrix data message with "AUTO" mode. If you choose the "AUTO" mode, you do not need analyze your encoding data characters, and the barcode java library will automatically choose the most suitable data mode for you.

However if you need create Data Matrix from byte array data, in the Java class, you need specify the data mode as "Base 256".



Data Matrix Encode Unicode text
You cannot encode Unicode into Data Matrix in your Java class directly. To do so, you need convert your Unicode text into byte array using UTF8 encoding in your Java program.

Then you could generate Data Matrix with converted byte array data using "Base 256" data mode in the Java application.



Generate GS1 Data Matrix in Java
Data Matrix is one of the 2d barcodes as GS1 data carrier supported by the GS1 System.

Using the Java Data Matrix Generator library, you can encode a GS1 element strings into Data Matrix in your Java Windows or web app, please follow the steps below:
  • Enable property "GS1 compatible"
  • For each GS1 application identifier (AI) code, surround the AI code with "()", and followed by its AI data string. For example "(01)12345678902222(02)6666".
Add Data Matrix Barcode Image in Java Class

Install KA.Barcode for Java
  1. Unzip the downloaded trial version of KA.Barcode for Java.
  2. Choose "com.keepautomation.barcode.jar" file from the unzipped package and copy it to your Java project library folder.
  3. Add reference "com.keepautomation.barcode.jar" to your project.
Create Data Matrix in Java with Sample Code
Refer to sample code below for adding a Data Matrix barcode in Java class. You can change properties of Data Matrix barcode image.
Sample code
     public static void main(String[] args)
{

BarCode datamatrix = new BarCode();

datamatrix.setCodeToEncode("123456789");
datamatrix.setSymbology(IBarCode.DATAMATRIX);
datamatrix.setDataMatrixDataMode(IBarCode.DM_MODE_AUTO);
datamatrix.setDataMatrixFormatMode(0);
datamatrix.setFnc1(IBarCode.FNC1_NONE);

try
{

datamatrix.draw("c://datamatrix.gif");

}
catch (Exception e) {
e.printStackTrace();
}
}
}
Generate Data Matrix in iReport Through JRRenderable Implementation
Besides creating high quality Data Matrix barcodes in Java class, KA.Barcode for Java also can insert Data Matrix barcodes in iReport through JRRenderable implementation. To see more information about how to generate barcodes in iReport through JRRenderable implementation, please download KA.Barcode for Java free trial package and read the user manual.
Create Data Matrix in iReport Through Servlet Web Application
Generating great quality Data Matrix barcodes in iReport through Servlet Web Application is also supported by KA.Barcode for Java. If you are interested in the detailed process of creating barcodes in iReport through Servlet Web Application, please download KA.Barcode for Java free trial package and read the user manual.
Free Trial DownloadJava Class Data MatrixiReport Data MatrixPDF417 for JavaQR Code for JavamoreCodabar for JavaCode 39 for JavaCode 128 for JavaEAN-8 for JavaEAN-13 for JavaEAN 128 for JavaIntelligent Mail for JavaInterleaved 2 of 5 for JavaISBN for JavaITF-14 for JavaRM4SCC for JavaUPC-A for JavaUPC-E for Javamore
KeepAutomation provides complete barcode automation solutions. We recommend the customers use high quality document controls: ASP.NET Document Viewer, ASP.NET MVC Document Viewer, Document Viewer ASP.NET C#, ASP.NET PDF Viewer, ASP.NET Word Viewer, ASP.NET Excel Viewer, ASP.NET PDF Editor, MVC PDF Viewer, ASP.NET Annotate PDF, c# pdf sdk, C# View, edit PDF online , C# Convert PDF to Tiff, C# Convert PDF to text, txt, .net imaging sdk, C# PDF metadata edit from RasterEdge.com.