.NET Barcode  >  .NET Barcode Generation Guide  >  .NET Barcode Data Matrix Generator for .NET, C#, ASP.NET, VB.NET


.NET Barcode Data Matrix Generator for .NET, C#, ASP.NET, VB.NET

.NET Barcode offers the most affordable .NET barcode generator for barcode .NET professionals.

.NET Data Matrix Introduction

Data Matrix is also known as Data Matrix, ECC200.

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.


How to generate Data Matrix barcodes in C#.NET Class?

The following C# .NET code illustrates how to generate a Data Matrix barcode in C# class:

using KeepDynamic.Barcode.Generator;

// Create Data Matrix barcode object in C#
DataMatrix barcode = new DataMatrix();

// Set Data Matrix barcode value in C#
barcode.CodeText = "Data Matrix in C#";

// Set Data Matrix drawing image format to PNG in C#
barcode.Format = ImageFormat.Png;

// Generate Data Matrix barcode & encode to the png image in C#
barcode.drawBarcode("C://barcode-datamatrix-csharp.png");
  
// Generate Data Matrix barcode & print to System.Drawing.Graphics object in C#
barcode.drawBarcode("Graphics object");
 
// Create Data Matrix barcode & draw to System.IO.Stream object in C#
barcode.drawBarcode("Stream object");




How to generate Data Matrix barcodes in VB.NET Class?

The following VB.NET code illustrates how to generate Data Matrix barcodes in VB.NET class:

// Create Data Matrix barcode object in VB.NET
Dim barcode As KeepDynamic.Barcode.Generator.DataMatrix
barcode = New KeepDynamic.Barcode.Generator.DataMatrix()

// Set Data Matrix barcode value in VB.NET
barcode.CodeText = "Data Matrix in VB.NET"

// Set Data Matrix drawing image format to PNG in VB.NET
barcode.Format = ImageFormat.Png

// Generate Data Matrix barcode & encode to the png image in VB.NET
barcode.drawBarcode("C://barcode-datamatrix-vbnet.png")
  
// Generate Data Matrix barcode & print to System.Drawing.Graphics object in VB.NET
barcode.drawBarcode("Graphics object")
 
// Create Data Matrix barcode & draw to System.IO.Stream object in VB.NET
barcode.drawBarcode("Stream object")


Creating Data Matrix barcodes using .NET Barcode Generator Windows Form Control

To create Data Matrix barcodes in Windows Forms applications, do the following procedures:

  • Add KeepDynamic.BarCode.Windows.dll to your C#, VB.NET project reference

  • Add KeepDynamic.BarCode.Windows.dll to windows project toolbox

  • Drag the DataMatrixControl item to your windows forms


Creating Data Matrix barcodes using ASP.NET Barcode Generator ASP.NET Web Form Control

To create Data Matrix barcodes in ASP.NET Web Forms applications, do the following procedures:

  • Add KeepDynamic.BarCode.AspNet.dll to your C#, VB.NET project reference

  • Add KeepDynamic.BarCode.AspNet.dll to windows project toolbox

  • Drag the DataMatrixControl item to your ASP.NET Web form pages, in your ASP.NET design view


.NET Data Matrix Barcodes Properties

Class Properties HTTP Parameters Default Comments
CodeText code-text "" Barcode value to encode
GraphicsUnit graphics-unit GraphicsUnit.Pixel Unit of meature for all size related settings. 0: pixel; 1: cm; 2: inch. Default is pixel
X x 3 Barcode module width of barcode module, default is 3 pixel
LeftMargin left-margin 0 Barcode image left margin
RightMargin right-margin 0 Barcode image right margin
TopMargin top-margin 0 Barcode image top margin
BottomMargin bottom-margin 0 Barcode image bottom margin
Resolution resolution 72 Barcode image resolution in dpi
Rotate rotate 0 Barcode rotate angle, valid values: 0, 90, 180, 270
Format format ImageFormat.Png Image format type. Using System.Drawing.Imaging.ImageFormat
ProcessTilde process-tilde false Set the processTilde property to true, if you want use the tilde character "~" to specify special characters in the input data. Default is false.
~NNN: is used to represent the ASCII character with the value of NNN. NNN is from 000 - 255.
DataMode data-mode DataMatrixDataMode.ASCII Set data matrix data mode property.
  • 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.
FormatMode format-mode DataMatrixFormatMode.FM_10X10 Default is DataMatrixFormatMode.FM_10X10. Specifies the Data Matrix Format to use on that symbology.
FNC1 fnc1 0 (none)
ApplicationIndicator application-indicator 0
StructuredAppend structure-append false If true, then Structured Append is enabled.
SymbolCount symbol-count 1 Set the number of total symbols which make the sequence.
SymbolIndex symbol-index 1 Set the position of current symbol in the secuence (Start with 0).
FileId file-id 0 Set the property to be identified to the same file.





.NET Barcode Generator supports most common linear (1d) and matrix (2d) bar code standards, including:

2D Barcodes Code-39 related Code-128 related Code-25 related EAN/UPC related Other Linear Barcodes
Data Matrix

PDF-417

QR-Code

Code-39

Code-93

Code-128

GS1-128/UCC/EAN-128
Code 2 of 5

Interleaved 2 of 5

ITF-14

Identcode

Leitcode

EAN-8

EAN-13

ISBN

ISSN

UPC-A

UPC-E
Codabar

Code-11

POSTNET

PLANET

USPS Intelligent Mail Barcode (OneCode)

RM4SCC

MSI Plessey