---
title: "How to generate data matrix 2d bar code for c#"  
description: "How to generate data matrix 2d bar code for c#"  
author: "Abeer Shlby"  
published: 2017-04-24  
updated: 2017-05-09  
canonical: https://www.mindstick.com/forum/34285/how-to-generate-data-matrix-2d-bar-code-for-c-sharp  
category: "c#"  
tags: ["c#"]  
reading_time: 2 minutes  

---

# How to generate data matrix 2d bar code for c#

I work in [windows](https://www.mindstick.com/articles/311752/how-to-install-and-use-the-google-wifi-software-on-a-windows-or-mac-computer) form in [visual studio](https://www.mindstick.com/articles/12378/visual-studio-for-mac-is-out-of-beta-preview-now-officially-available) 2015 using [c# Language](https://www.mindstick.com/forum/157570/how-to-use-face-recognition-in-c-sharp-language-for-attendance-register-software) And I need to generate data matrix to name and phone and address So that how to do that please using data matrix [barcode](https://answers.mindstick.com/qa/49796/what-is-barcode-and-how-can-use-it) 2d without using Commercial [library](https://www.mindstick.com/forum/34615/software-framework-vs-library) Are there are any [open source](https://www.mindstick.com/articles/337437/how-to-leverage-open-source-for-innovative-project-development) or free library can I use it to generate data matrix 2d Barcode for name and phone and address? I can do it by qr [message](https://www.mindstick.com/forum/12802/show-confirmation-message-yes-or-no-in-asp-dot-net) [toolkit](https://www.mindstick.com/blog/296655/effective-strategies-for-salesforce-migration-and-force-com-migration-toolkit) library But data matrix what I can use which library or [c# code](https://www.mindstick.com/forum/403/how-to-export-data-in-excel-file-from-sql-server-using-c-sharp-code) I use for generating?

## Replies

### Reply by Friend HRM

You can probably try this free barcode api to geFree Payroll Software for Malaysianerate 2d Data Matrix barcode

```
BarcodeSettings settings = new BarcodeSettings();settings.Type = BarCodeType.DataMatrix;settings.Unit = GraphicsUnit.Pixel;settings.ShowText = false;settings.ResolutionType = ResolutionType.UseDpi;settings.X = 5f;settings.Data = "Name:Payu
& ...";BarCodeGenerator generator = new
BarCodeGenerator(settings);Image image = generator.GenerateImage();image.Save("2DDataMatrix.png");
```

\

\

\

\

\

### Reply by veena raju

There is [ZXing.NET](https://github.com/micjahn/ZXing.Net) library, a port of [zxing](https://github.com/zxing/zxing), which supports several barcode formats, including Data Matrix.

A very basic usage example:

```
var writer = new ZXing.BarcodeWriter { Format = ZXing.BarcodeFormat.DATA_MATRIX };
System.Drawing.Bitmap bitmap = writer.Write("test data");
```

```
ISO certification|ISO 9001 certification
```


---

Original Source: https://www.mindstick.com/forum/34285/how-to-generate-data-matrix-2d-bar-code-for-c-sharp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
