Home >
Barcode in C# >
2D >
Data Matrix
Raster Edge provides a variety of solutions that print graphic Data Matrix image using Visual C#.NET. .NET Winforms, Web applications, and applications on Windows OS and Mac OS X could be integrated with customized Data Matrix barcode images easily. Data Matrix specifications including ECC200, ECC000-400, Department of Defense UID, ANSI/AIM C11, ISO/IEC 16022, ISO/IEC 15434, and MIL-STD-130 could be generated using C#.NET.
Related .net document control helps:
asp.net word document viewer: ASP.NET Office Word Document Viewer: view Word doc files online using C# in ASP.NET MVC web applications
sharepoint document viewer: ASP.NET SharePoint Document Viewer: view, annotate, redact documents in SharePoint
asp.net mvc text file viewer: ASP.NET Text file viewer in MVC, WebForms: Open, view, annotate, convert txt files in C# ASP.NET
asp.net edit pdf image:
ASP.NET PDF Image Edit Control: online insert, edit PDF images in C#
asp.net pdf document viewer: ASP.NET PDF Document Viewer in C#: open, display, view, annotate, redact Adobe PDF files online in ASP.NET MVC & WebForm...
asp.net ppt viewer: ASP.NET PowerPoint Document Viewer Control (MVC & WebForms): view ppt, pptx files online in C# using ASP.NET
asp.net annotate pdf:
ASP.NET Annotate PDF Control: annotate, comment, markup PDF document online using ASP.NET C#
Data Matrix is a 2D barcode symbology that could be used as a single symbol or structured append set of DataMatrix symbols. The Data Matrix symbols are used in many industrial applications as labels and letters. They can be read quickly by barcode scanners.
Data Matrix in C#.NET - Overview
- Generate single Data Matrix and structured append symbols set using Visual C#.NET
- Designed for ASP.NET and Window application development
- Create graphic Data Matrix barcode images for Class Library, Console Application, as well as Control Library
- Could be used to stream quality Data Matrix barcode images in web pages
- Server reports and client reports are supported
- Compatible with ISO / IEC 16022 (2nd edition 2006-09-15)
Data Matrix Generation - Sample Code in Visual C# .NET
using RasterEdge.Barcode.Bean;
//Create BarCode object to print Data Matrix using C#
BarCode datamatrix= new BarCode();
//Set barcode symbology type to Data Matrix
datamatrix. Symbology = Symbology. DataMatrix;
//Data Matrix encoding valid input: All ASCII characters, including 0-9, A-Z, a-z, special
characters like dash, dollar, percentage, space, point, slash, plus, etc. Length: variable.
datamatrix.CodeToEncode = "C#DataMatrixGenerator";
//Data Matrix data mode, supporting ASCII, Auto, Base256, C40, Edifact, Text, X12.
datamatrix. DataMatrixDataMode = QRCodeDataMode.Auto;
datamatrix DataMatrixFormatMode = DataMatrixFormatMode . FM_10*10;
//Set Data Matrix image size
datamatrix.BarcodeUnit = BarcodeUnit.Pixel; // Unit of measure, support pixel, cm and inch.
datamatrix.DPI = 72; // Data Matrix image resolution in dpi
datamatrix.X = 3; // Data Matrix bar module width (X dimention)
datamatrix.Y = 3; // Bar module height (Y dimention), Y=X
datamatrix.LeftMargin = 12; // Image left margin size, min value is 4X.
datamatrix.RightMargin = 12; // Image right margin size, min value is 4X.
datamatrix.TopMargin = 12; // Image top margin size, mini value is 4X.
datamatrix.BottomMargin = 12; //Image bottom margin size, mininum is 4X.
datamatrix.Orientation = Orientation.Degree0;// Orientation, 90, 180, 270 degrees supported.
//Set Data Matrix human readable text style
datamatrix.DisplayText = true; // Display human readable text
datamatrix.TextFont = new Font("Arial", 10f, FontStyle.Regular);
datamatrix.TextMargin = 6; // Space between barcode and text
//Generate Data Matrix barcodes in GIF image format
datamatrix.generateBarcodeToImageFile("barcode-datamatrix-csharp.gif");
//Create Data Matrix barcodes in Stream object
datamatrix.generateBarcodeToStream(".NET System.IO.Stream Object");
//Draw & Print Data Matrix barcodes to Graphics object
datamatrix.generateBarcodeToGraphics(".NET System.Drawing.Graphics Object");
//Generate Data Matrix barcodes & write to byte[]
byte[] barcodeInBytes = datamatrix.generateBarcodeToByteArray();
//Generate Data Matrix barcodes & encode to System.Drawing.Bitmap object
Bitmap barcodeInBitmap = datamatrix.generateBarcodeToBitmap();
Other image formats including PNG, BMP, TIFF and JPG are also available to suit your needs.