Generate EAN Barcode in C#

EAN barcode is also known as European Article Number. There are different variations of EAN codes that contain supplement data as additional digits. This article covers how to create an EAN code programmatically in C#. Moreover, it guides you on how to append supplement digits with the EAN 13 code to make it EAN 5 barcode.

C# API to Generate EAN Barcode - Free Download

Aspose.BarCode for .NET supports working with various types of barcodes. You can easily configure the API by downloading its reference DLL files from the Downloads page or use the NuGet package manager to install it with all the dependencies if any.

PM> Install-Package Aspose.BarCode

Create EAN 13 Barcode in C#

You need to follow the steps below to create EAN 13 barcode:

  1. Create an instance of BarcodeGenerator class and set the EncodeType to EAN13.
  2. Set the size in pixels.
  3. Save the generated EAN code as an image.

The following code snippet demonstrates how to create an EAN 13 barcode in C#:

Generate EAN 5 with Supplement Data in C#

The following steps show how to generate an EAN code with supplement data in C#.

  1. Initialize an object of BarcodeGenerator class and specify the EncodeType.
  2. Set the supplement space and EAN 5 supplement data.
  3. Export the output EAN barcode as any image format like JPG, PNG, BMP, etc.

The code snippet below elaborates how to generate EAN 5 code with supplement data programmatically in C#:

The screenshot below shows the output EAN 5 barcode with supplement data:

Generate EAN 5 in C#

Get a Free License

You may request a free temporary license in order to evaluate the features of the API without any limitations.

Conclusion

In this article, you have learned how to create an EAN 13 code programmatically in C#. Likewise, it also explains how to append supplement data as additional digits to generate EAN 5 barcode in C#. Moreover, you may take a look at the documentation space to learn working with various other barcode types. Please feel free to write to us at forum in case you need to discuss any of your queries.

See Also