Skip to main content
A newer version of this page is available. .

EAN 13

  • 3 minutes to read

Short Description

EAN-13, based upon the UPC-A standard, was implemented by the International Article Numbering Association (EAN) in Europe. At present, the GS1 organization is responsible for the maintenance of bar code standards (to learn more, refer to GS1 Homepage).

The EAN-13 bar code contains 13 digits, no letters or other characters. The first two or three digits represent the country. The leading zero actually signifies the USA, and UPC-A coding. The last digit is the “check digit”, the checksum. The check digit is calculated using the first twelve figures when the bar code is constructed. So, for the correct EAN-13 code, you should specify only the first 12 digits.

The recommended dimensions are shown in the following image. The standard allows magnification up to 200%, and reduction of up to 80% of the recommended size.

Barcode - EAN 13

There should be two quiet zones before and after the bar code. They provide reliable operation of the bar code scanner. The quiet zone recommended length is 3.63 mm for the left zone and 2.31 mm for the right zone.

Bar Code Properties

The type of a bar code control’s Symbology property is EAN13Generator.

The are no properties specific to the EAN 13 bar code type.

Note

A bar code control does not verify the length of the string assigned to the Text value. It is the developer’s responsibility to check that the passed string contains no more than 12 digits (the control calculates the last 13th digit automatically). If the number of digits is less than 12, the leading zeroes are added to the resulting barcode.

Examples

The following code creates a EAN 13 bar code and specifies its main properties.

using System;
using System.Collections.Generic;
using System.Drawing.Printing;
using System.Windows.Forms;
using DevExpress.XtraPrinting.BarCode;
using DevExpress.XtraReports.UI;
// ...
public XRBarCode CreateEAN13BarCode(string BarCodeText) {
    // Create a bar code control.
    XRBarCode barCode = new XRBarCode();

    // Set the bar code's type to EAN 13.
    barCode.Symbology = new EAN13Generator();

    // Adjust the bar code's main properties.
    barCode.Text = BarCodeText;
    barCode.Width = 275;
    barCode.Height = 200;

    return barCode;
}

To add the XRBarCode to a report band, handle the report’s XRControl.BeforePrint event.

using System.Drawing.Printing;
// ...

private void XtraReport1_BeforePrint(object sender, PrintEventArgs e) {
    this.Detail.Controls.Add(CreateEAN13BarCode("012345678"));
}