How to Encode EAN-128/GS1-128 Data in C#
C#.NET EAN-128/GS1-128 Generator is C#.NET barcode generating class library for creating & printing EAN-128/GS1-128 barcodes in C#.NET projects & applications configuring to the latest GS1 system standard.
C#.NET EAN-128/GS1-128 Generator provides comprehensive C# sample codings for EAN-128/GS1-128 barcode generation and customization in .NET Framework with minimum barcode knowledge of EAN-128/GS1-128. This document explains how to encode EAN-128/GS1-128 valid data in .NET using C# class; if you want to know more about size and image please go to:
EAN-128/GS1-128 Data Related Properties
Symbology
Users may easily generate EAN-128/GS1-128 barcodes using Symbology property.
EAN-128/GS1-128 Barcode encodes:
- All 128 ISO/IEC 646 characters
- Characters with byte values 128 to 255 may also be encoded
- 4 non-data function characters
- 4 code set selection characters
- 3 Start characters
- 1 Stop character
Code
Users may easily change EAN-128/GS1-128 barcode data string with variable length using Code property.
ProcessTilde
Users may simply encode some special characters in EAN-128/GS1-128 barcode with a tilde characters "~" using ProcessTilde property.
- 1-byte character: ~0dd/~1dd/~2dd (character value from 000 ~ 255); ASCII character '~' is presented by ~126
Strings from "~256" to "~299" are unused
- 2-byte character (Unicode): ~6ddddd (character value from 00000 ~ 65535)
Strings from "~665536" to "~699999" are unused
- for GS1 AI Code:
Human-readable Text
Users may simply customize human-readable text and enable it under generated EAN-128/GS1-128 barcode using DisplayText and Textfont properties.
Customize EAN-128/GS1-128 Barcode Data in C#.NET
If you want to encode EAN-128/GS1-128 data in C#.NET, be sure that you have installed:
- Microsoft .NET Framework 2.0/3.0/4.0
- Microsoft Visual Studio 2005/2008/2010 (Express, Professional & Standard Edition)
- Barcode Generator for .NET Ultimate installed
Encode EAN-128/GS1-128 Barcode Data in .NET Project Using C# Class
Copy those following code onto your C#.NET projects:
using BusinessRefinery.Barcode;
Linear barcode = new Linear();
barcode.Symbology = Symbology.EAN128;
barcode.Code = "(56)484564918";
barcode.drawBarcode2ImageFile("c:/ean-128-csharp.gif");
Control EAN-128/GS1-128 Barcode Data Length
Code default value in Barcode Generator for .NET Ultimate is "".Copy those following code to change EAN-128/GS1-128 barcode data length:
Display EAN-128/GS1-128 Barcode Human-Readable Text
DisplayText default value in Barcode Generator for .NET Ultimate is true.
TextFont default value in Barcode Generator for .NET Ultimate is new Font("Arial", Font.PLAIN, 11).
Copy those following code to show human-readable text with customized font style:
barcode.DisplayText = true;
barcode.TextFont = new Font("Arial", 11.0f, FontStyle.Bold);
Encode EAN-128/GS1-128 Barcode Data with "~" in C#.NET
ProcessTilde default value in Barcode Generator for .NET Ultimate is false.
Copy those following code to encode EAN-128/GS1-128 barcode data with "~":
barcode.ProcessTilde= true;
barcode.Code = "~ai56484564918";