Search results

Data Matrix generator in ASP.NET Core Barcode control

Data Matrix

DataMatrix Barcode is a two dimensional barcode that consists of a grid of dark and light dots or blocks forming square or rectangular symbol. The data encoded in the barcode can either be numbers or alphanumeric. They are widely used in printed media such as labels and letters. You can read it easily with the help of a barcode reader and mobile phones.

tagHelper
datamatrixgenerator.cs
<ejs-datamatrixgenerator id="container" width="200px" height="150px" value="Syncfusion" mode="SVG"></ejs-datamatrixgenerator>
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Syncfusion.EJ2.BarcodeGenerator;

namespace EJ2CoreSampleBrowser.Controllers.Barcode
{
    public partial class BarcodeController : Controller
    {
        
        public ActionResult datamatrix()
        {
           
             return View();
        }
    }
}

Customizing the Barcode color

A page or printed media with barcode often appears colorful in the background and surrounding region with other contents. In such cases the barcode can also be customized to suit the needs. You can achieve this by using the forecolor property .

tagHelper
color.cs
<ejs-datamatrixgenerator id="container" width="200px" height="150px" value="Syncfusion" foreColor="red" mode="SVG">
</ejs-datamatrixgenerator>
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Syncfusion.EJ2.BarcodeGenerator;

namespace EJ2CoreSampleBrowser.Controllers.Barcode
{
    public partial class BarcodeController : Controller
    {
        
        public ActionResult datamatrix()
        {
           
             return View();
        }
    }
}

Customizing the Barcode dimension

The dimension of the barcode can be changed using the height and width property of the barcodegenerator.

tagHelper
dimension.cs
<ejs-datamatrixgenerator id="container" width="300px" height="300px" value="Syncfusion" foreColor="red" mode="SVG"></ejs-datamatrixgenerator>
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Syncfusion.EJ2.BarcodeGenerator;

namespace EJ2CoreSampleBrowser.Controllers.Barcode
{
    public partial class BarcodeController : Controller
    {
        
        public ActionResult datamatrix()
        {
           
             return View();
        }
    }
}

Customizing the text

In barcode generators you can customize the barcode text by using the display text property .

tagHelper
text.cs
<ejs-datamatrixgenerator id="container" width="300px" height="300px" value="Syncfusion" foreColor="red" mode="SVG">
  <e-datamatrixgenerator-displaytext visibility="false"></e-datamatrixgenerator-displaytext>
  </ejs-datamatrixgenerator>
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Syncfusion.EJ2.BarcodeGenerator;

namespace EJ2CoreSampleBrowser.Controllers.Barcode
{
    public partial class BarcodeController : Controller
    {
        
        public ActionResult datamatrix()
        {
           
             return View();
        }
    }
}