Table of Contents
This chapter briefly reviews the symbology (a.k.a. barcode formats) supported by DataMatrix Fonts & Encoder 5 - Data Matrix.
Data matrix is a variable-size, two-dimensional symbology capable of encoding large amount of data. The barcode consists of an array of data cells within a distinct perimeter pattern. Although it is capable of encoding 2000 characters, data matrix is best for encoding small amount of data when space is a primary concern. Data matrix is a space efficient symbology. When encoding small amount of data, it produces more compact barcodes than any other two dimensional symbologies.
The encoding process (converting data into an array of light/dark modules) is fairly complicated. First, to produce space efficient symbols, data matrix standard defines six character sets, also called encodation modes with each targeting a different kind of data. Data matrix encoder shifts the encodation mode from one to another whenever it sees that doing so will reduce the whole symbol size. Moreover, to make sure that the symbol can be read when some portions become damaged, the encoder adds additional modules for error correction purposes. The error correction algorithm by itself is not easy.
There are two types of data matrix bar codes: ECC 000-140 and ECC 200. The difference lies in the error correction algorithms they employ - the ECC 000-140 uses several levels of convolutional error correction and ECC 200 uses Reed-Solomon error correction. By employing Reed-Solomon error correction algorithm, ECC200 allows data to be successfully read, even if 60% of the data area is damaged. The most recent data matrix standard requires all new applications to use ECC 200.
Data matrix offers limited combinations between the number of rows and columns. A valid selection is called a “data matrix size”. All data matrix sizes are listed in the table below. A data matrix symbol can be any one of the 30 shapes.
Table 2.1. Data Matrix Sizes
Size ID | Symbol Size | Data Capacity | ||||
---|---|---|---|---|---|---|
Enum | Value | Row | Column | Numeric | Alphanum | Binary |
mbxDMTargetSize_10X10 | 0 | 10 | 10 | 6 | 3 | 1 |
mbxDMTargetSize_12X12 | 1 | 12 | 12 | 10 | 6 | 3 |
mbxDMTargetSize_14X14 | 2 | 14 | 14 | 16 | 10 | 6 |
mbxDMTargetSize_16X16 | 3 | 16 | 16 | 24 | 16 | 10 |
mbxDMTargetSize_18X18 | 4 | 18 | 18 | 36 | 25 | 16 |
mbxDMTargetSize_20X20 | 5 | 20 | 20 | 44 | 31 | 20 |
mbxDMTargetSize_22X22 | 6 | 22 | 22 | 60 | 43 | 28 |
mbxDMTargetSize_24X24 | 7 | 24 | 24 | 72 | 52 | 34 |
mbxDMTargetSize_26X26 | 8 | 26 | 26 | 88 | 64 | 42 |
mbxDMTargetSize_32X32 | 9 | 32 | 32 | 124 | 91 | 60 |
mbxDMTargetSize_36X36 | 10 | 36 | 36 | 172 | 127 | 84 |
mbxDMTargetSize_40X40 | 11 | 40 | 40 | 228 | 169 | 112 |
mbxDMTargetSize_44X44 | 12 | 44 | 44 | 288 | 214 | 142 |
mbxDMTargetSize_48X48 | 13 | 48 | 48 | 348 | 259 | 172 |
mbxDMTargetSize_52X52 | 14 | 52 | 52 | 408 | 304 | 202 |
mbxDMTargetSize_64X64 | 15 | 64 | 64 | 560 | 418 | 278 |
mbxDMTargetSize_72X72 | 16 | 72 | 72 | 736 | 550 | 366 |
mbxDMTargetSize_80X80 | 17 | 80 | 80 | 912 | 682 | 454 |
mbxDMTargetSize_88X88 | 18 | 88 | 88 | 1152 | 862 | 574 |
mbxDMTargetSize_96X96 | 19 | 96 | 96 | 1392 | 1042 | 694 |
mbxDMTargetSize_104X104 | 20 | 104 | 104 | 1632 | 1222 | 814 |
mbxDMTargetSize_120X120 | 21 | 120 | 120 | 2100 | 1573 | 1048 |
mbxDMTargetSize_132X132 | 22 | 132 | 132 | 2608 | 1954 | 1302 |
mbxDMTargetSize_144X144 | 23 | 144 | 144 | 3116 | 2335 | 1556 |
mbxDMTargetSize_8X18 | 24 | 8 | 18 | 10 | 6 | 3 |
mbxDMTargetSize_8X32 | 25 | 8 | 32 | 20 | 13 | 8 |
mbxDMTargetSize_12X26 | 26 | 12 | 26 | 32 | 22 | 14 |
mbxDMTargetSize_12X36 | 27 | 12 | 36 | 44 | 31 | 20 |
mbxDMTargetSize_16X36 | 28 | 16 | 36 | 64 | 46 | 30 |
mbxDMTargetSize_16X48 | 29 | 16 | 48 | 98 | 72 | 47 |
The size ID parameter used by our software is an interger. If value 0-29 are passed, it indicates the encoder should create a barcode that matches the size. However, it may increase the size if the encoder finds that the size requested is too small.
In version 5.0, two additional values are supported: -1 and -2. If -1 is specified, the program selects the minimum size that meets the requirement, and searching from the rectangular shape (0~23). If -2 is specified, the program searches from the square shape (24) first. And if no square shape sizes can encode the data, it then searches all rectangular shapes.
In version 5.1 and above, the descrition above still applies. However, size ID parameter is further enhanced to allow user to specify encodation mode selection and whether the encoder should increase the size if the size is determined too small. For details, refer to Appendix C, Size ID Parameter (updated in version 5.1).
The methods to create barcodes are greatly expanded in this version. You should select one based on your working environment - Font, image or ActiveX control.
Font-based approach creates a datamatrix barcode by formatting the encoder output with data matrix font.
Note
In almost all circumstances, you can not just type your number and format with a barcode font to create a valid barcode. You must generate the barcode string first, and format the barcode string with the font.
The Font-based approach is easy to understand, and in some occasions the only way to add barcode printing functionality, such as in Crystal Reports.
The drawing below illustrates how you create a DataMatrix symbol
using
font-based approach. You first create the barcode string (which is
an array of text lines). Format the barcode string with MRV DataMatrix5
font you get the barcode.
The font characteristics are listed as below:
Table 2.2. DataMatrix Font Characteristics
Filename | Typeface | Module With (under 6 points) |
---|---|---|
mrvdatamatrix5.ttf | MRV DataMatrix5 | 20 mils (0.5mm) |
To create a valid barcode, you need to call an encoder to get a special string, and format this string with our DataMatrix font. To get this string, you need to call an encoder - you can run DataMatrix Encoder GUI, and obtain the result from this GUI program. Or if you need to bulk generate the results, using the programming interface exposed from the encoder DLL.
- DataMatrix Encoder GUI
This GUI program allows you to quickly create barcode string and transfer it to other programs. You are able to enter the data encoded, and create the barcode on the fly. For more information, see Chapter 3, Using DataMatrix Encoder GUI.
- MoroviaDataMatrixFontEncoder5.dll
This DLL is a standard Windows DLL that can be called by many programming environments, including Microsoft Office, C++, FoxPro and .Net. Most programming environments support Windows DLL directly. We provide a VBA module and a C# class that wrap around the DLL functionality.
- uflDataMatrix5.dll
This DLL is specifically designed for Crystal Reports. For more information on using the software with Crystal Reports, see Chapter 6, Adding DataMatrix to Crystal Reports.
You can export barcodes as standard image files to be consumed in other word processing and imaging programs. The DataMatrix Encoder GUI supports exporting images in four formats via a GUI interface. The Encoder DLL and DataMatrix ActiveX Control also provides programming interfaces to export images in those formats:
PNG (Portable Network Graphics)
BMP (Windows Bitmap File)
EMF (Ehanced Meta File)
SVG (Scalable Vector Graphics)
EPS (Encapsulated PostScript)
Special attention should be paid when the target printer has has low resolution, such as a thermal printer or fax machine. When generating vector graphics files, the software allows you to specify target dpi which you should set to the one that matches your printer. It is generally not recommended to scale the image down or up when working with low-resolution printers.
Many environments support ActiveX Controls, such as Microsoft Word, IE and Excel. You can insert the DataMatrix ActiveX Control into documents, spreadsheets, or invokes the control at the background in your program. Unlike standard image formats which does not contain encoding parameters, such as size and data encoded, ActiveX control keeps those info. Therefore you can change the data matrix by editing the properties.
Using ActiveX Control in Microsoft Office programs is straightforward. Programming knowledge is required in order to integrate the control with your custom programs.