C# Barcode Generator in ASP.NET Application
How to create, print barcode label images for ASP.NET web applications with free C# barcode example source code
Using Free C# Souce Code to Generate Barcode Labels for ASP.NET Web Application & IIS Projects
In this tutorial, you learn how to generate barcode images in ASP.NET web applications
- ASP.NET Web Forms
- Web streaming in IIS
- ASP.NET C# class
- Barcode image with transparent background
- Barcode data with non-printable chars
- Barcode for GS1
- Barcode for non-English text
How to create linear, 2d barcodes in ASP.NET using C#
- Advanced 1D & 2D C# Barcode Design Library for ASP.NET, MVC web applications
- Easily generate and stream high print-quality barcode images to ASP.NET web pages (runtime)
- Dynamically draw GTIN barcodes in C# class library for ASP.NET applications
- All generated barcode images comply with the latest ISO/IEC or GS1 standards
- Simple to print ASP.NET linear bar codes in C# sample code, like Code 39, Code 128, EAN/UPC, ITF-14, Interleaved 2 of 5, Postal barcodes and so on
- Support encoding ASP.NET 2d barcode symbols in C# class, like QR Code,
Micro QR Code,
PDF-417,
Micro PDF-417,
and Data Matrix
- Thermal printer support for C# ASP.NET bar coding with simple button click
- Source code for C# barcode dll provided upon purchase of Unlimited Developer License
Barcode Generator Library for .NET is one of the best .NET Barcode Encoder Control SDK in the market. It completely integrates into ASP.NET C# (& Visual Basic) barcoding applications / web service, as well as Internet Information Services (IIS), C# barcode MVC. Besides, this popular ASP.NET barcode program supports creating linear & matrix barcodes in C# class library, C# Crystal Report.
Recommended here are some more Visual C#.NET barcode implementation tutorial:
- Print C# Barcode - using C# to generate barcode in C# Class & Console projects with free barcode trial download
- Draw C# Barcode WinForms - using C# to draw & paint multiple barcodes images in C# Windows Forms
- Adjust C# Barcode Image - using C#.NET language to encrypt readable barcodes and adjust image properties
- Encode C# Barcode Data - using C# to create GS1 barcode (with given number) or encode Unicode in barcode with C# programming
- Install Barcode Library DLL Solution for ASP.NET.
Please add OnBarcode.Barcode.ASPNET.dll to your Visual Studio ASP.NET web project. - Add Barcode Library dll component for ASP.NET to Visual Studio Toolbox.
Right click Toolbox, select Choose Items..., and click Browse... to locate OnBarcode.Barcode.ASPNET.dll. - Copy qrcode.aspx and qrcode.aspx.cs to the web project folder you created.
Here, we take QR Code as an example. If you want to create linear or other 2d barcodes, please copy respective files to the project folder. - Drag and drop QRCodeWebForm to your ASPX web forms and run the project.
Then a QR Code is created on website page. Parameters are user-defined. Please view API details from QR Code property settings.
How to Generate Barcode in IIS Streaming using C#
Top
- Copy barcode folder and its contents from the downloaded package to your IIS.
- Create a new virtual directory and name it barcode.
- Restart IIS and navigate to (QR Code encoding alphanumeric sample text):
http://YourDomain:Port/barcode/qrcode.aspx?DATA=9876543210
- To display or preview a square QR Code image in html or aspx pages, you may directly use an image tag like the sample below:
<img src="http://YourDomain:Port/barcode/qrcode.aspx?DATA=0123456789"/>
How to Generate Barcode in ASP.NET C# Class
Top
OnBarcode provides complete C# demo codes for quick barcode label printing. Designers can edit settngs to encode barcode value (ie.string, characters or byte array), control barcode vector image (Gif, Jpeg, Png, Tiff formats) or bitmap, adjust barcode size (width, height) and color, auto check digit calculation. For namespace and method to use, please see the sample below.
- Verify that you have installed VS (Visual Studio) 2005, 2008 or 2010.
- Add Barcode Library DLL for ASP.NET to your ASP.NET C# project reference.
- Copy the C# syntax to your barcode system to create a unique QR Code barcode item on ASP.NET web page.
// Create a ASP.NET QR Code object
QRCode qrCode = new QRCode();
// Customize QR Code barcode data
qrCode.Data = "ASP.NET C# QR Code";
// Customize QR Code data mode
qrCode.DataMode = QRCodeDataMode.Auto;
// Customize QR Code barcode size
qrCode.X = 2;
qrCode.LeftMargin = 8;
qrCode.RightMargin = 8;
qrCode.TopMargin = 8;
qrCode.BottomMargin = 8;
// Encode created QR Code to png image file and save it to C:\
qrCode.ImageFormat = System.Drawing.Imaging.ImageFormat.Png;
qrCode.drawBarcode("C://aspnet-csharp-qrcode.png");
How to generate barcode image with transparent background in asp.net using C#
Top
In ASP.NET web streaming
To create transparent background barcode images in IIS asp.net web streaming, you shall apply the following http url properties.
- FORE-COLOR: Barcode bar module color
- TEXT-COLOR: The text color is usually the same as bar module color
- BACK-COLOR: To set transparent background, the value should be "00000000"
- FORMAT: The value should be "png"
Here is a sample url to create a Code 128 barcode image with transparent background in png image.
http://YourDomain:Port/barcode/linear.aspx?TYPE=7&DATA=Code-128&X=3&
FORE-COLOR=ffffff&TEXT-COLOR=ffffff&BACK-COLOR=00000000&TEXT-FONT=Arial|16|Regular&FORMAT=png
In ASP.NET C# class
To generate transparent background barcode image in ASP.NET C# class, please go to the
C# barcode image generator how to page
How to encode, create non-printable chars in barcode images using asp.net c#
Top
Some barcodes, such as Code 128, QR Code supports non-printable chars encoding. Here is an example to encode char 'CR' (Carriage Return).
- Set property ProcessTilde to true.
- Convert non-printable char to '~ddd' format. Here ddd is the char ASCII Integer code. 'CR' should be converted to '~013'.
- Set property Data to '~013'
How to encode, print GS1 data in barcodes using asp.net c#
Top
The GS1 system originated in the United States and was established in 1973 by the Uniform Product Code Council, known until recently as the Uniform Code Council, Inc. (UCC) and since 2005 as GS1 US.
The following barcode symbologes support GS1 data encoding:
- EAN/UPC:
UPC-A,
UPC-E,
EAN-13, and
EAN-8 barcodes, and the two- and five-digit add-on symbols
- ITF-14
- GS1-128 (EAN-128)
- GS1 DataBar
- Composite Component symbols do not exist in isolation. The primary identification number is always encoded in the linear symbol and supplementary GS1 Application Identifier element strings are encoded in the two-dimensional (2D) component where they take up less space
- Data Matrix
- GS1 QR Code
Please read each barcode symbology guide page to encode GS1 data.
How to encode, print non-English chars (such as Thai, Arabic) in barcode images using c# in asp.net application
Top
Most of the barcode types do not support encoding non-English text (such as Thai, Arabic) directly. To encode those chars, you need convert non-English chars into byte array, and encode
byte array into barcode.
2D barcodes
Data Matrix,
PDF-417,
QR Code support byte array data mode. Check each barcode symbology guide page to encode non-English chars.
C#.NET Barcode Generation Guides & Tutorials for Each Barcode
Top
Barcode Control for C#.NET - Bar Code Type Generation