.NET Barcode  >  .NET Barcode Generation Guide  >  .NET Barcode EAN 8 Generator for .NET, C#, ASP.NET, VB.NET


.NET Barcode EAN 8 Generator for .NET, C#, ASP.NET, VB.NET

.NET Barcode offers the most affordable .NET barcode generator for barcode .NET professionals.

.NET EAN-8 Introduction

EAN-8 is also known as European Article Number 8, EAN-8 Supplement 5/Five-digit Add-On, EAN-8 Supplement 2/Two-digit Add-On, EAN-8+5, EAN-8+2, EAN8, EAN8+5, EAN13+2, UPC-8, GTIN-8, GS1-8, EAN/UCC-8

An EAN-8 is a barcode and is derived from the longer European Article Number (EAN-13) code. It was introduced mainly to use on small packages where an EAN-13 barcode would be impractical; for example on cigarettes, pencils even though not used very common and chewing gum packets.


How to generate EAN-8 barcodes in C#.NET Class?

The following C# .NET code illustrates how to generate a EAN-8 barcode in C# class:

using KeepDynamic.Barcode.Generator;

// Create linear barcode object in C#
BarCode barcode = new BarCode();

// Set barcode symbology type to EAN-8 in C#
barcode.SymbologyType = SymbologyType.EAN8;

// Set EAN-8 barcode value in C#
barcode.CodeText = "0123456";

// Set EAN-8 drawing image format to PNG in C#
barcode.Format = ImageFormat.Png;

// Generate EAN-8 barcode & encode to the png image in C#
barcode.drawBarcode("C://barcode-ean8-csharp.png");
  
// Generate EAN-8 barcode & print to System.Drawing.Graphics object in C#
barcode.drawBarcode("Graphics object");
 
// Create EAN-8 barcode & draw to System.IO.Stream object in C#
barcode.drawBarcode("Stream object");




How to generate EAN-8 barcodes in VB.NET Class?

The following VB.NET code illustrates how to generate EAN-8 barcodes in VB.NET class:

// Create linear barcode object in VB.NET
Dim barcode As KeepDynamic.Barcode.Generator.BarCode
barcode = New KeepDynamic.Barcode.Generator.BarCode()

// Set barcode symbology type to EAN-8 in VB.NET
barcode.SymbologyType = SymbologyType.EAN8;

// Set EAN-8 barcode value in VB.NET
barcode.CodeText = "0123456"

// Set EAN-8 drawing image format to PNG in VB.NET
barcode.Format = ImageFormat.Png

// Generate EAN-8 barcode & encode to the png image in VB.NET
barcode.drawBarcode("C://barcode-ean8-vbnet.png")
  
// Generate EAN-8 barcode & print to System.Drawing.Graphics object in VB.NET
barcode.drawBarcode("Graphics object")
 
// Create EAN-8 barcode & draw to System.IO.Stream object in VB.NET
barcode.drawBarcode("Stream object")


Creating EAN-8 barcodes using .NET Barcode Generator Windows Form Control

To create EAN-8 barcodes in Windows Forms applications, do the following procedures:

  • Add KeepDynamic.BarCode.Windows.dll to your C#, VB.NET project reference

  • Add KeepDynamic.BarCode.Windows.dll to windows project toolbox

  • Drag the BarCodeControl item to your windows forms


Creating EAN-8 barcodes using ASP.NET Barcode Generator ASP.NET Web Form Control

To create EAN-8 barcodes in ASP.NET Web Forms applications, do the following procedures:

  • Add KeepDynamic.BarCode.AspNet.dll to your C#, VB.NET project reference

  • Add KeepDynamic.BarCode.AspNet.dll to windows project toolbox

  • Drag the BarCodeControl item to your ASP.NET Web form pages, in your ASP.NET design view


.NET EAN-8 Barcodes Properties

Class Properties HTTP Parameters Default Comments
SymbologyType symbology-type SymbologyType.Code128 Barcode type. Values for EAN-8 are SymbologyType.EAN8, SymbologyType.EAN8_2, SymbologyType.EAN8_5
CodeText code-text "" Barcode value to encode. Valid value is 7 digits, without last checksum digit
EnableChecksum enable-checksum true Checksum for barcode value
SupplementData supplement-data "" Barcode supplementary value to encode. only valid for EAN-8, EAN-13, UPC-A, UPC-E, ISBN, ISSN
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
GraphicsUnit graphics-unit GraphicsUnit.Pixel BarCode graphics meature for all size related settings. 0: pixel; 1: cm; 2: inch. Default is pixel
X x 2 Width of barcode module (narrow bar), default is 2 pixel
Y y 75 Barcode module height, default is 75 pixel
LeftMargin left-margin 0 Barcode image left margin
RightMargin right-margin 0 Barcode image right margin
TopMargin top-margin 0 Barcode image top margin
BottomMargin bottom-margin 0 Barcode image bottom margin
Resolution resolution 72 Barcode image resolution in dpi
Rotate rotate 0 Barcode rotate angle, valid values: 0, 90, 180, 270
DisplayCodeText display-code-text true If true, display barcode value text, otherwise do not display.
CodeTextFont code-text-font "Arial", Font.PLAIN, 11 Barcode text font style
Format format ImageFormat.Png Image format type. Using System.Drawing.Imaging.ImageFormat





.NET Barcode Generator supports most common linear (1d) and matrix (2d) bar code standards, including:

2D Barcodes Code-39 related Code-128 related Code-25 related EAN/UPC related Other Linear Barcodes
Data Matrix

PDF-417

QR-Code

Code-39

Code-93

Code-128

GS1-128/UCC/EAN-128
Code 2 of 5

Interleaved 2 of 5

ITF-14

Identcode

Leitcode

EAN-8

EAN-13

ISBN

ISSN

UPC-A

UPC-E
Codabar

Code-11

POSTNET

PLANET

USPS Intelligent Mail Barcode (OneCode)

RM4SCC

MSI Plessey