.NET Barcode for WinForms          ASP.NET Barcode          .NET Barcode Reader          Java Barcode          Java Barcode Reader
Home > C#.NET Barcode Generator > Generating Linear Barcodes in C# - EAN-8

.NET EAN-8 Generator in C#

EAN-8 in C# Tutorial

  .NET EAN-8 Installation in Visual Studio C#

    See Installation in Visual Studio C#

  Barcode Symbology Setting

Avapose .NET Barcode Generator generates 23 linear barcode symbologies. Find the properties “Symbology” (default value: Code128Auto) in Properties Windows, and input the symbology value you want according to the following list:

Symbology EAN-8 EAN-8 with 2-digit add-on symbol EAN-8 with 5 digit add-on symbol
Symbology Value EAN8 EAN8Sup2 EAN8Sup5
Symbology Sample Code in C# BarCode barcode = new BarCode(); barcode.Symbology = Symbology.EAN8; BarCode barcode = new BarCode(); barcode.Symbology = Symbology.EAN8Sup2; BarCode barcode = new BarCode(); barcode.Symbology = Symbology.EAN8Sup5;
Symbology Sample Image



EAN-8 Data Encoding

Find the properties “Data” (default value: 128) in Properties Windows. Input the data you are going to encode in the EAN-8. Make sure the data you input is within the character set of EAN-8.

Symbology Value Symbology Character Set Input Digits Account
EAN8 Numeric Character: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9; 7
EAN8Sup2 Numeric Character: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9; 7 +2
EAN8Sup5 Numeric Character: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9; 7 +5


Sample Code

Property Name Sample Code – EAN8
Data


BarCode
barcode = new BarCode();
barcode.Symbology = Symbology.EAN8;
barcode.Data = "9876543";


Sample Code


Property Name Sample Code – EAN8Sup2
Data


BarCode
barcode = new BarCode();
barcode.Symbology = Symbology.EAN8Sup2;
barcode.Data = "9876543";
barcode.SupData = "12";


Sample Code


Property Name Sample Code – EAN8Sup5
Data


BarCode
barcode = new BarCode();
barcode.Symbology = Symbology.EAN8Sup5;
barcode.Data = "9876543";
barcode.SupData = "12345";

EAN-8 Supplement Barcode Tutorial

When supplement barcode is needed, you also need to know the two properties for the supplement barcode generating besides the supplement data (SupData). They are SupHeight and SupSpace.


Property Value Type Default Value Property Description Sample Code
SupHeight float 0.8f SupHeight= supplement barcode height/ main barcode height; the value of SupHeight ranges from 0 to 0.8f
BarCode barcode = new BarCode();
barcode.Symbology = Symbology.EAN8Sup5;
barcode.Data = "9876543";
barcode.SupData = "12345";
barcode.SupHeight = 0.6f;
SupSpace float 15 (pixel) The space between the main barcode and the supplement barcode
BarCode barcode = new BarCode();
barcode.Symbology = Symbology.EAN8Sup5;
barcode.Data = "9876543";
barcode.SupData = "12345";
barcode.SupHeight = 0.6f;
barcode.SupSpace = 20;


Barcode Size Setting Tutorial

Size Setting of the barcode provided by Avapose .NET Barcode Generator is comprehensive.

We can generally divide it into four parts:

1. Unit Of Measure Setting

2. Image Size Setting : BarcodeImageWidth and BarcodeImageHeight

3. Module Size Setting: X and Y

4. Margin Size Setting: MarginTop, MarginBottom, MarginLeft, and MarginRight

Property Value Type Default Value Property Description Sample Code
UOM UnitOfMeasure Pixel
The unit of measure;

Options:

Pixel
Cm
Inch

BarCode barcode = new BarCode(); barcode.Symbology = Symbology.EAN8;
barcode.Data = "9876543";
barcode.UOM = UnitOfMeasure.Cm;
BarcodeImageWidth float 0 Barcode image width


BarCode
barcode = new BarCode(); barcode.Symbology = Symbology.EAN8;
barcode.Data = "9876543";
barcode.BarcodeImageWidth = 175;

BarcodeImageHeight float 0 Barcode image height


BarCode
barcode = new BarCode();
barcode.Symbology = Symbology.EAN8;
barcode.Data = "9876543";
barcode.BarcodeImageHeight =50;

X float 2 Width of module in unit of measure


BarCode
barcode = new BarCode(); barcode.Symbology = Symbology.EAN8; barcode.Data = "9876543";
barcode.X = 1;

Y float 75 Height of module in unit of measure


BarCode
barcode = new BarCode(); barcode.Symbology = Symbology.EAN8; barcode.Data = "9876543";
barcode.Y = 50;

AutoResize bool false -


BarCode
barcode = new BarCode(); barcode.Symbology = Symbology.EAN8; barcode.Data = "9876543";
barcode.AutoResize = true;

MarginTop float 0 Top margin width of the barcode image in unit of measure
BarCode barcode = new BarCode(); barcode.Symbology = Symbology.EAN8; barcode.Data = "9876543";
barcode.MarginTop = 5;
barcode.MarginBottom = 5;
barcode.MarginLeft = 5;
barcode.MarginRight = 5;
MarginBottom float 0 Bottom margin width of the barcode image in unit of measure
MarginLeft float 0 Left margin width of the barcode image in unit of measure
MarginRight float 0 Right margin width of the barcode image in unit of measure


Related EAN-8 Barcode Integration & Generation Information

The following EAN-8 barcode integration and creation information links relate to this product that may be of interest to you: