BizCode Barcode Generator for ASP.NET
The most professional barcode solutions for Microsoft ASP.NET
Quick Overviews
  • Barcode creating class library
  • Support ASP.NET IDEs & IIS
  • Easy to use & integrate
  • Dynamic barcodes support
  • High-usability controls provided
How to Set Code 128 Size in ASP.NET
.NET Code 128 Barcode Control for ASP.NET is one function of .NET Barcode Generator for ASP.NET, which provides high performance barcode creation component for your ASP.NET projects. It supports accurate Code 128 barcodes to be generated efficiently and fast according to Code 128 barcode specification in ISO - ISO / IEC 15417 (2nd edition 2007-06-01).
Code 128 barcode size related features, like Barcode Width, Barcode Height, X, Y, Image Margins are also provided for the users. More information about Code 128 barcode related property settings, please see:
Code 128 Size Related Properties

Barcode Resolution

Barcode Generator for ASP.NET provides Resolution class for users, if they want to set the Code 128 barcode images resolution in DPI which specifies the number of dots that a printer or device (like a monitor) can display per linear inch; the higher the Dpi, the higher the resolution.

Barcode Unit

Barcode Generator for ASP.NET provides BarcodeUnit class for users, if they want to choose Pixel, Inch or Cm as the unit measurement for Code 128 barcode size.

Quiet Margin

Barcode Generator for ASP.NET provides QuietMargin class for users, if they want to adjust quiet margins of top, bottom, right and left surrounding generate Code 128 barcode images.

Bar Width & Height

Barcode Generator for ASP.NET provides BarWidth and BarHeight class for users, if they want to adjust generated Code 128 barcode symbol size through controlling the width and height of each bar.

Barcode Width & Height

Barcode Generator for ASP.NET provides BarcodeWidth and BarcodeHeight class for users to, if they want to control the width and height of the whole Code 128 barcode size, including barcode symbol image, encoded characters and quiet margins.
Customize Code 128 Barcode Sizes in ASP.NET & IIS
Be sure that you have installed those following programs onto your computers:
  • Microsoft .NET Framework 2.0/3.0/4.0
  • Microsoft Visual Studio 2005/2008/2010 (Express, Professional & Standard Edition)
  • Microsoft Internet Information Service (IIS)
  • Barcode Generator for ASP.NET installed
Customize Code 128 Barcode Images in ASP.NET Web Forms Using BarcodeControl
  1. Add ASP.NE Barcode Control onto your .NET Visual Studio Toolbox;
  2. Drag and drop the WebLinearBarcode control into the Forms;
  3. Run the website and you will see a barcode image generated;
  4. Go to Address bar and change your URL with following one: http://localhost/br_barcode/linear.aspx?code=0123456789&symbology=7&resolution=104&bar-width=3&bar-height=75&barcode-width=450&barcode-height=100&top-margin=2&bottom-margin=2&right-margin=5&left-margin=5;
  5. Then a Code 128 with customized size occurs.
Customize Code 128 Barcode Sizes in ASP.NET Using C#, VB.NET Class
using BusinessRefinery.Barcode;

Linear barcode = new Linear();
barcode.Symbology = Symbology.CODE128;
barcode.Code = "0123456789";

// Change Code 128 barcode unit measuirement in Pixel, Inch and Cm
barcode.BarcodeUnit = BarcodeUnit.PIXEL;

// Change Code 128 resolution in DPI
barcode.Resolution = 104;
// Specify Code 128 barcode width & height
barcode.BarcodeHeight = 100;
barcode.BarcodeWidth = 500;

barcode.BarHeight = 75;
barcode.BarWidth = 3;

// Control Code 128 barcode top margin, bottom margin, right margin and
left margin size

barcode.BottomMargin = 7;
barcode.TopMargin = 7;
barcode.LeftMargin = 5;
barcode.RightMargin = 5;
barcode.drawBarcode2SizeFile("c:/Code 128-csharp.gif");
Dim barcode As BusinessRefinery.Barcode.Linear = 
New BusinessRefinery.Barcode.Linear()
barcode.Symbology = BusinessRefinery.Barcode.Symbology.CODE128
barcode.Code = "0123456789"'

' Change Code 128 barcode unit measuirement in Pixel, Inch and Cm
barcode.BarcodeUnit = BarcodeUnit.PIXEL

' Change Code 128 resolution in DPI
barcode.Resolution = 104;
' Specify Code 128 barcode width & height
barcode.BarcodeHeight = 100
barcode.BarcodeWidth = 500

barcode.BarHeight = 75
barcode.BarWidth = 3

' Control Code 128 barcode top margin, bottom margin, right margin and
left margin size

barcode.BottomMargin = 7
barcode.TopMargin = 7
barcode.LeftMargin = 5
barcode.RightMargin = 5
barcode.drawBarcode2SizeFile("c:/Code 128-vb-net.gif")
Customize Code 128 Barcode Sizes in Internet Information Service (IIS)
  1. Download Barcode Generator for ASP.NET and unzip;
  2. Copy the whole barcode fold and contents into IIS and create a new virtual directory called "br_barcode" ;
  3. Restart IIS, navigate to
    http://localhost/br_barcode/linear.aspx?code=0123456789&symbology=7&resolution=104&bar-width=3&bar-height=75&barcode-width=450&barcode-height=100&top-margin=2&bottom-margin=2&right-margin=5&left-margin=5;
  4. Then a Code 128 with customized size occurs.