How to Generate Barcodes in .NET Application
How to Insert Linear and 2D Barcode Images in C#, VB.NET, ASP.NET & WinForms Applications
- Strong-named assemblies written in C#.NET with full integration into .NET applications
- Totally compatible with Microsoft Visual Studio .NET 2005, 2008 and 2010 versions
- Enable 1d & matrix barcode types to be generated using C# and VB programming languages
- Support adding barcodes in ASP.NET websites, Microsoft IIS, WinForms and Reporting applications
- Print more than 20 barcode types, including QR Code, Data Matrix, Code 39, EAN-13, ISBN, ITF-14, etc
- Complete property control to set barcode minimum size, bitmap image format, text, resolution, etc
- Provide developer guide with detailed C# and VB.NET demo codes to draw barcodes in .NET projects
Download Free KA.Barcode for .NET Suite Evaluation
You can use this evaluation/trial version indefinitely free of charge.
A "KA Barcode" watermark is visible on barcodes generated with this evaluation/trial version. So this version is not allowed for any business projects. For any commercial purpose, you must purchase one of this product licenses.
How to Generate Barcode Image in .NET WinForms
It is easy to create barcode images in .NET Windows Forms application in the following steps.
- Create a .NET WinForms project in your Visual Studio.
- Add reference (KeepAutomation.Barcode.Windows.dll) to your Visual Studio Toolbox.
- Drag and drop the BarCodeControl into the Forms and a barcode image is generated.
- Change barcode types and customize image settings in the Properties panel.
- Click the barcode image to view the updated image in the form.
How to Generate Barcode Image in ASP.NET Web Form
You can follow steps below to draw linear and 2D barcode images in ASP.NET web application.
- Open Visual Studio and create a new ASP.NET web project.
- Copy "barcode.aspx" and "barcode.aspx.cs" to your project folder.
- Right-click in the Toolbox, select "Choose Items..." > "Browse...", and choose "KeepAutomation.Barcode.Web.dll".
- Drag and drop "BarCodeControl" in Toolbox to your ASPX page for barcode generation.
- Run the project to generate the barcode image on your web page. You can customize this barcode through the Properties panel.
You are also able to generate 1D and 2D barcode images in IIS in a few operations as below.
- Please unzip the trial package and copy "barcode" folder and its contents to your IIS.
- Create a new virtual directory and link to the above "barcode" folder.
- Restart your IIS and navigate to
- Now a Code 39 image is generated, and you can change barcode type and properties in the url with the http parameters.
- To add the created barcode images in html or aspx pages, simply insert the following image tag into your web pages <img src="http://YourDomain:port/barcode/barcode.aspx?code-to-encode=3939&symbology=4"/>
|HTTP Attribute (Linear & Matrix Barcodes)
|Codabar = 0
||Code 11 = 1
||Code 2 of 5 = 2
||Interleaved 2 of 5 = 3
|Code 39 = 4
||Code39 ex = 5
||Code 93 = 6
||Code128Auto = 7
|Code128A = 8
||Code128B = 9
||Code128C = 10
||EAN128 = 11
|EAN8 = 12
||EAN8Sup2 = 13
||EAN8Sup5 = 14
||EAN13 = 15
|EAN13Sup2 = 16
||EAN13Sup5 = 17
||ISBN = 18
||ISBNSup2 = 19
|ISBNSup5 = 20
||ISSN = 21
||ISSNSup2 = 22
||ISSNSup5 = 23
|ITF-14 = 24
||Identcode = 25
||Leitcode = 26
||MSI = 27
|MSI10 = 28
||MSI11 = 29
||MSI1010 = 30
||MSI1110 = 31
|IntelligentMail = 32
||Planet = 33
||Postnet = 34
||RM4SCC = 35
|UPC-A = 36
||UPCASup2 = 37
||UPCASup5 = 38
||UPC-E = 39
|UPCESup2 = 40
||UPCESup5 = 41
||DataMatrix = 101
||PDF-417 = 102
|QRCode = 103
How to Generate Barcode Using C# and VB.NET Class Library
You can use the following C# and VB sample codes to generate barcodes in .NET applications. Before that, you need to add reference (KeepAutomation.Barcode.Windows.dll or KeepAutomation.Barcode.Web.dll) to your project.
C# Sample code
BarCode barcode = new BarCode();
barcode.Symbology = KeepAutomation.Barcode.Symbology.Code39;
barcode. CodeToEncode = "224466";
VB Sample code
Dim barcode As KeepAutomation.Barcode.Bean.BarCode = New KeepAutomation.Barcode.Bean.BarCode
barcode.Symbology = KeepAutomation.Barcode.Symbology.Code39
barcode.CodeToEncode = "3939"
barcode.ImageFormat = System.Drawing.Imaging.ImageFormat.Gif()
How to Generate Barcode in .NET Reporting Projects
Barcode Generation in Crystal Reports
Barcode Generation in RDLC Reports
Barcode Generation in .NET SSRS