Generate Barcodes using C# – .NET Barcode API

generate barcode using C#

Barcodes are used to visually represent the data in a machine-readable form. Most often, barcodes appear to be a means of a product’s identification. Various types of barcodes are used in different scenarios such as Code128, Code11, Code39, QR, Datamatrix, Aztec and etc. In this article, you will learn how to programmatically generate the barcodes using C#. Furthermore, you will see how to customize the appearance of a barcode.

Generate Barcodes with C# Barcode API – Free Download

Aspose.BarCode for .NET is a powerful barcode generator and scanner API that lets you generate and read a wide range of barcode symbologies including but not limited to:

  • Code128
  • Code11
  • Code39
  • QR
  • Datamatrix
  • EAN13
  • EAN8
  • ITF14
  • PDF417
  • and more.

You can download the API for free or get it installed within your .NET application using the NuGet.

PM> Install-Package Aspose.BarCode

Generate a Barcode using C#

The following are the steps to generate a barcode using Aspose.BarCode for .NET.

The following code sample shows how to generate a barcode using C#.

generate barcode in C#

Generate a QR Barcode using C#

You can generate other types of barcodes in a similar way. For the demonstration, let’s generate a QR barcode which is one of the widely used barcode symbologies. The following are the steps to generate a QR barcode.

The following code sample shows how to generate a QR barcode using C#.

generate QR barcode in C#

Customize the Appearance of a Barcode in C#

You can also customize the appearance of the barcode by changing its font, forecolor, background color, text’s color, and etc. The following are the steps to customize a barcode using Aspose.BarCode for .NET.

The following code sample shows how to generate a customized Aztec barcode using C#.

generate Aztec barcode in C#

Add Caption in Barcodes using C#

You might have seen barcodes with a caption above or below the barcode image. These captions can be used to display additional information related to the product or the barcode itself. Aspose.BarCode for .NET also allows you to add a caption below, above, or on both sides of the barcode. The following are the steps to add a caption.

The following code sample shows how to add caption in a barcode using C#.

generate barcode with caption in C#

Conclusion

In this article, you have learned how to generate barcodes programmatically using C#. In addition, you have seen how to customize a barcode by modifying its appearance. You can explore more about the C# barcode generator API using documentation.

See Also