KA.Barcode for .NET WinForms
How to Print EAN-13 in .NET WinForms with Valid Data
Complete EAN-13 source code to generate, print EAN-13 images using Barcode Generator for .NET Control
  • Full integration into .NET Framework 2.0, 3.0, 3.5 and greater
  • Compatible with Microsoft Visual Studio 2005/2008/2010 and other development environments
  • Draw and print barcode .NET, Excel barcode, barcode ASP.NET & barcode .NET WinForms in .NET IDEs
  • Simple procedures to dynamically insert linear EAN-13, EAN-13+2, EAN-13+5 into .NET Windows Forms
  • 1D EAN-13 barcode images generation on winforms to save as graphic objects
  • Encodable for ASCII characters 48 to 57 inclusive ( numeric digits), in accordance with ISO 646
  • Automatically calculate and add the mandatory check digit in 1D EAN-13
  • Powerful barcode component Java barcode, barcode Word, barcode Excel developed for easy barcode creation
  • Generating, printing 2-digit and 5-digit supplement add-on symbol for multiple EAN-13
  • Compatible with latest GS1 specification to output valid barcodes for all scanners

This KA.Barcode Generator for .NET WinForms is the best available barcode component/dll plugin device for developers which functions to generate, draw EAN13, EAN13+2, EAN13+5 and other linear, bidimensional barcodes in .NET Windows Forms, SSRS, Crystal Reports, C#, Visual Basic.NET class library.
Services is a powerful barcode sdk library DLL ....
KeepAutomation.Barcode.Web" in the References. There are many methods of barcode generation in C#.NET: within barcode setting panel, using C#,...
In Visual Studio Class by using C#.NET programming. It is avaliable for implementers to download dynamic freeware Barcode Generation Component SDK...
Microsoft Windows XP; Microsoft Visual Studio 2005; Visual C#.NET. 1D & ....
more>
This tutorial pages guides you to encode valid data for EAN13 in C#, VB.NET. For other details, please check the tutorials below:
Linear EAN-13 Introduction
EAN-13, aka European Article Number 13, 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).

Valid Data

  • Numeric digits 0, 1, 2, 3, 4, 5, 6, 7, 8, 9

Valid Length

  • EAN-13 barcode can encode 13 digits, including the last checksum digit, which will be automatically added by KA.
EAN-13 Data Encoding in KA.Barcode Generator for .NET WinForms

Install EAN13 Barcode Generator into Your .NET Project

  1. 1.
  2. 2.
    Add Reference: Add "KeepAutomation.Barcode.Window.dll" to your .NET WinForms project reference.
  3. 3.
    Add to Toolbox: Add BarCodeControl to your .NET Visual Studio toolbox.
Of KA.Barcode Generator for .NET Suite, which can efficiently add Code 39 generation feature into various .NET projects like ASP.NET webform,...
Easy integration into .NET applications to generate QR Code in C#.NET class library; Dynamic barcode components, such as .NET barcode ....
Mature Barcode Component DLL effectively run ....
more>

Printing EAN-13 with Numeric Text

EAN13 can only encode 13 numeric digits. You can input 12 numeric digits because KA.Barcode Generator for .NET Suite will automatically calculate and add the last checksum digit according to the specified algorithm in the GS1 standard. Copy the C#, VB.NET sample codings below into your projects to create, insert an EAN-13 barcode in .NET WinForms:
using KeepAutomation.Barcode.Bean;
BarCode ean13= new BarCode();
ean13. Symbology = Symbology. EAN13;
ean13.CodeToEncode = "112233445566";
ean13.X = 3;
ean13.generateBarcodeToImageFile("C:/ean13_csharp.png");
Dim ean13 As KeepAutomation.Barcode.Bean.BarCode = New KeepAutomation.Barcode.Bean.BarCode

ean13.Symbology = KeepAutomation.Barcode.Symbology. EAN13Sup2
ean13.CodeToEncode = "123456789012"
ean13.X = 3
ean13.generateBarcodeToImageFile("C://ean13_vb.png")

Generating EAN-13+2 with Numeric Data

You can also add a two-digit add-on symbol for an EAN-13 barcodes. Follow the sample code below to transform numeric string data into an EAN-13+2 bar code.
using KeepAutomation.Barcode.Bean;
BarCode ean13= new BarCode();
ean13. Symbology = Symbology. EAN13Sup2;
ean13.CodeToEncode = "112233445566";
ean13.SupplementCode = "22";
ean13.X = 2;
ean13.generateBarcodeToImageFile("C:/ean13c_add2.png");
Dim ean13 As KeepAutomation.Barcode.Bean.BarCode = New KeepAutomation.Barcode.Bean.BarCode

ean13.Symbology = KeepAutomation.Barcode.Symbology. EAN13Sup2
ean13.CodeToEncode = "123456789012"
ean13.X = 3
ean13.SupplementCode = "22";
ean13.generateBarcodeToImageFile("C://ean13_vb.png")

Creating EAN-13+5 with Numeric Data

If you want to encode additional information like price and date in the EAN 13 barcode, you can also add a five-digit add-on symbol in the barcodes. Follow the sample code below to convert numeric text data into an EAN-13+5 bar code.
using KeepAutomation.Barcode.Bean;
BarCode ean13= new BarCode();
ean13.Symbology = Symbology. EAN13Sup5;
ean13.CodeToEncode = "112233445566";
ean13.SupplementCode = "55555";
ean13.X = 2;
ean13.generateBarcodeToImageFile("C:/ean13c_add5.png");
Dim ean13 As KeepAutomation.Barcode.Bean.BarCode = New KeepAutomation.Barcode.Bean.BarCode

ean13.Symbology = KeepAutomation.Barcode.Symbology. EAN13Sup2
ean13.CodeToEncode = "123456789012"
ean13.X = 3
ean13.SupplementCode = "55555";
ean13.generateBarcodeToImageFile("C://ean13_vb.png")

EAN13 Data Encoding with Drag & Drop BarcodeControl

  1. 1.
    In "Choose Toolbox Items" form, click button "Browse...", and select KeepAutomation.Barcode.Windows.dll.
  2. 2.
    Now a BarCodeControl is added into your toolbox.
  3. 3.
    Drag and drop the BarCodeControl into the Forms and a Codabar image is generated.
  4. 4.
    Find Symbology" in the property panel and select "EAN13", "EAN13Sup2"or "EAN13Sup5".
  5. 5.
    Then input numeric characters in "CodeToEncode" blanket.
  6. 6.
    For EAN13 with supplement, input the additional digits in the SupplementCode blanket.
  7. 7.
    An EAN13 barcodes with different characters is successfully created!