3.1. Concept

DataMatrix Fontware simplifies the programming by breaking data matrix creation into two distinct process - encoding and rendering. If you are using our fonts for the rendering you do not need to learn how to draw the cells. Instead, you concentrate on getting the correct encoding results.

The encoding result is a two dimensional string array consisting of multiple rows. Because we are dealing with strings, each row consists of a line of text. The line feed string separates two adjacent lines. On Windows, the line feed string consists of two control characters, expressed as \r\n in C language, and vbCrLf in Visual Basic. In ASCII values, they are control character 10 followed by character 13.

Data matrix encoder API has three parameters: the data encoded, the target size and line feed string. The data encoded is expressed in an ASCIIZ string. An ASCIIZ string ends with a special control character NULL (ASCII value 0). Data matrix allows escaping control characters and data matrix specific characters using a special format. See Chapter 7, Input format for entering special characters and accessing advanced features for the details about the input format on advanced features. The target size is an integer representing the data matrix size you requested, as in the table Table 1.1, “Data matrix sizes”.

Data matrix encoder is packaged into a DLL called mrvDMFEAX3.dll, located under the program folder. This DLL provides both COM and plain DLL interface to client applications. Other binaries, such as the encoder GUI and Crystal Reports UFL, call this DLL at the back scene.

Programming environments usually allows direct access to COM objects and DLLs. Some may require a thin wrapper. For example, if you are working in Access, you need to write a VBA function to wrap the COM object method. To work with Crystal Reports, you need to call the UFL function we provided instead. Although the UFL dll is a separate file, it also calls the encoder ActiveX object at the back scene. We will wrap these two topics in the following chapters.