.NET Code 128 barcode generator for c#, vb.net
How to generate barcode code 128 with checksum using c#, vb.net, no truetype font. With free C# example source code.

Complete free c#, vb.net example source code to generate, print barcode code 128 labels in asp.net mvc, windows, crystal reports.

  • Barcode DLL for software developers to generate Code 128 in own applications using C# & VB.NET
  • Strong-named assemblies written in C#.NET with full integration into .NET Framework
  • Print Code 128A, Code 128B & Code 128C barcodes in Visual C# & VB.NET class library
  • Generate Code 128 barcodes in Reporting Services, Crystal Reports & RDLC Reports
  • Automatically add checksum digit in Code 128 barcode image and display it in text
  • Draw and save Code 128 in Png, Jpeg/Jpg, Gif, Tiff, Bmp, etc. image formats
  • Professional Code 128 images with adjustable resolution to go with all printers
KA.Barcode Generator for .NET Suite Introduction
KA.Barcode Generator for .NET Suite is a mature and reliable barcode creator component which can easily add Code 128 and other 1D & 2D barcode generating features in .NET applications like ASP.NET web service, WinForms, Crystal Reports, SQL Server Reporting Services, C# & VB.NET class library. Flexible barcode settings with detailed tutorials are provied to help developers with easy barcode generation in .NET.
Code 128 Barcode Introduction
Code 128, also named 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, is a self-checking linear barcode which encodes 128 ISO/IEC 646 characters.
Code 128 Encodable Character Sets
  • Code 128 A (Code Set A): 0-9, A-Z, and special characters
  • Code 128 B (Code Set B): 0-9, A-Z, a-z, and special characters
  • Code 128 C (Code Set C): numeric digit pairs 00-99
  • Code 128Auto: KA provides Code 128Auto to encode all the above data types with automatic shifting between code sets
Download Code 128 Barcode Creator for .NET Suite
Users are allowed to download KA.Barcode for .NET Suite. After you unzip the evaluation version, you will find the following items: KeepAutomation.Barcode.Crystal.dll, KeepAutomation.Barcode.RDLC.dll, KeepAutomation.Barcode.SSRS2005.dll, KeepAutomation.Barcode.SSRS2005CRI.dll, KeepAutomation.Barcode.SSRS2008.dll, KeepAutomation.Barcode.SSRS2008CRI.dll, KeepAutomation.Barcode.Web.dll & KeepAutomation.Barcode.Windows.dll.
Generate Code 128 Barcode Using C# or VB.NET Class
To generate Code 128 barcode image using C# and VB.NET programming, you should add "KeepAutomation.Barcode.Windows.dll" or "KeepAutomation.Barcode.Web.dll" from the unzipped evaluation package and copy C# or VB sample code below.
C# Sample code
     BarCode code128 = new BarCode();
code128.Symbology = KeepAutomation.Barcode.Symbology.Code128Auto;
code128.CodeToEncode = "Code128";

VB Sample code
     Dim code128 As KeepAutomation.Barcode.Bean.BarCode = New KeepAutomation.Barcode.Bean.BarCode

code128.Symbology = KeepAutomation.Barcode.Symbology.Code128Auto
code128.CodeToEncode = "Code128"

Generate Code 128 Barcode in ASP.NET Project
  1. Newly create your ASP.NET project and copy "barcode.aspx" and "barcode.aspx.cs" in "barcode" folder to your project folder.
  2. Locate "KeepAutomation.Barcode.Web.dll" to your project reference.
  3. Drag and drop "BarCodeControl" in Toolbox to the aspx page where your Code 128 barcode image is to be generated.
  4. In the Properties panel, choose Code128 barcode type.
  5. Debug to view your Code 128 barcode image.
Easy to generate Code 128 in Microsoft Internet Information Services (IIS)
  1. Find the "barcode" folder from the unzipped package and copy it to IIS web application folder.
  2. Create a new virtual directory named "barcode".
  3. Restart your IIS and navigate to "http://YourDomain:port/barcode/barcode.aspx?symbology=7&code-to-encode=Code128" (symboloy: Code128Auto=7, Code128A=8, Code128B=9, Code128C=10).
  4. Use the following image tag to insert barcodes in html or aspx pages:
    <img src="http://YourDomain:port/barcode/barcode.aspx?symbology=7&code-to-encode=Code128"(symboloy: Code128Auto=7, Code128A=8, Code128B=9, Code128C=10)/>
  5. Customize your created Code 128 barcode image in the above url.
Generate Code 128 Barcode in .NET WinForms
  1. Open your Visual Studio and create a new WinForms project.
  2. Add KeepAutomation.Barcode.Windows.dll to your Visual Studio Toolbox.
  3. Go to Toolbox, then drag and drop the BarCodeControl into the form.
  4. Set "Symbology" property to "Code128" in Properties window.
  5. You will see the created Code 128 barcode image.
Generate Code 128 Barcode in .NET Reports

Able to Create Standard Code 128 Barcode Image in Crystal Reports
Code 128 barcode image creation in Crystal Reports is quite easy with this barcode generation library.
Able to Create Standard Code 128 Barcode Image in RDLC Reports
Code 128 barcode image creation in RDLC Reports is quite easy with this barcode generation library.
Able to Create Standard Code 128 Barcode Image in Reporting Services
Code 128 barcode image creation in Reporting Services is quite easy with this barcode generation library.
Code 128 Property Settings
Class Attribute HTTP Attribute Default Value Note
Symbology symbology Code128Auto Barcode symoblogy type.

Valid values for Code 128 are:
  • KeepAutomation.Barcode.Symbology.Code128Auto

  • KeepAutomation.Barcode.Symbology.Code128A

  • KeepAutomation.Barcode.Symbology.Code128B

  • KeepAutomation.Barcode.Symbology.Code128C
CodeToEncode code-to-encode "128" Barcode value to encode.
  • Valid Data Scope for Code 128 Auto (KeepAutomation.Barcode.Symbology.Code128Auto):

    All 128 characters of ASCII (ASCII values from 0 to 127)

  • Valid Data Scope for Code 128 Set A (KeepAutomation.Barcode.Symbology.CODE128A):

    Supports ASCII values from 0 to 95

  • Valid Data Scope for Code 128 Set B (KeepAutomation.Barcode.Symbology.CODE128B):

    Supports ASCII values from 32 to 127

  • Valid Data Scope for Code 128 Set C (KeepAutomation.Barcode.Symbology.CODE128C):

    Supports pairs of digits
ChecksumEnabled checksum-enabled false This property is not applied here. Barcode SDK will always add a check character between encoded data and stop character (modulo 103).
ImageFormat image-format ImageFormat.Png Barcode encoded image format.
Barcode Size
AutoSizeAdjust auto-size-adjust false If true, barcode X, Y module will be auto-adjusted.
BarcodeUnit barcode-unit BarcodeUnit.Pixel Unit of measure for all size related settings. 0: pixel; 1: inch; 2: cm.
X x 1 Barcode module width (narrow bar).
Y y 50 Linear barcode bar height / 2D barcode module height.
LeftMargin left-margin 0 Barcode image left margin.
RightMargin right-margin 0 Barcode image right margin.
TopMargin top-margin 0 Barcode image top margin.
BottomMargin bottom-margin 0 Barcode image bottom margin.
DPI dpi 72 Barcode image resolution in dpi.
Orientation orientation Orientation.Degree0 Barcode rotation angle.
BarCodeWidth barcode-width 0 Whole barcode width.
BarCodeHeight barcode-height 0 Whole barcode height.
Barcode Text Style
DisplayText display-text true Set to true, displaying barcode value text, otherwise do not display.
DisplayChecksum displace-checksum true Set to true, displaying barcode checksum digit, otherwise do not display.
TextFont text-font new Font(" Arial", 10 f, FontStyle.Regular) Barcode text font style.
TextMargin text-margin 6 Margin between barcode and text.
Free Trial DownloadC#/VB Code 128For Web Code 128For Windows Code 128For Reports Code 128Using C#Using VB.NETData Matrix for .NETPDF417 for .NETQR Code for .NETmoreCodabar for .NETCode 39 for .NETEAN-8 for .NETEAN-13 for .NETEAN 128 for .NETIntelligent Mail for .NETInterleaved 2 of 5 for .NETISBN for .NETITF-14 for .NETRM4SCC for .NETUPC-A for .NETUPC-E for .NETmore
KeepAutomation provides complete barcode automation solutions. We recommend the customers use high quality document controls: ASP.NET Document Viewer, ASP.NET MVC Document Viewer, Document Viewer ASP.NET C#, ASP.NET PDF Viewer, ASP.NET Word Viewer, ASP.NET Excel Viewer, ASP.NET PDF Editor, MVC PDF Viewer, ASP.NET Annotate PDF, c# pdf sdk, C# View, edit PDF online , C# Convert PDF to Tiff, C# Convert PDF to text, txt, .net imaging sdk, C# PDF metadata edit from RasterEdge.com.