How to Create Barcodes in .NET Suite with a Given Size
In addition to ease of use, BizCode Generator for .NET Ultimate allows linear and 2D barcodes to be generated in a given size, which may be necessary when printing barcodes at very precise X dimensions or if it is necessary to fit barcode images in an area of 1.5 inch x 1 inch or 280 pixels x 80 pixels etc.
This professional .NET Suite enables users to generate barcodes with a fixed size in ASP.NET and Winforms applications using C#, VB.NET class library, as well as Microsoft IIS.
Compatibility & Requirements
.NET Development Environments
- Visual studio 2005/2008/2010 installed - .NET Version is greater than 2.0 - C#.NET, VB. NET, or Borland Delphi
|
Compatible Project Types
- ASP.NET web application (design-time and runtime support) - Windows Application (design-time and runtime support) - .NET Console Application (runtime support) - .NET Class Library (runtime support) - Microsoft IIS
|
Compatibility & Test Environment
Compatible Operating Systems
- Microsoft Windows 7 - Windows Server 2008 - Windows Vista - Windows Server 2003 - Windows XP
|
Test Environment:
- Microsoft Windows XP - Microsoft Visual Studio 2005 - Windows Application - ASP.NET Web Site & Microsoft IIS - Visual C#.NET & Visual Basic.NET
|
How to Create Barcodes in ASP.NET and Winforms with Given Size
- Click to download Barcode Generator for .NET Suite trial version free;
- Start Microsoft Visual Studio;
- Create a Windows Forms Application or ASP.NET Application using the installed
- project template in Visual C#;
- Copy BusinessRefinery.Barcode.Web.dll or BusinessRefinery.Barcode.Wi.dll to your project folder; (There is no need to copy .dll to .NET bin directory, Visual Studio will do so)
- Add Barcode Control to your Visual Studio Toolbox;
- If you are creating barcodes on web applications, make sure copy "linear.aspx" and "linear.aspx.cs" to the folder where your aspx pages are generating barcodes;
- Now you are able to drag and drop barcode items from toolbox to forms. Size could be adjusted throught property setting panel or VB & C# codes below.
Sample Codes to Generate Barcode in Given Size
Copy these following code to .NET project:
using BusinessRefinery.Barcode;
BusinessRefinery.Barcode.Linear barcode = new BusinessRefinery.Barcode.Linear();
barcode.Symbology = BusinessRefinery.Barcode.Symbology.CODE39;
barcode.Code = "0123456789";
barcode.BarcodeHeight = 1;
barcode.BarcodeWidth = 1;
barcode.Format = System.Drawing.Imaging.ImageFormat.Gif;
barcode.drawBarcode2ImageFile("c:/code-39-csharp.gif");
Dim barcode As BusinessRefinery.Barcode.Linear = New BusinessRefinery.Barcode.Linear()
barcode.Symbology = BusinessRefinery.Barcode.Symbology.CODE39
barcode.Code = "0123456789"
barcode.BarcodeHeight = 1
barcode.BarcodeWidth = 1
barcode.Format = System.Drawing.Imaging.ImageFormat.Gif
barcode.drawBarcode2ImageFile("c:/code-39-vb-net.gif")
How to Create Barcodes in ASP.NET with Fixed Bar Width
- Open Microsoft Visual Studio;
- Create a Windows Forms Application or ASP.NET Application using the installed project template in C# or VB;
- Copy BusinessRefinery.Barcode.Web.dll or BusinessRefinery.Barcode.Wi.dll to your project folder; (There is no need to copy .dll to .NET bin directory, Visual Studio will do so)
- Add the generation DLL to your project reference;
Copy following codes to change barcode size.
Sample Codes to Generate Barcode in Given Size
Copy these following code to .NET project:
using BusinessRefinery.Barcode;
BusinessRefinery.Barcode.Linear barcode = new BusinessRefinery.Barcode.Linear();
barcode.Symbology = BusinessRefinery.Barcode.Symbology.CODE39;
barcode.Code = "0123456789";
barcode.BarWidth = 2;
barcode.BarHeight = 60;
barcode.Format = System.Drawing.Imaging.ImageFormat.Gif;
barcode.drawBarcode2ImageFile("c:/code-39-csharp.gif");
Private Sub WinLinearBarcode1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles WinLinearBarcode1.Load
Dim barcode As BusinessRefinery.Barcode.Linear = New BusinessRefinery.Barcode.Linear()
barcode.Symbology = BusinessRefinery.Barcode.Symbology.CODE39
barcode.Code = "0123456789"
barcode.BarWidth = 2
barcode.BarHeight = 60
barcode.Format = System.Drawing.Imaging.ImageFormat.Gif
barcode.drawBarcode2ImageFile("c:/code-39-vb-net.gif")
How to Create Barcodes in IIS with a Given Size
- Download Barcode Generator for .NET Suite trial version free and copy the whole barcode fold and contents into IIS and create a new virtual directory called "br_barcode";
- Restart IIS, navigate to http://localhost/br_barcode/linear.aspx?code=0123456789&symbology=4&BarcodeHeight =1&BarcodeWidth =1;
- Add an image tag
into the web page to create Code 39 barcode image in html or aspx pages, e.g.
< img src=" http://localhost/br_barcode/linear.aspx?code=0123456789&symbology=4&BarcodeHeight =1&BarcodeWidth =1;"/>.