KA.Barcode Generator for .NET Suite
How to Generate EAN-13 Image in C# Projects
Complete C# source code to generate EAN-13 images in different image formats using Barcode for .NET
  • Compatible with .NET development environments like Microsoft Visual Studio 2005 and 2010
  • Java barcode, Excel barcode, ASP.NET barcode, barcode Word & barcode .NET provided
  • Generating , creating 1D EAN-13, EAN-13+2, EAN-13+5 images in C#.NET class library
  • Programmatically draw, paint EAN-13 barcodes in WinForms, ASP.NET web applications, Crystal Reports, etc
  • Make and print 1D EAN-13 barcodes and save locally in various image formats including Png, Jpeg, Gif, Tiff, Bmp
  • Provide detailed generation guides online, such as .NET WinForms barcode generation, ASP.NET barcode tutorial & C# barcode sample
  • Resolution adjustable through DPI setting to allow high-quality EAN-13 image output
  • Latest GS1 specification pre-configured to create, produce standard EAN-13 printout for all scanners
  • Accurate algorithm to calculate and add checksum digit automatically as specified in GS1 standard
  • Advanced EAN-13 barcode maker component featuring high-quality barcode image generation in C#
EAN-13, originally European Article Number 13, now renamed International Article Number, is also known as EAN/UCC-13, GS1-13, GTIN-13, with variants EAN-13 Supplement 2 (a two-digit Add-On), EAN-13 Supplement 5 (a five-digit add-on).
KeepAutomation Barcode Generator for .NET API SDK allows you to generate, print EAN-13, EAN-13+2, EAN-13+5 barcodes with best quality in winforms, ASP.NET web sites, Crystal Reports, SQL Server Reporting Services, C#.NET, VB.NET class and console applications. Besides this image setting demo, you can also get tutorials on EAN-13 data encoding and size setting with C# sample code below.
How to Generate, Specify EAN-13 Barcode Images in C# Class

Install, Integrate KA.Barcode Generator for .NET Suite into Projects

  1. 1.
  2. 2.
    Add Reference: Add "KeepAutomation.Barcode.Window.dll" to your C#.NET project reference.
  3. 3.
    Copy the following C#.NET example code onto your project to create an EAN-13 image with .NET barcode maker.
using KeepAutomation.Barcode.Bean;

BarCode ean13= new BarCode();
ean13.Symbology = KeepAutomation.Barcode.Symbology.EAN13;
ean13.CodeToEncode = "112233445500";
ean13.X =2;

EAN-13 Barcode Margins / Quiet Zones

KA.Barcode Generator for .NET Suite automatically add a 10X margin (quiet zones) on the left and right sides of a EAN-13 image as specification requires to ensure image readability. Default value for margin is 0. If you want to extra margins, please copy the EAN-13 barcode programming code into your C#.NET project.
ean13.LeftMargin = 2;
ean13.RightMargin = 2;
ean13.TopMargin = 2;
ean13.BottomMargin = 2;

EAN-13 Image Formats

KeepAutomation barcode generator for C#.NET supports printing EAN-13 barcodes in different image formats, including Png, Jpeg/Jpg, Gif, Tiff, Bmp, etc. Copy the C# sample code below and save EAN-13 barcodes to specific image file.
ean13.ImageFormat = System.Drawing.Imaging.ImageFormat.Png;

EAN-13 Supplemental Bar Height

If you want to generate an EAN-13 barcode with a two-digit or a five-digit add-on symbol, i.e. the EAN-13+2 (EAN13Sup2), EAN-13+5 (EAN13Sup5), you might want to adjust the supplemental bar height. The supplemental bar height is a float value, with a default value 0.8F, which means the supplemental bar height is 80% the height of the primary bar height.
ean13.Symbology = Symbology.EAN13Sup2; 
ean13.CodeToEncode = "112233445500";
ean13.SupplementCode = "22";
ean13.SupplementHeight = 0.7F;

EAN-13 Supplemental Bar Space

The supplemental bar space refers to the space between the add-on symbol and the primary bar code symbol. Default value is 15 pixel. Change this parameter with the C# code below.
ean13.SupplementSpace = 15;

EAN-13 Image Rotation / Orientation

If you want to rotate EAN-13 barcode images due to space limit or position reason, you can use the image Orientation function, with which you can rotate generated EAN-13 image in 0, 90, 180, or 270 degrees. Here's the C# example.
ean13.Orientation = KeepAutomation.Barcode.Orientation .Degree90 ;