Easy to install C# Code 128 Barcode Generator DLL into Visual Studio .NET applications
Strong named, digitally signed and time-stamped assemblies designed in C# managed code
Generate dynamic Code 128 barcodes into Microsoft .NET Framework Applications, like Windows Forms and ASP.NET Web Form
Generate and draw linear barcode Code 128 images on .NET Crystal Reports, Reporting Services and Client RDLC Reports
Code 128 barcode images may be created or saved as graphic images without any use of barcode tool
Create ISO/IEC compatible Code 128 barcodes with advanced print quality on low / high-resolution printers
Support over 20 linear & 2d barcode generation, like Codabar, Code 39, GS1-128, QR Code, Data Matrix, etc
Code 128 Barcode Introduction
Code-128 is commenly referred as ANSI/AIM 128, ANSI/AIM Code 128, USS Code 128, Uniform Symbology Specification Code 128, Code 128 Code Set A, Code 128 Code Set B, Code 128 Code Set C, Code 128A, Code 128B, Code 128C.
ISO/IEC Specification Compatibility: In accordance with ISO/IEC 15417 (Second edition 2007-06-01)
Code 128 is a very effective, high-density symbology which permits the encoding of alphanumeric data. The symbology includes a checksum digit for verification, and the bar code may also be verified character-by-character verifying the parity of each data byte. This symbology has been widely implemented in many applications where a relatively large amount of data must be encoded in a relatively small amount of space. It's specific structure also allows numeric data to be encoded at, effectively, double-density.
Special characters of Code 128 barcode
The last seven characters of Code Sets A and B (character values 96 - 102) and the last three characters of Code Set C (character values 100 - 102) are special non-data characters with no ASCII character equivalents, which have particular significance to the bar code reading device.
Quick to Create, Print Code 128 Barcode using C#
Using BarcodeLib.com C# Barcode Generator library, you can easily create and print Code 128 barcodes in C# class.
Create a Linear object
Set the linear barcode format property Type as CODE128
Set the Code 128 barcode encoding text through property Data
Call method drawBarcode() to print Code 128 to a PNG image file
You can also use method drawBarcode() to print and output barcode to byte[] or Stream object
With this C# Code 128 generator component, you can stream Code 128 barcode images in ASP.NET in two ways.
Method 1: Through BarcodeLib Buildin ASP.NET Barcode Application.
Unzip the downloaded evaluation package, and copy barcode folder and its contents to your IIS folder, eg. C:\inetpub.
Create a new virtual directory in your IIS, name it "barcode", and connect it to the above "barcode" folder in inetpub.
Restart IIS for a barcoding test.
To test your installation, please open your web browser and navigate to: http://YourDomain:port/barcode/linear.aspx?Type=2&Data=CODE128 For further Code 128 barcode setting, please view more web stream Code 128 URL parameters here: Code 128 .NET Generator DLL Property Settings.
To add this Code 128 image in your aspx or html page, you can pass the url to IMG tag or src value. For example: <img src=http://YourDomain:port/barcode/linear.aspx?Type=2&Data=CODE128 /> This method will not generate any barcode images in your IIS server side.
Method 2: Through ASP.NET web form controller.
Integrate ASP.NET barcode controller to your barcoding project by adding reference.
Add barcode library to your Visual Studio Toolbox.
Open your unzipped trial package, and copy files "linear.aspx", "linear.aspx.cs" to the aspx page, in which you will be generating Code 128 images.
Now you can drag LinearASPNET to your ASP.NET web site, and change Code 128 settings through properties window on the right or use above free Visual C# source code.
Debug and you will see the Code 128 barcode generated on your aspx pages.
How to Create Code 128 Barcodes in C# WinForms?
Add reference to BarcodeLib.Barcode.WinForms.dll to your barcoding project.
Add BarcodeLib.Barcode.WinForms.dll to your Visual Studio toolbox.
Now please drag the LinearWinForm to your windows form or use above free Visual C# source code, and a Code 128 barcode is generated.
Code 128 Barcode Data Encoding using C#
Code 128 barcode supports full 128 ASCII characters and extended ASCII characters.
Encode ASCII characters
To create Code 128 with ASCII characters encoded, you can enter the encoding ASCII characters directly to property Data in C# codes.
There are few control characters in ASCII and extended ASCII character set are non-printable. You cannot enter the control characters through keyboard.
To create Code 128 with those non-printable chars using C#, you need pass these control character's ASCII integer value to the C# barcode generator library.
Convert ASCII control character to the following format: "~ddd". Here "ddd" is the ASCII value in 3 digits.
Set the encoding data property Data with ASCII printing characters and converted control characters.
Enable property ProcessTilde to true.
Call method drawBarcode() to print Code 128 barcode with control characters encoded.
Each Code 128 barcode includes a compulsory checksum character, which is based on module 103 algorithm. The property AddCheckSum in class BarcodeLib.Barcode.Linear is
not applicable for Code 128 barcode. The barcode library will automatically calculate and generate a checksum character in code 128 barcode before the Stop character.
The Code 128 checksum character will not be printed in the barcode Code 128 text label, and will not be transferred by the barcode scanner software and devices.
Code 128 Barcode Width & Height in C#
C# Barcode library will print Code 128 barcode image with default dimensiion width and height based on Code 128 encoding characters length.
You can also specify the target image width and height in C# class.
Set barcode property ImageWidth with target Code 128 image width in pixel.
Set barcode property ImageHeight with target Code 128 image height in pixel.
Using BarcodeLib C# Barcode Library, you can generate, customize and print Code 128 with styled bar and text options in C# ASP.NET, Windows applications.
Code 128 barcode bar and space module colors in RGB
Code 128 text labe color
Code 128 text font style, font size
Render or hide Code 128 barcode text label
The space between bars and text
Code 128 bar & space modules colors
Using property BarColor and BackgroundColor in class BarcodeLib.Barcode.Linear to set the Code 128 bar and space modules' colors in C# class.
Please note, you cannot change the text font size directly through TextFont. To change the Code 128 text size, please view the following sample C# source code.
You need set the property ResizeText to false. Now you can manually change the Code 128 barcode text size through TextFont using C# barcode library.
Code Set A (or Chars Set A) contains all of the standard upper case U.S. alphanumeric keyboard characters and punctuation characters together with the control characters, (i.e. characters with ASCII values from 0 to 95 inclusive), and seven special characters.
Code Set B (or Chars Set B) contains all of the standard upper case alphanumeric keyboard characters and punctuation characters together with the lower case alphabetic characters (i.e. characters with ASCII values from 32 to 127 inclusive), and seven special characters.
Code Set C (or Chars Set C) contains the set of 100 digit pairs from 00 to 99 inclusive, as well as three special characters. This allows numeric data to be encoded as two data digits per symbol character, at effectively twice the density of standard data.
We recommend you to choose BarcodeType.CODE128 (default value). The C# barcode library will analyze the encoding Code 128 data
and choose the right code sets combination for you in C# application.
The use of Function Code 1 (FNC1) in Code 128 barcodes in the first symbol character position following the Start character has been reserved exclusively for the GS1 system.
To create GS1 compatible Code 128 barcodes (also known as GS1-128, or EAN-128), you need set the property FNC1Mode with value Code128FNC1Mode.FirstPosition.
barcode.FNC1Mode=Code128FNC1Mode.FirstPosition;
To help you easily encode and generate GS1-128, C# Barcode Generator library supports GS1-128 barcodes generation through barcode format BarcodeType.EAN128.