EAN-13 Barcode FAQ in C#.NET Barcode Generator DLL

C# class to set EAN-13, EAN-13+2, EAN-13+5 images and properties in .NET framework with free samples
Barcode in C# > Linear > EAN-13 FAQ
Generate Barcode Image Using C#.NET - EAN-13 Barcode FAQ in C#
EAN-13 barcode control library for C#.NET projects is a robust and mature .NET control SDK which supports to create and customize EAN-13 barcode images in various C#.NET programs. Free C# sample code is provided with detail settings of EAN-13 barcodes. The EAN-13 barcode setting FAQ is valid for these platforms using C# programming language, such as ASP.NET, Windows Forms applications, Crystal Report, Reporting Service, and RDLC Local Report. Also see guide for creating barcode images using C# coding.
This page has detail information of EAN-13 property settings in C#.NET projects with the following aspects using C#.NET class method:
  • Generate EAN-13 Barcode Images Using C# Class - EAN-13 Barcode Data Encoding
  • Generate EAN-13 Barcode Images Using C# Class - EAN-13 Barcode Special Settings
  • Generate EAN-13 Barcode Images Using C# Class - EAN-13 Barcode Size Adjustment
  • Generate EAN-13 Barcode Images Using C# Class - EAN-13 Barcode Image Customization
  • Generate EAN-13 Barcode Images Using C# Class - EAN-13 Barcode Solution Project Support
Create Barcode Image Using C#.NET - EAN-13 Data Encoding
EAN-13 Linear Barcode Valid Data
  • Digit numbers: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
  • 12 digits long with a checksum character which is automatically calculated by Terrek.Barcode for C#.NET
EAN-13 C#.NET Sample Code:
ean13. Symbol = BarcodeSymbol.EAN13;
ean13. BarcodeData = "123456789101";
EAN-13 Human-readable Text
With barcode control SDK for C#.NET, it is easy to enable or disable the human-readable text in EAN-13 symbols. In some occasions, users may disable the human-readable text and replace with other characters such as company logo, telephone, fax, etc.
EAN-13 C#.NET Sample Code:
ean13.DisplayData = true;
ean13.TextStyle = new Font("Arial", 9f, FontStyle.Regular);
ean13.TextColor = Color.Blue;
ean13.TextSpace = 8;
Create Barcode Image Using C#.NET - EAN-13 Special Settings
Generate EAN-13 Add-on Barcodes 2 digits & 5 digits
Barcode generator library DLL for C#.NET is capable of encoding EAN-13 supplemental barcodes EAN-13+2 and EAN-13+5 in C#.NET projects. Programmers can use the Symbol property to create EAN-13 add-on barcodes.
EAN-13+2 C#.NET Sample Code:
ean13. Symbol = BarcodeSymbol.EAN13_AddOn2;

EAN-13+5 C#.NET Sample Code:
ean13. Symbol = BarcodeSymbol.EAN13_AddOn5;
EAN-13 Add-on Symbol Settings
To encode EAN-13+2 or EAN-13+5, developers need to customize the AddOnData, AddOnHeight, AddOnMargin respectively. The default value is compiled in barcode DLL, but the adjutment is simple.
EAN-13+2 C#.NET Sample Code:
ean13.AddOnData="12";
ean13.AddOnHeight=0.8;
ean13.AddOnMargin=20;

EAN-13+5 C#.NET Sample Code:
ean13.AddOnData="12345";
ean13.AddOnHeight=0.8;
ean13.AddOnMargin=20;
Print Barcode Image Using C#.NET - EAN-13 Size Adjustment
EAN-13 UOM Settings
Set property MeasuringUnit for properties BarWidth, BarHeight, MarginL and MarginT. Valid values are PIXEL, CM and INCH. Default is PIXEL. With this UOM setting, users can control the whole barcode size to a unique type.
EAN-13 C#.NET Sample Code:
ean13.MeasuringUnit = MeasuringUnit.PIXEL;
EAN-13 Bar Size
EAN-13 bar size refers to the BarWidth and BarHeight of a module bar. When users need to create barcodes with a fixed bar width, these two properties need to be implemented. With the ImageResize applied, image width & image height are changed according to adjustment of bar width and bar height.
EAN-13 C#.NET Sample Code:
ean13.ImageResize = true;
ean13.BarWidth = 2;
ean13.BarHeight =50;
EAN-13 Image Size
EAN-13 image size refers to the whole barcode image size including image width and image height. If the module size is unknown, you can set the ImageHeight and ImageWidth directly with the applying of ImageResize to true. The generated EAN-13 strictly conforms to International Standard ISO/IEC 15420.
EAN-13 C#.NET Sample Code:
ean13.ImageWidth = 60;
ean13.ImageHeight = 60;
EAN-13 Margin Size
Increasing the width of margins around the symbol is one way to enhance the readability of the EAN-13 barcode image. The control library set the left, right, top, and bottom margins separately with float values. The default value is 0.
EAN-13 C#.NET Sample Code:
ean13. MarginL = 10;
ean13. MarginR = 10;
ean13. MarginT = 10;
ean13. MarginB = 10;
Develop Barcode Image Using C#.NET - EAN-13 Image Customization
EAN-13 Image Format
EAN-13 is generated as image in C#.NET projects with Terrek.Barcode library SDK. The type is System.Drawing.Imaging.ImageFormat. The valid image format values are Gif, Tiff, Bmp, Png, Jpeg, etc. Please ensure the accordance of image format and suffix of image file name.
EAN-13 C#.NET Sample Code:
ean13.BarcodeFormat = System.Drawing.Imaging.ImageFormat.Png;
ean13.drawBarcode("C:\\ean13.png");
EAN-13 Image Resolution
DPI (Dots per inch) is used commonly as the measure of printing resolution. The resolution of image generated by EAN-13 generator could be managed with DPI. The type is int, default value is 96 dpi. Users can change the resolution via DotsPerInch property.
EAN-13 C#.NET Sample Code:
ean13.DotsPerInch = 96;
EAN-13 Image Position
The created EAN-13 is flexible to change the placement in C#.NET projects. By customizing the BarAlign properly, the image is presented left, right or center. By changing Rotation property, the image can be rotated to 90, 180, and 270 degree. The default is 0.
EAN-13 C#.NET Sample Code:
ean13.Rotation = Rotation.Degree0;
ean13.BarAlign = BarAlign.Center;
EAN-13 Image Color
It is able to change barcode colors with barcode control library DLL using C#.NET class. Both background color and foreground color are easy to be changed by manipulating ImageColor and BarColor respectively. The default color is white and black.
EAN-13 C#.NET Sample Code:
ean13. ImageColor = Color.White;
ean13. BarColor = Color.Black;
Develop Barcode Image Using C#.NET - EAN-13 Solution Development
Using C# programming to create EAN-13 images, there are a lot of development platforms can be implemented this barcode solution. And the following projects can be adopted to fulfill your EAN-13 barcode images in .NET projects.
  • Windows Forms Application (design-time and runtime support)
  • Console Application (runtime support)
  • Class Library (runtime support)
  • Windows Service (runtime support)
  • ASP.NET Applications (design-time and runtime support)
  • Web Service (runtime support)
  • Crystal Report for .NET (runtime support)
  • Reporting Service Applications (design-time and runtime support)