KA.Barcode for ASP.NET
How to Generate Code 128 Image in ASP.NET Projects
ASP.NET source code to generate, print Code 128 in various formats using Barcode for ASP.NET Control
  • Compatible with .NET Framework and ASP.NET development environments
  • Mature, flexible 1D Code 128 generation API SDK for ASP.NET, C#,VB.NET
  • Simple to integrate into Microsoft Internet Information Service (IIS)
  • Drag ASP.NET Code 128 barcode library to ASP.NET project for simple Code 128 integration
  • Other barcode solutions provided - barcode ASP.NET, .NET WinForms barcode, Excel barcode, etc.
  • Encode and output multiple high quality Code 128 1D barcodes in GIF, BMP/Bitmap, PNG, JPEG, TIFF files
  • Enable to control Code 128 barcode size, image resolution, rotation, and font style in ASP.NET Class
  • Compatible with Code 128 bar code specification in ISO - ISO / IEC 15417 (2nd edition 2007-06-01)
  • Recongize linear & 2D barcodes using .NET WinForms barcode or ASP.NET barcode
  • Mature, reliable Linear Code 128 barcode generating DLL used world-wide
Code 128 barcode maker component library SDK for ASP.NET allows developers to generate & print Code 128 barcodes in ASP.NET webform/ websites/ web pages for all web browsers that display GIF, JPEG or PNG images on any operating system. This tutorial page tells how to customize Code 128 pictures with KA.Barcode Generator for ASP.NET; Other user guides for Code 128 data encoding and size setting are also provided, please see:
Code 128 Image Setting with C#, VB.NET Class in ASP.NET

Install Code 128 Barcode Maker Web Control SDK into ASP.NET Projects

  1. 1.
  2. 2.
    Add reference: Add "KeepAutomation.Barcode.Web.dll" to your ASP.NET project reference
  3. 3.
    Add to toolbox: To add BarcodeControl to your ASP.NET toolbox
Copy those following C# or VB.NET sample codings onto you forms to convert text into a Code 128:
using KeepAutomation.Barcode.Bean;
BarCode barcode= new BarCode();
barcode.Symbology= KeepAutomation.Barcode.Symbology.Code128Auto;
barcode.CodeToEncode = "Code 128";
Dim barcode As KeepAutomation.Barcode.Bean.BarCode = New KeepAutomation.Barcode.Bean.BarCode

barcode.Symbology= KeepAutomation.Barcode.Symbology.Code128Auto
barcode.CodeToEncode = "Code 128"

Change Code 128 Barcode Image Resolution

KA.Barcode Generator for ASP.NET is used to display high quality barcode images in Window Applications. The default resolution of Code 128 generated by KA.Barcode Generator for ASP.NET is 72 DPI. DPI is short for Dots per Inch.

Adjust Code 128 Barcode Horizontal Alignment inside the Image

Besides image resolution, the placement of barcode horizontal alignment inside the image makes Code 128 barcodes look different. Using KA.Barcode Generator for ASP.NET, you can easily change bar alignment with "BarAlignment" to "right", "center" or "left"; and the default is "Center".
barcode.BarAlignment = AlignmentHori.Center;
barcode.BarAlignment = AlignmentHori.Center

Colorize Code 128 Barcode Images

For some purpose, users need colorful barcodes. With KA.Barcode Generator for ASP.NET, you can easily change Code 128 barcode background and foreground color to suit their needs with "BackColor" & "ForeColor" properties; and the default values are "White" and "Black" respectively.
barcode.BackColor = Color.White;
barcode.ForeColor = Color.Blue;
barcode.BackColor = Color.White
barcode.ForeColor = Color.Blue
Code 128 Image Setting with Drag & Drop BarcodeControl into WebForm
  1. 1.
    In "Choose Toolbox Items" form, click button "Browse...", and select KeepAutomation.Barcode.Web.dll
  2. 2.
    Now you'll see BarCodeControl in your toolbox
  3. 3.
    Drag and drop the BarCodeControl into the Forms and a Codabar image is generated
  4. 4.
    Open your barcode setting panel
  5. 5.
    Choose "Symbology" to "Code128"
  6. 6.
    Set "DPI" to "76" and "BarAlignment" to "Center"
  7. 7.
    Then a Code 128 with customized image occurs
Code 128 Image Setting in Internet Information Service (IIS)
  1. 1.
    Copy folder "barcode" in your download the trial package to your IIS web application folder
  2. 2.
    Create a virtual directory, named "barcode", and link to your just copied "barcode" folder
  3. 3.
    Restart IIS and now you have successfully installed the ASP.NET Barcode Generator web application
  4. 4.
    To test it, open your web browser, and navigate to "http://localhost/barcode/barcode.aspx?symbology=4&code-to-encode=0123456789&dpi=72&bar-alignment=2&fore-color=gray&back-color=darkred"
  5. 5.
    A Code 128 barcode with numeric data will be displayed
  6. 6.
    If you want to barcode embed in HTML or ASP scripts as an image, insert the <IMG> tag: <img src="http://localhost/barcode/barcode.aspx?symbology=4&code-to-encode=0123456789&dpi=72&bar-alignment=2&fore-color=gray&back-color=darkred" />