Barcoding  >  .NET Barcode for C# on WinForms  >  C# Barcode Generator


C# Barcode Generation Tutorial

How to generate linear & 2D barcodes in C#.NET projects?

C#.NET Barcode Generator offers the most affordable .NET barcode generator for barcode .NET professionals.


How to generate linear (1D) barcodes in C#.NET Class?

The following C# .NET code illustrates how to generate a linear barcode in C# class:

using KeepDynamic.Barcode.Generator;

// Create linear barcode object in C#
BarCode barcode = new BarCode();

// Set barcode symbology type to Code-128 in C#
barcode.SymbologyType = SymbologyType.Code128;

// Set barcode value in C#
barcode.CodeText = "Code128";

// Set barcode drawing image format to PNG in C#
barcode.Format = ImageFormat.Png;

// Generate barcode & encode to the png image in C#
barcode.drawBarcode("C://barcode-code128-csharp.png");
  
// Generate barcode & print to System.Drawing.Graphics object in C#
barcode.drawBarcode("Graphics object");
 
// Create barcode & draw to System.IO.Stream object in C#
barcode.drawBarcode("Stream object");


How to generate Data Matrix barcodes in C#.NET Class?

The following C# .NET code illustrates how to generate a Data Matrix barcode in C# class:

using KeepDynamic.Barcode.Generator;

// Create Data Matrix barcode object in C#
DataMatrix barcode = new DataMatrix();

// Set Data Matrix barcode value in C#
barcode.CodeText = "Data Matrix in C#";

// Set Data Matrix drawing image format to PNG in C#
barcode.Format = ImageFormat.Png;

// Generate Data Matrix barcode & encode to the png image in C#
barcode.drawBarcode("C://barcode-datamatrix-csharp.png");
  
// Generate Data Matrix barcode & print to System.Drawing.Graphics object in C#
barcode.drawBarcode("Graphics object");
 
// Create Data Matrix barcode & draw to System.IO.Stream object in C#
barcode.drawBarcode("Stream object");


How to generate PDF-417 barcodes in C#.NET Class?

The following C# .NET code illustrates how to generate a PDF-417 barcode in C# class:

using KeepDynamic.Barcode.Generator;

// Create PDF417 barcode object in C#
PDF417 barcode = new PDF417();

// Set PDF-417 barcode value in C#
barcode.CodeText = "PDF417 in C#";

// Set PDF-417 drawing image format to PNG in C#
barcode.Format = ImageFormat.Png;

// Generate PDF-417 barcode & encode to the png image in C#
barcode.drawBarcode("C://barcode-pdf417-csharp.png");
  
// Generate PDF-417 barcode & print to System.Drawing.Graphics object in C#
barcode.drawBarcode("Graphics object");
 
// Create PDF-417 barcode & draw to System.IO.Stream object in C#
barcode.drawBarcode("Stream object");


How to generate QR-Code barcodes in C#.NET Class?

The following C# .NET code illustrates how to generate a QR-Code barcode in C# class:

using KeepDynamic.Barcode.Generator;

// Create QR-Code barcode object in C#
QRCode barcode = new QRCode();

// Set QR-Code barcode value in C#
barcode.CodeText = "QRCode in C#";

// Set QR-Code drawing image format to PNG in C#
barcode.Format = ImageFormat.Png;

// Generate QR-Code barcode & encode to the png image in C#
barcode.drawBarcode("C://barcode-qrcode-csharp.png");
  
// Generate QR-Code barcode & print to System.Drawing.Graphics object in C#
barcode.drawBarcode("Graphics object");
 
// Create QR-Code barcode & draw to System.IO.Stream object in C#
barcode.drawBarcode("Stream object");


Creating barcodes using .NET Barcode Generator Windows Form Control

To create barcodes in C# Windows Forms applications, do the following procedures:

  • Add KeepDynamic.BarCode.Windows.dll to your C# project reference

  • Add KeepDynamic.BarCode.Windows.dll to windows project toolbox

  • Drag the one of the BarCodeControl, DataMatrixControl, PDF417Control, QRCodeControl item to your windows forms


Creating barcodes using ASP.NET Barcode Generator ASP.NET Web Form Control

To create barcodes in C# ASP.NET Web Forms applications, do the following procedures:

  • Add KeepDynamic.BarCode.AspNet.dll to your C# project reference

  • Add KeepDynamic.BarCode.AspNet.dll to windows project toolbox

  • Drag the one of the BarCodeControl, DataMatrixControl, PDF417Control, QRCodeControl item to your ASP.NET Web form pages, in your ASP.NET design view






C#.NET Barcode Generator supports most common linear (1d) and matrix (2d) bar code standards, including:

2D Barcodes Code-39 related Code-128 related Code-25 related EAN/UPC related Other Linear Barcodes
Data Matrix

PDF-417

QR-Code

Code-39

Code-93

Code-128

GS1-128/UCC/EAN-128
Code 2 of 5

Interleaved 2 of 5

ITF-14

Identcode

Leitcode

EAN-8

EAN-13

ISBN

ISSN

UPC-A

UPC-E
Codabar

Code-11

POSTNET

PLANET

USPS Intelligent Mail Barcode (OneCode)

RM4SCC

MSI Plessey