BizCode Barcode Generator for ASP.NET
The most professional barcode solutions for Microsoft ASP.NET
Quick Overviews
  • Barcode creating class library
  • Support ASP.NET IDEs & IIS
  • Easy to use & integrate
  • Dynamic barcodes support
  • High-usability controls provided
How to Generate Data Matrix images in ASP.NET
ASP.NET Data Matrix Barcode Generator DLLallows users to create, render high-quality Data Matrix barcodes in ASP.NET programs without using Barcode Font. Those generated Data Matrix barcode symbol can be output on low resolution barcode printers as well as on high resolution barcode printers.
This document explains how to set Data Matrix barcode image in ASP.NET, IIS and other tutorials of Data Matrix data encoding and size setting:
Data Matrix Image Related Properties

GS1 Data Matrix

Barcode Generator for ASP.NET provides FNC1Mode class for users, if they want to make GS1 compatible Data Matrix barcodes.

Structure Append

Barcode Generator for ASP.NET provides StrutureAppend class for users, if they want to reconstruct up to 16 Data Matrix symbols into a format one.

Barcode Resolution

Barcode Generator for ASP.NET provides Resolution class for users, if they want to set the Data Matrix barcode images resolution in DPI according to their custom settings.

Barcode Rotation

Barcode Generator for ASP.NET provides Rotate class for users, if they want to rotate their Data Matrix barcode images into any angle of 0, 90, 180 and 270 degrees.

Image Formats

Barcode Generator for ASP.NET provides ImageFormat class for users to save the barcode images to most of the popular image formats, such as Png, Jpeg/Jpg, Gif, Tiff, Bmp, etc.

ASP.NET Graphic Objects

Barcode Generator for ASP.NET provides DrawBarcode method for users, if they want to save Data Matrix barcode images into ASP.NET Graphics, Stream and Bitmap objects.
Customize Data Matrix Barcode Images in ASP.NET & IIS
Be sure that you have installed those following programs onto your computers:
  • Microsoft .NET Framework 2.0/3.0/4.0
  • Microsoft Visual Studio 2005/2008/2010 (Express, Professional & Standard Edition)
  • Microsoft Internet Information Service (IIS)
  • Barcode Generator for ASP.NET installed
Customize Data Matrix Barcode Images in ASP.NET Web Forms Using BarcodeControl
  1. Add ASP.NE Barcode Control onto your .NET Visual Studio Toolbox;
  2. Drag and drop the WebDataMatrix control into the Forms;
  3. Run the website and you will see a barcode image generated;
  4. Go to Address bar and change your URL with following one: http://localhost/br_barcode/datamatrix.aspx?code=0123456789&dpi=104&rotate=1&fnc1-mode=1;
  5. Then a Data Matrix with customized image occurs.
Customize Data Matirx Barcode Images in ASP.NET Using C#, VB.NET class
using BusinessRefinery.Barcode;

DataMatrix barcode = new DataMatrix();
barcode.Code = "0123456789";

// Change Data Matrix resolution in DPI
barcode.Resolution = 104;

// Rotate Data Matrix barcode image
barcode.Rotate = Rotate.Rotate180;

// Create GS1 compatible Data Matrix barcode
barcode.FNC1Mode = FNC1.FNC1_1ST_POS;
// Save Data Matrix in multiple image formats
barcode.Format = ImageFormat.Gif;
barcode.drawBarcode2ImageFile("c:/data-matrix-csharp.gif");

// Save Data Matrix barcode in ASP.NET objects
public void drawBarcode2ImageFile(string filename);
public void drawBarcode2Stream(Stream fileStream);
public byte[] drawBarcodeAsBytes();
public Bitmap drawBarcodeOnBitmap();
public void drawBarcodeOnGraphics(Graphics graphics);

// Generate Mutilpe Data Matrix barcode with Structure Append
barcode.StructureAppend = true;
barcode.SymbolCount = 3;
barcode.SymbolIndex = 0;
barcode.Parity = 10;
barcode.SymbolCount = 3;
barcode.SymbolIndex = 1;
barcode.Parity = 10;
barcode.SymbolCount = 3;
barcode.SymbolIndex = 2;
barcode.Parity = 10;
Dim barcode As BusinessRefinery.Barcode.DataMatrix = 
New BusinessRefinery.Barcode.DataMatrix()
barcode.Code = "0123456789"

' Change Data Matrix resolution in DPI
barcode.Resolution = 104

' Rotate Data Matrix barcode image
barcode.Rotate = Rotate.Rotate180

' Save Data Matrix in multiple image formats
barcode.Format = ImageFormat.Gif
barcode.drawBarcode2ImageFile("c:/data-matrix-vb-net.gif")

' Save Data Matrix barcode in ASP.NET objects
Public Sub drawBarcode2Stream(ByVal fileStream As System.IO.Stream)
Public Sub drawBarcodeOnGraphics(ByVal graphics As
System.Drawing.Graphics)
Public Function drawBarcodeAsBytes() As Byte()
Public Function drawBarcodeOnBitmap() As System.Drawing.Bitmap

' Generate Mutilpe Data Matrix barcode with Structure Append
barcode.StructureAppend = true
barcode.SymbolCount = 3
barcode.SymbolIndex = 0
barcode.Parity = 10
barcode.SymbolCount = 3
barcode.SymbolIndex = 1
barcode.Parity = 10
barcode.SymbolCount = 3
barcode.SymbolIndex = 2
barcode.Parity = 10
Customize Data Matirx Barcode Images in Internet Information Service (IIS)
  1. Download Barcode Generator for ASP.NET and unzip;
  2. Copy the whole barcode fold and contents into IIS and create a new virtual directory called "br_barcode";
  3. Restart IIS, navigate to
    http://localhost/br_barcode/datamatrix.aspx?code=0123456789&dpi=104&rotate=1&fnc1-mode=1
  4. Add an image tag <img> into the web page to create Data Matrix barcode image in html or aspx pages, e.g.
    <img src="http:'localhost/br_barcode/datamatrix.aspx?code=0123456789&dpi=104&rotate=1&fnc1-mode=1"/>.