EAN-13 Generator Library for .NET in C# Class
How to Generate Linear EAN13 Barcodes in .NET with C# Programming
- Highly performance C# EAN-13 Barcode Generator SDK in use for more than 10 years
- Generate high-quality EAN-13 images with simple C# Class programming
- Create and Draw EAN-13 barcode in C# .NET WinForms or Web applications
- Create and encode EAN-13 barcodes to various image formats
- Easy to install without any activation key or registration code
- Perfect integration with various .NET development environments, like Microsoft Visual Studio
C# Linear EAN13 Barcode Overview
Linear EAN13 Barcode is widely used in daily products. This barcode type can only encode 12 numeric data and a check digit, but it could store much information like manufacturer code, product information and area code. So with those codes, EAN13 barcode could track product worldwide and this is also why it is used to encode GITN.
Quick to Create, Print EAN-13 Barcode using C#
Using BarcodeLib C# Barcode Generator library, you can easily create and print an EAN-13 barcode image using C#.
- Create a
Linear object to generate 1d barcodes
- In property
Type, specify the linear barcode format as BarcodeType.EAN13
- Enter the EAN-13 code (12 or 13 digits) to property
Data
- Use the method
drawBarcode() to encode and output the EAN-13 barcode to an image file
Linear barcode = new Linear();
barcode.Type = BarcodeType.EAN13;
barcode.Data = "1234567890128";
barcode.drawBarcode("C://BarcodeLib//csharp-ean13-sample-image.png");
Encode EAN-13 digits in C# application
EAN-13 with Add-on symbol
EAN-13 barcode may include 2-digit or 5-digit add-on symbol. To create EAN-13 with two-digit add-on, try the C# codes below.
- Select the barcode
Type as BarcodeType.EAN13_2
- Enter the two digits add-on data on property
SData
Linear barcode = new Linear();
barcode.Type = BarcodeType.EAN13_2;
barcode.Data = "123456789012";
barcode.SData = "12";
barcode.drawBarcode("C://BarcodeLib//csharp-ean13-addon-2-sample-image.png");
Same as EAN-13 with two-digit addon, to generate EAN-13 with five-digit add-on, try the C# codes below.
- Select the barcode
Type as BarcodeType.EAN13_5
- Enter the five digits add-on data on property
SData
Linear barcode = new Linear();
barcode.Type = BarcodeType.EAN13_5;
barcode.Data = "123456789012";
barcode.SData = "12345";
barcode.drawBarcode("C://BarcodeLib//csharp-ean13-addon-5-sample-image.png");
EAN-13 check digit
EAN-13 barcode code includes 13 digits. The first 12 digits are EAN data, and the last digit is the check digit. Using BarcodeLib C# Barcode library,
you can input the complete 13 digits or the frist 12 digits to property
Data, and the barcode library will automatically generate the complete EAN-13 barcode images in C# application.
The following C# source code will provide the 12 digits data for property
Data.
Linear barcode = new Linear();
barcode.Type = BarcodeType.EAN13;
barcode.Data = "123456789012";
barcode.drawBarcode("C://BarcodeLib//csharp-ean13-no-check-digit.png");
The following C# source code will provide the EAN-13 13 digits data with wrong check digit (the last digit) for property
Data.
The barcode library will always re-calculate the EAN-13 check digit based on the first 12 digits code.
Linear barcode = new Linear();
barcode.Type = BarcodeType.EAN13;
barcode.Data = "1234567890120";
barcode.drawBarcode("C://BarcodeLib//csharp-ean13-incorrect-check-digit.png");
Print EAN-13 with specified dimension size in C#
- Set property
ImageWidth with the specified EAN-13 image width in pixel
- Set property
ImageHeight with the specified EAN-13 image height in pixel
Linear barcode = new Linear();
barcode.Type = BarcodeType.EAN13;
barcode.Data = "1234567890128";
barcode.ImageWidth = 250;
barcode.ImageHeight = 180;
barcode.drawBarcode("C://BarcodeLib//csharp-ean13-barcode-size.png");
Advanced EAN-13 Customization using C#
Show, hide EAN-13 quiet zone indicator
You can enable and render EAN quiet zone indicator (sign ">") in the end of EAN-13 barcode text in C# application.
- Enable property
EANUPCShowIndicator to true to print EAN quiet zone indicator
Linear barcode = new Linear();
barcode.Type = BarcodeType.EAN13;
barcode.Data = "1234567890128";
barcode.EANUPCShowIndicator = true;
barcode.drawBarcode("C://BarcodeLib//csharp-ean13-quiet-zone-indicator.png");
EAN-13 first, last digit spacing
You can adjust the space between the first, the last (quiet zone indicator) character and the bar modules) using C# Barcode library.
- Set the space tween the first char and EAN-13 barcode to property
EANUPCFirstDigitShift
- Set the space tween EAN-13 barcode and the last char (quiet zone indicator) to property
EANUPCLastDigitShift
Linear barcode = new Linear();
barcode.Type = BarcodeType.EAN13;
barcode.Data = "1234567890128";
barcode.EANUPCShowIndicator = true;
barcode.EANUPCFirstDigitShift = 20;
barcode.EANUPCLastDigitShift = 20;
barcode.drawBarcode("C://BarcodeLib//csharp-ean13-lead-trail-digit-shift.png");