Generate EAN 13 Barcode in C#

This brief tutorial explains how to generate EAN 13 Barcode in C#. It covers the information about preparing the environment, stepwise algorithm, and a runnable code to create EAN 13 barcode in C#. You can export the output barcode in any of the supported image formats while writing it to the disk or a stream based on your requirements.

Steps to Generate EAN 13 Barcode in C#

  1. Prepare the application by adding Aspose.BarCode using the NuGet Package Manager plugin
  2. Specify required namespaces in the code
  3. Create an instance of BarCodeGenerator class
  4. Set the barcode encoding type for the EAN13 barcode using the EncodeTypes enumeration
  5. Save the output EAN 13 barcode

These steps encompass the details about all the required tasks to develop an EAN 13 bar code generator using C#. You need to specify the type of barcode to create and then proceed to set custom appearance properties. Finally, export the generated EAN 13 barcode as an image.

Code to Create EAN 13 Barcode using C#

This basic sample code contains a few simple API calls to make an EAN 13 generator in C#. First of all, the EncodeTypes enumerator is used to set the EAN 13 barcode format, as it also includes many other encodings like EAN-8, QR Code, Code39, Aztec, etc. You can further customize the code snippet to enable or disable the checksum, bar color, bar height, etc. along with many other properties as per your preferences.

In this tutorial, we have learned how with the help of C# barcode font EAN 13 can be created. Besides, if you are interested to learn scanning of QR codes then read the article on Scan QR Code using C#.

 English