KA.Barcode for ASP.NET
How to Create & Resize Data Matrix in ASP.NET
Complete ASP.NET source code to generate, print Data Matrix images using Barcode for ASP.NET Control
  • Mature, flexible 2D Data Matrix creator SDK for ASP.NET web applications
  • Simple to integrate into Microsoft Internet Information Service (IIS)
  • Embedding dynamic linear & 2D barcodes, such as Excel UPC-E, Code 39 C#, EAN 128 ASP.NET, Codabar ASP.NET, in your applications
  • Directly drag ASP.NET 2D Data Matrix Barcode Library to ASP.NET website/ webform/ web pages
  • Provide cm, inch, and pixel as the unit of measure for multiple image printout
  • Generate, create 2D Data Matrix barcodes in square /rectangular patterns with selection of formats
  • Creating, drawing 2D Data Matrix barcodes with specified module size in webform
  • Other barcode solutions provided - barcode Java, barcode .NET, barcode ASP.NET, etc.
  • Support Data Matrix bar code implementation and adjust the width and height of the whole image
  • Thermal printer support to print accurate Data Matrix of high-quality even on low-resolution printers
ASP.NET Data Matrix barcode generation component plugin software is one barcoding function of KA.Barcode Generator for ASP.NET, a high-performance barcode generating device package that allows multiple barcodes to be created in ASP.NET website/ webform/ web service. It is easily integrated into .NET Framework and Microsoft Visual Studio. This page is a user manual to resize Data Matrix in ASP.NET project; others, please link to:
Data Matrix Barcode Structure
Data Matrix
Data Matrix barcode (a.k.a DataMatrix, Data Matrix ECC200) is constructed of:
  • Message data/Data region
  • Alignment pattern
  • Finder pattern
  • Timing pattern
  • Quiet zone on all four sides
Data Matrix Size Setting with C#, VB.NET Class in ASP.NET

Install Data Matrix Barcode Creator Control into ASP.NET Projects

  1. 1.
  2. 2.
    Add reference: Add "KeepAutomation.Barcode.Web.dll" to your ASP.NET project reference
  3. 3.
    Add to toolbox: To add BarcodeControl to your ASP.NET toolbox
Copy the C# or VB.NET barcode syntax onto you forms for Data Matrix barcoding in ASP.NET web page:
using KeepAutomation.Barcode.Bean;
BarCode barcode= new BarCode();
barcode.Symbology= KeepAutomation.Barcode.Symbology.DataMatrix;
barcode.CodeToEncode = "Data Matrix";
barcode.generateBarcodeToImageFile("C://barcode-datamatrix-csharp.gif");
Dim barcode As KeepAutomation.Barcode.Bean.BarCode = New KeepAutomation.Barcode.Bean.BarCode

barcode.Symbology= KeepAutomation.Barcode.Symbology.DataMatrix
barcode.CodeToEncode = "Data Matrix"
barcode.generateBarcodeToImageFile("C://barcode-datamatrix-vbnet.gif")

Drawing Data Matrix Barcode with Specified BarcodeUnit

BarcodeUnit (URL: barcode-unit; Default: Pixel): it is the unit measurement for all size related settings in Data Matrix barcodes. User may change it with "Pixel", "Inch" and "Cm". Replace sample code with following one to create valid Data Matrix and save as string in ASP.NET MVC projects:
barcode.BarcodeUnit = KeepAutomation.Barcode.BarcodeUnit.Pixel;
barcode.BarcodeUnit = KeepAutomation.Barcode.BarcodeUnit.Pixel
Class library. Users may get more information about QR Code barcode data, size and image settings with VB.NET demo codes below: ....
NET Suite. How to Generate QR Code in .NET Application. How to generate & print QR Code images using free demo in ASP.NET, WinForms, C#, VB.NET...
more>

Creating Data Matrix Barcode with Specific Format

DataMatrixFormatMode (URL: data-matrix-format-mode; Default: FM_12X12): it is used for setting QR Code version from 8x18 to 144x144. Replace sample code with following one:
barcode.DataMatrixFormatMode = KeepAutomation.Barcode.DataMatrixFormatMode.FM_104X104;
barcode.DataMatrixFormatMode = KeepAutomation.Barcode.DataMatrixFormatMode.FM_104X104

Generating Data Matrix with Specific Bar Width & Height

X (URL: x; Default: 1): it is the width of the narrow bar in Data Matrix barcodes

Y (URL: y; Default: 50): it is the height of bars in Data Matrix barcodes.
barcode.X = 3;
barcode.Y = 3;
barcode.X = 3
barcode.Y = 3

Printing Data Matrix with Fixed BarCodeWidth and BarCodeHeight

BarCodeWidth (URL: barcode-width; Default: 0): it is the barcode width of Data Matrix barcodes.

BarCodeHeight (URL: barcode-height; Default: 0): it is the barcode height of Data Matrix barcodes.
barcode.BarCodeWidth = 200;
barcode.BarCodeHeight = 75;
barcode.BarCodeWidth = 200
barcode.BarCodeHeight = 75

Streaming Data Matrix with Quiet Zones/ Margins

TopMargin (URL: top-margin; Default: 0): it is the barcode image top margin in Data Matrix barcodes.

BottomMargin (URL: bottom-margin; Default: 0): it is the barcode image bottom margin in Data Matrix barcodes.

LeftMargin (URL: left-margin; Default: 0): it is the barcode image left margin in Data Matrix barcodes.

RightMargin (URL: right-margin; Default: 0): it is the barcode image right margin in Data Matrix barcodes.
barcode.TopMargin = 8;
barcode.BottomMargin = 8;
barcode.LeftMargin = 6;
barcode.RightMargin = 6;
barcode.TopMargin = 8
barcode.BottomMargin = 8
barcode.LeftMargin = 6
barcode.RightMargin = 6
Data Matrix Size Setting with Drag & Drop BarcodeControl
  1. 1.
    In "Choose Toolbox Items" form, click button "Browse...", and select KeepAutomation.Barcode.Web.dll
  2. 2.
    Now you'll see BarCodeControl in your toolbox
  3. 3.
    Drag and drop the BarCodeControl into the Forms and a Codabar image is generated
  4. 4.
    Find barcode setting panel, choose "Symbology" to "DataMatrix" and write down encode data
  5. 5.
    Set "BarcodeUnit" to "Pixel", and "DataMatrixFormatMode" to "FM_40X40"
  6. 6.
    Set "X" to 3, "Y" to 3; Set "BarcodeWidth" to 200 and "BarcodeHeight" to 75
  7. 7.
    Set "TopMargin" & "BottomMargin" to 8; and set "RightMarign" & "LeftMargin" to 6
  8. 8.
    A Data Matrix barcodes with different customized size occurs
Data Matrix Size Setting in Internet Information Service (IIS)
  1. 1.
    Copy folder "barcode" in your download the trial package to your IIS web application folder
  2. 2.
    Create a virtual directory, named "barcode", and link to your just copied "barcode" folder
  3. 3.
    Restart IIS and now you have successfully installed the ASP.NET Barcode Generator web application
  4. 4.
    To test it, open your web browser, and navigate to "http://localhost/barcode/barcode.aspx?symbology=101&code-to-encode=0123456789&barcode-unit=0&data-matrix-format-mode=9&x=3&y=3&barcode-width=200&barcode-height=75&top-margin=8&bottom-margin=8&left-margin=6&right-margin=6"
  5. 5.
    A Data Matrix barcode with customized size occurs will be displayed