Java Barcode Generator, .NET Barcode Generator for C#, ASP.NET, VB.NET
HOME BARCODE FOR .NET PURCHASE

Generating Barcodes in .NET Class




Quick Navigate



 

1. Run Demo Windows Application

  1. Unzip the trial package.
  2. Open it, and go to folder BarcodeDemoSRC. Click and run BarcodeDemo.exe.
  3. To view BarcodeDemo.exe source code (in C#), please go to src folder.
 

2. Install .NET Barcode Dll Component(s)

Add Reference BarcodeLib.Barcode.ASP.NET.dll or BarcodeLib.Barcode.WinFroms.dll to your .NET project.

Do not copy the dll(s) to your project bin directory, Visual Studio will do it for you, during project compilation time.

 

3. Generate Barcodes in .NET Class

The following C#.net code illustrates how to generate a 1d (linear) barcode in a C# class:

     BarcodeLib.Barcode.Linear barcode = new BarcodeLib.Barcode.Linear();

     barcode.Type = BarcodeType.CODE39;

     barcode.Data = "CODE39";

     barcode.UOM = UnitOfMeasure.PIXEL;
     barcode.BarWidth = 1;
     barcode.BarHeight = 80;
     barcode.LeftMargin = 5;
     barcode.RightMargin = 5;
     barcode.TopMargin = 5;
     barcode.BottomMargin = 5;
	
     barcode.ImageFormat = System.Drawing.Imaging.ImageFormat.Png;
	
     // save barcode image into your file system
     barcode.drawBarcode("C://barcode.png");
	
     // generate barcode & output to byte array
     byte[] barcodeInBytes = barcode.drawBarcodeAsBytes();
	
     // generate barcode to Graphics object
     Graphics graphics = ...
     barcode.drawBarcode(graphics);
	
     // generate barcode and output to Bitmap object
     Bitmap barcodeInBitmap = barcode.drawBarcode();
	
     // generate barcode and output to HttpResponse object
     HttpResponse response = ...;
     barcode.drawBarcode(response);
	
     // generate barcode and output to Stream object
     Stream stream = ...;
     barcode.drawBarcode(stream);
 

4. Property Settings for Each Barcode Types











   Copyright BarcodeLib.com. All rights reserved.