Home  >  .NET Barcode Generator Suite  >  .NET Barcode Generation Guide  >  How to Create EAN-13 Barcode in .NET Application
.NET EAN-13 Barcode Generator Library for C# & VB.NET
EAN-13 .NET Barcode Generator Librar offers the most affordable .NET barcode generator for barcode .NET professionals. It supports generating & creating EAN-13 linear barcode images in .NET project, ASP.NET web application and Windows Forms project. Besides, this .NET EAN-13 barcoding library also supports .NET preferred programming languages, like C# and VB.NET.
.NET EAN-13 Barcode Introduction
EAN-13 is also known as European Article Number 13, EAN-13 Supplement 5/Five-digit Add-On, EAN-13 Supplement 2/Two-digit Add-On, EAN-13+5, EAN-13+2, EAN13, EAN13+5, EAN13+2, UPC-13, GTIN-13, GS1-13, EAN/UCC-13.
A European Article Number (EAN) is a barcoding standard which is a superset of the original 12-digit Universal Product Code (UPC) system developed in North America. The EAN-13 barcode is defined by the standards organisation GS1. It is also called a Japanese Article Number (JAN) in Japan. UPC, EAN, and JAN numbers are collectively called Global Trade Item Numbers (GTIN), though they can be expressed in different types of barcodes.
How to Generate EAN-13 Barcode Images in .NET Windows Forms Project?
This .NET EAN-13 barcode generating library can help .NET developers create EAN-13 barcode images in Windows Forms project without using any C# or VB.NET class codes.
  1. Add KeepDynamic.BarCode.Windows.dll to your Windows Forms project reference
  2. Add KeepDynamic.BarCode.Windows.dll to windows project toolbox
  3. Drag & drop the BarCodeControl item from Visual Studio toolbox to your windows forms project
  4. Click generated barcode image, adjust its SymbologyType to EAN13 and enter a 12-digit data string at CodeText in the Properties window
How to Generate & Create EAN-13 Barcode Images in ASP.NET Web Application?
  1. Add KeepDynamic.BarCode.AspNet.dll to your ASP.NET web project reference
  2. Add KeepDynamic.BarCode.AspNet.dll to ASP.NET web project toolbox
  3. Copy "linear.aspx", "linear.aspx.cs" from folder barcode to your ASP.NET project
  4. Drag the BarCodeControl item from toolbox to your ASP.NET Web form pages. Then you will see a barcode image being generated
  5. Select created barcode image, adjust its SymbologyType to EAN13 and enter a 12-digit data string at CodeText in the Properties window
  6. Run your ASP.NET web project and view generated EAN-13 barcode images
How to Generate & Create EAN-13 Barcodes using C#.NET Class?
// generate linear barcode object 
BarCode barcode = new BarCode();

// Set barcode type to EAN13
barcode.SymbologyType = SymbologyType.EAN13;

// Enter 12-digit data string
barcode.CodeText = "123456789123";

// set EAN13 barcode image settings
// Set bar width of EAN13
barcode.X = 2;

// set EAN13 barcode image
barcode.BarCodeWidth = 250;
barcode.BarCodeHeight = 90;

// save generated barcode images to png image file using C#
barcode.drawBarcode("C://kdean13.png");
Here are more free C# code for generating & creating EAN-13 barcode images in .NET applications
How to Generate & Create EAN-13 Barcodes using VB.NET Class?
' generate linear barcode object 
Dim barcode As New BarCode()

' Set barcode type to EAN13
barcode.SymbologyType = SymbologyType.EAN13

' Enter 12-digit data string
barcode.CodeText = "123456789123"

' set EAN13 barcode image settings
' Set bar width of EAN13
barcode.X = 2

' set EAN13 barcode image
barcode.BarCodeWidth = 250
barcode.BarCodeHeight = 90

' save generated barcode images to png image file using VB.NET
barcode.drawBarcode("C://kdean13.png")
Here are more free VB.NET code for generating & creating EAN-13 barcode images in .NET applications
.NET EAN-13 Barcodes Properties

Barcode properties HTTP Parameters Default Comments
EAN13 specific properties SymbologyType symbology-type Code128 Type of barcode symbology.

Set barcode type symbology to EAN 13 using the value:
  • SymbologyType.EAN13 (14),
  • SymbologyType.EAN13_2 (15),
  • SymbologyType.EAN13_5 (16)
CodeText code-text "123456789012" The data message to be encoded into a barcode symbol

Valid EAN 13 character set includes:
  • Numeric characters: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
  • EAN 13 encode 12 data digits and 1 check digit
EnableChecksum enable-checksum true Automatically add the checksun digit to a barcode if the value is set as True.

EAN 13 has One checksum and the checksum property is always enabled to EAN 13 barcode
SupplementData supplement-data "" A supplement to EAN or UPC barcodes. There are commonly 2-Digit and 5-Digit supplements.

To add the 2-Digit supplement or 5-Digit supplement to EAN-13:
  • set the barcode type value to SymbologyType.EAN13_2
  • set the barcode type value to SymbologyType.EAN13_5
SupplementSpace supplement-space 15 Barcode supplementary space between main barcode and supplement barcode. only valid for EAN-8, EAN-13, UPC-A, UPC-E, ISBN, ISSN
Symbology properties X x 2 The width of narrow bars and the default value of X is 2 pixels.

You can increase the value of X to enhance the readability of the barcode if the barcode scanners could not read stably the barcode which is set as the default value in X dimension.
Y y 75 Height of a barcode module

The default bar height value is 75 pixels
Resolution resolution 72 This property set the resolution in DPI of a barcode image to be drawn, and the default value that is set to printer is 72 pixels. You can adjust the value to get a custom resolution barcode image.
GraphicsUnit graphics-unit GraphicsUnit.Pixel This is the barcode graphic measurements for all size related settings. There are three type of measurements:
  • 0: pixel;
  • 1: cm;
  • 2: inch.
The default value is pixel
Rotate rotate 0 The Rotate property allows you changing the angle of a barcode. The valid values are:
  • Rotate0: do not rotate the barcode
  • Rotate90: rotate the barcode 90 degrees clockwise
  • Rotate180: rotate the barcode 180 degrees clockwise
  • Rotate270: rotate the barcode 270 degrees clockwise
DisplayCodeText display-code-text true The default value is true, which makes the encoded data message human readable. Otherwise the data message text will not be displayed on the barcode image
CodeTextFont code-text-font "Arial", Font.PLAIN, 11 CodeTextFont property is used for changing the font style of data message text that can be read by human eyes.
Image properties Format format ImageFormat.Png This is a method that is used for exporting barcode to different type of image formats. It allows developers generate barcode in formats like JPEG/JPG, BMP, GIF, and PNG.

The default method is ImageFormat.Png. Image format type. Using System.Drawing.Imaging.ImageFormat
LeftMargin left-margin 0 The property to set the distance between the symbol and the left margin of a barcode image.
RightMargin right-margin 0 The property to set the distance between the symbol and the right margin of a barcode image.
TopMargin top-margin 0 The property to customize the space between the symbol and the top margin on a barcode image
BottomMargin bottom-margin 0 The property to change the space between the symbol and the bottom margin on a barcode image

.NET EAN-13 Barcodes Generating Supported Barcode Types