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


Create, Draw, Generate, Print Data Matrix in .NET, ASP.NET, C#, VB.NET applications


  • Generate Data Matrix Barcodes in C#, VB.NET class & console applications
  • Generate Data Matrix in ASP.NET web applications
  • Generate Data Matrix in .NET Windows Forms applications
  • Generate Data Matrix in Reporting Service & Crystal Reports
  • Compatible with ISO / IEC 16022 (2rd edition 2006-09-15)
  • High quality Data Matrix Bar Code images in GIF, PNG, JPEG & BITMAP
  • Completely developed in C#.NET
  • Mature Data Matrix barcode generating components used by 1000+ clients


Index
 

.NET Barcode Data Matrix Generator Introduction

Generating Barcode Data Matrix in .NET is one of the functions in OnBarcode's .NET Barcode Generators, which supports creating & printing Data Matrix and 30+ other linear & 2D bar codes for C#, VB.NET & ASP.NET applications.

OnBarcode develops several .NET Barcode Generation components for different .NET development environments:

Barcode Generation in ASP.NET - Creating barcodes in ASP.NET Web applications
Barcode Generation in Windows Forms - Printing barcodes in C#, VB.NET Windows Forms applications
Barcode Generation in Reporting Service - Drawing barcodes in Microsoft Reporting Service 2005 & 2008

 

.NET Data Matrix Generator - Barcode Data Matrix Introduction

Data Matrix is a two-dimensional matrix barcode consisting of black and white "cells" or modules arranged in either a square or rectangular pattern. The information to be encoded can be text or raw data. Usual data size is from a few bytes up to 2 kilobytes. The length of the encoded data depends on the symbol dimension used. Error correction codes are added to increase symbol strength: even if they are partially damaged, they can still be read. A Data Matrix symbol can store up to 2,335 alphanumeric characters.

 

.NET Data Matrix Generation - Data Matrix Valid Data Scope

.NET Data Matrix Generator encodes:



 

How to generate & print Data Matrix in Visual Studio C# or VB.NET class?

Generating barcode Data Matrix in C# Class example (C# Source Code to Create Data Matrix barcodes)

	        DataMatrix datamatrix = new DataMatrix();
	        datamatrix.Data = "0123456789";
	        datamatrix.X = 3;
	        
	        // Generate Data Matrix and encode barcode to gif format
	        datamatrix.Format = ImageFormat.Gif;
	        datamatrix.drawBarcode("c#-datamatrix.gif");
	        
	        // Print Data Matrix to C# Bitmap object
	        Bitmap datamatrixBitmap = datamatrix.drawBarcode();


Generating barcode Data Matrix in VB.NET Class example

	        Dim datamatrix As OnBarcode.Barcode.DataMatrix
	        datamatrix = New OnBarcode.Barcode.DataMatrix()
	        datamatrix.Data = "0123456789"
	        datamatrix.X = 3
	        
	        // Generate Data Matrix and encode barcode to png format
	        datamatrix.Format = ImageFormat.Png
	        datamatrix.drawBarcode("vbnet-datamatrix.png")
	        
	        // Print Data Matrix to vb.net Bitmap object
	        Dim datamatrixBitmap As Bitmap
	        datamatrixBitmap = datamatrix.drawBarcode();


Data Matrix Barcode

 

How to create & draw Data Matrix image in ASP.NET aspx or html pages without ASP.NET Barcode Controller?

 

How to create & encode barcode Data Matrix to image file (GIF, JPEG, PNG, BMP)?

Creating barcode Data Matrix in C# Class example

	        DataMatrix datamatrix = new DataMatrix();
	        datamatrix.Data = "0123456789";
	        
	        // Create Data Matrix and encode barcode to Jpeg format
	        datamatrix.Format = ImageFormat.Jpeg;
	        datamatrix.drawBarcode("C://csharp-datamatrix.jpg");


Creating barcode Data Matrix in VB.NET Class example

	        Dim datamatrix As OnBarcode.Barcode.DataMatrix
	        datamatrix = New OnBarcode.Barcode.DataMatrix()
	        datamatrix.Data = "0123456789"
	        
	        // Create Data Matrix and encode barcode to Jpeg format
	        datamatrix.Format = ImageFormat.Jpeg
	        datamatrix.drawBarcode("C://vbnet-datamatrix.jpg")
 

In Visual Studio C# & VB.NET, how to draw & print barcode Data Matrix to .NET Graphics, Stream & Bitmap objects?

To draw & print barcode Data Matrix to C# objects:

	        public void drawBarcode(Graphics graphics);
	
	        public void drawBarcode(string filename);
	
	        public Bitmap drawBarcode();
	
	        public void drawBarcode(Stream fileStream);


To draw & print barcode Data Matrix to VB.NET objects:

	        Public Sub drawBarcode(ByRef graphics As Graphics)
	
	        Public Sub drawBarcode(ByVal filename As String)
	
	        Public Function drawBarcode() As Bitmap
	
	        Public Sub drawBarcode(ByRef fileStream As Stream)

 

Generating & printing barcode Data Matrix using .NET Barcode WinForms Controller

  1. Add OnBarcode.Barcode.WinForms.dll to .net project reference

  2. Add .NET Barcode to .NET Visual Studio Toolbox

    1. Right click .NET Visual Studio Toolbox, select menu Choose Items...

    2. In "Choose Toolbox Items" form, click button "Browse...", and select dll OnBarcode.Barcode.WinForms.dll

    3. After selection, you will find four items under "Components" section: LinearWinForm, DataMatrixWinForm, PDF417WinForm, and QRCodeWinForm.
 

Creating & drawing barcode Data Matrix using ASP.NET Barcode Web Form Controller

  1. Add OnBarcode.Barcode.ASPNET.dll to asp.net project reference

  2. Add .NET Barcode to .NET Visual Studio Toolbox

    1. Right click .NET Visual Studio Toolbox, select menu Choose Items...

    2. In "Choose Toolbox Items" form, click button "Browse...", and select dll OnBarcode.Barcode.ASPNET.dll

    3. After selection, you will find four items under "Components" section: LinearWebForm, DataMatrixWebForm, PDF417WebForm, and QRCodeWebForm.


 

.NET Data Matrix Generator - Barcode Properties


Category Class Properties WebStream Properties Default Comments
Basic Data DATA "DataMatrix" value to encode
 
Data Matrix
Special
ProcessTilde PROCESS-TILDE true Set the ProcessTilde property to true, if you want use the tilde character "~" to specify special characters in the input data. Default is true.
  • ~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
DataMode DATA-MODE DataMatrixDataMode.
ASCII (1)
Set the DataMode property.
Valid values are:
DataMatrixDataMode.Auto (0),
DataMatrixDataMode.ASCII (1),
DataMatrixDataMode.C40 (2),
DataMatrixDataMode.Text (3),
DataMatrixDataMode.X12 (4),
DataMatrixDataMode.Edifact (5),
DataMatrixDataMode.Base256 (6),
DataMatrixDataMode.Customer (7)
  • 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".
FormatMode FORMAT-MODE DataMatrixFormatMode.
Format_10X10 (0)
Default is DataMatrixFormatMode.Format_10X10 (0). Specifies the Data Matrix Format to use on that symbology. Valid values see class DataMatrixFormatMode.Format_*x*;
FNC1 FNC1 FNC1.FNC1_NONE (0) valid values are:
FNC1.FNC1_NONE (0),
FNC1.FNC1_1ST_POS (1),
FNC1.FNC1_2ND_POS (2)
ApplicationIndicator AI 0 -
StructuredAppend STRUCTURED-APPEND false Set StructuredAppend property to true, then Structured Append is enabled.
SymbolCount SYMBOLE-COUNT 0 Set SymbolCount property to the number of total symbols which make the sequence.
SymbolIndex SYMBOL-INDEX 0 Set SymbolIndex property to the position of current symbol in the secuence (Start with 0).
FileId FILE-ID 0 Set FileId property to be identified to the same file.
 
Size Related UOM UOM UnitOfMeasure.PIXEL (0) Unit of meature for all size related setting in the library.
Valid values:
UnitOfMeasure.PIXEL (0),
UnitOfMeasure.CM (1),
UnitOfMeasure.INCH (2)
X X 3 barcode module width and height, default is 3 pixel
BarcodeWidth BARCODE-WIDTH 0 barcode image width
BarcodeHeight BARCODE-HEIGHT 0 barcode image height
LeftMargin LEFT-MARGIN 0 image left margin
RightMargin RIGHT-MARGIN 0 image right margin
TopMargin TOP-MARGIN 0 image top margin
BottomMargin BOTTOM-MARGIN 0 image bottom margin
Resolution RESOLUTION 72 in DPI
Rotate ROTATE Rotate.Rotate0 (0) valid values:
Rotate.Rotate0 (0),
Rotate.Rotate90 (1),
Rotate.Rotate180 (2),
Rotate.Rotate270 (3)
 
In WebStream query string, please use int value for Enums, "true" and "false" for bool.



All .NET Barcode Generator Supporting Bar Code Types