.NET QR Code Generator Library
How to create, make, generate QR Code using C#, vb.net in asp.net mvc with free c# open source example code
Free C#, VB.NET example code to use .net qr code generator library in asp.net mvc, crystal reports, ssrs reports.
- Mature and reliable matrix QR Code barcode control dll used world-wide
- Fully integrate with Microsoft Visual Studio 2005/2008/2010 & .NET Framework versions
- Accurate 2D QR Code generation dll compatible with ISO / IEC 18004 (2nd edition 2006-09-01)
- Generate dynamic 2D QR Code in ASP.NET, .NET WinForms, IIS and Reporting Services
- Draw and print QR Code barcode as graphic image without using barcode fonts
- Support customizing generated QR Code barcodes using C# and VB.NET class
- Royalty-free and perpetual licenses provided to this .NET Barcode Generator Suite
.NET QR Code Barcode Generator Overview
As a professional barcode generator control SDK library, KA.Barcode for .NET Suite includes complete and strong functionality for high-quality QR Code encoding and printing in types of .NET projects, such as ASP.NET web forms, windows applications, C#, VB.NET class, .NET console applications, Crystal Reports, RDLC Reports & SSRS. This page is a detailed guide that allows developers to know how to add high quality QR Code in .NET environment projects and resize barcode image.
qr code in c# windows application,
how to generate qr code vb.net,
read barcode from image c# free library,
qr code c#,
generate barcode in asp.net c#,
barcode in rdlc
2D QR Code Barcode Introduction
QR Code, also known as Denso Barcode, QRCode, Quick Response Code, JIS X 0510, ISO/IEC18004, is a kind of 2-D symbol which can be easily interpreted by scanner equipment. However, unlike other 1D or 2D barcode, QR code has higher reliabilities, higher speed scanning and smaller printout size. Download QR Code Barcode Generator for .NET
The free trial package of KA.Barcode for .NET Suite contains three folders (barcode, Buy Now, Help and License) and the following eight dlls:
- KeepAutomation.Barcode.Crystal.dll
- KeepAutomation.Barcode.RDLC.dll
- KeepAutomation.Barcode.SSRS2005.dll
- KeepAutomation.Barcode.SSRS2005CRI.dll
- KeepAutomation.Barcode.SSRS2008.dll
- KeepAutomation.Barcode.SSRS2008CRI.dll
- KeepAutomation.Barcode.Web.dll
- KeepAutomation.Barcode.Windows.dll
You can use this trial version for an unlimited period of time on your computer. But it cannot be used for business applications for a "KA Barcode" watermark will appear on the resulting barcode randomly. How to Generate QR Code Using C#.NET, VB.NET
You can generate QR Code barcode in .NET projects using C# or VB class by adding reference ("KeepAutomation.Barcode.Windows.dll" or "KeepAutomation.Barcode.Web.dll") to your Visual Studio project and compiling the following C# and VB sample codes. C# Sample code
using KeepAutomation.Barcode.Bean;
BarCode qrcode = new BarCode(); qrcode.Symbology = KeepAutomation.Barcode.Symbology.QRCode; qrcode.QRCodeVersion = KeepAutomation.Barcode.QRCodeVersion.V10; qrcode.QRCodeECL = KeepAutomation.Barcode.QRCodeECL.M; qrcode.CodeToEncode = "0123456789"; qrcode.X = 3; qrcode.Y = 3; qrcode.TopMargin = 12; qrcode.BottomMargin = 12; qrcode.LeftMargin = 12; qrcode.RightMargin = 12; qrcode.QRCodeDataMode = KeepAutomation.Barcode.QRCodeDataMode.Auto; qrcode.generateBarcodeToImageFile("c://qrcode-csharp.png");
VB Sample code
Dim qrcode As KeepAutomation.Barcode.Bean.BarCode = New KeepAutomation.Barcode.Bean.BarCode
qrcode.Symbology = KeepAutomation.Barcode.Symbology.QRCode qrcode.QRCodeVersion = KeepAutomation.Barcode.QRCodeVersion.V10 qrcode.QRCodeECL = KeepAutomation.Barcode.QRCodeECL.M qrcode.CodeToEncode = "0123456789" qrcode.X = 3 qrcode.Y = 3 qrcode.TopMargin = 12 qrcode.BottomMargin = 12 qrcode.LeftMargin = 12 qrcode.RightMargin = 12 qrcode.generateBarcodeToImageFile("c:/qrcode-vbnet.png")
How to Generate QR Code Barcode in ASP.NET Project
It is able to generate professional QR Code barcode in ASP.NET web forms with this .NET Barcode Generator.
- Download the evaluation package and unzip it.
- Simply create a new ASP.NET project and copy "barcode.aspx" and "barcode.aspx.cs" to the project.
- Add "KeepAutomation.Barcode.Web.dll" to your project reference.
- Drag and drop "BarCodeControl" in Toolbox to the aspx page where your QR Code barcode image is to be generated.
- Select QR Code barcode type through the Properties panel.
- Run you ASP.NET web project to generate your QR Code barcode image.
You can also generate QR Code barcode image in IIS.
- Copy the "barcode" folder and its contents in the downloaded and unzipped package to your IIS.
- Create a new virtual directory named "barcode" and then restart IIS.
- Restart your IIS and navigate to
"http://YourDomain:port/barcode/barcode.aspx?code-to-encode=qrcode&symbology=103" - Add the image tag into target pages to insert barcodes in html or aspx pages:
<img src="http://YourDomain:port/barcode/barcode.aspx?code-to-encode=qrcode&symbology=103"/> - You can also change settings of your created QR Code barcode image in the above url.
How to Generate QR Code Barcode in .NET WinForms
You can also insert QR Code barcode image into .NET Windows Forms.
- First of all, you need to create a WinForms project in your Visual Studio.
- Then, you should add reference (KeepAutomation.Barcode.Windows.dll) to your Visual Studio Toolbox.
- Next, you may drag and drop the BarCodeControl into the form.
- After that, you can switch to the Properties window and set "Symbology" property to "QRCode".
- Finally, you will see the generated QR Code barcode image.
How to Generate QR Code Barcode in .NET Reports
QR Code Barcode Creation in Crystal Reports
QR Code Barcode Creation in RDLC Reports
QR Code Barcode Creation in Reporting Services
QR Code Property Settings
Class Attribute
|
HTTP Attribute
|
Default Value
|
Note
|
Basic
|
Symbology
|
symbology
|
Code128Auto
|
Barcode symoblogy type.
QR Code is
KeepAutomation.Barcode.Symbology.QRCode
|
CodeToEncode
|
code-to-encode
|
"128"
|
Barcode data to encode.
|
ChecksumEnabled
|
checksum-enabled
|
false
|
It is not applied for QR Code.
|
ImageFormat
|
image-format
|
ImageFormat.Png
|
Barcode encoded image format.
|
Barcode Size
|
AutoSizeAdjust
|
auto-size-adjust
|
false
|
If true, barcode X, Y module will be auto-adjusted.
|
BarcodeUnit
|
barcode-unit
|
BarcodeUnit.Pixel
|
Unit of measure for all size related settings. 0: pixel; 1: inch; 2: cm.
|
X
|
x
|
1
|
Barcode module width (narrow bar).
|
Y
|
y
|
50
|
Linear barcode bar height / 2D barcode module height.
|
LeftMargin
|
left-margin
|
0
|
Barcode image left margin.
|
RightMargin
|
right-margin
|
0
|
Barcode image right margin.
|
TopMargin
|
top-margin
|
0
|
Barcode image top margin.
|
BottomMargin
|
bottom-margin
|
0
|
Barcode image bottom margin.
|
DPI
|
dpi
|
72
|
Barcode image resolution in dpi.
|
Orientation
|
orientation
|
Orientation.Degree0
|
Barcode rotation angle.
|
BarCodeWidth
|
barcode-width
|
0
|
Whole barcode width.
|
BarCodeHeight
|
barcode-height
|
0
|
Whole barcode height.
|
2D / Matrix Group Barcode Properties
|
GroupEnabled
|
group-enabled
|
false
|
Set to enable Data Matrix, PDF417, or QR Code group function.
|
GroupItemCount
|
group-item-count
|
0
|
Data Matrix, PDF417, or QR Code group count.
|
GroupItemId
|
group-item-id
|
0
|
Data Matrix, PDF417, or QR Code group item id.
|
GroupId
|
group-item-id
|
0
|
Data Matrix, PDF417, or QR Code group item.
|
QR Code Specific Settings
|
FNC1
|
fnc1
|
FNC1.None
|
To encode GS1 compatible QR Code, you need set value to "FNC1.First"
|
QRCodeDataMode
|
qrcode-data-mode
|
QRCodeDataMode.Auto
|
Set QR Code data encoding mode.
- QRCodeDataMode.Auto: It allows encoding all 256 possible 8-bit byte values. This includes all ASCII characters value from 0 to 127 inclusive and provides for international character set support
- QRCodeDataMode.AlphaNumeric: It allows encoding alphanumeric data (digits 0 - 9; upper case letters A -Z; nine other characters: space, $ % * + - . / : ).Web Stream URL Parameter: Encoding. Valid values are: 0 (Auto), 1 (AlphaNumeric), 2 (Byte), 3 (Numeric), 4 (Kanji).
- QRCodeDataMode.Byte: It allows encoding byte data (default: ISO/IEC 8859-1).
- QRCodeDataMode.Numeric: It allows encoding numeric data (digits 0 - 9).
- QRCodeDataMode.Kanji: It allows encoding Kanji characters.
|
QRCodeECL
|
qrcode-ecl
|
QRCodeECL.L
|
Set QR Code error correction level, including L, M, Q, H.
|
QRCodeVersion
|
qrcode-version
|
QRCodeVersion.V1
|
Set QR Code version, from V1 to V40.
|
QRCodeECI
|
qrcode-eci
|
3
|
QR Code column Extended Channel Interpretations. Valid values are from 000000 to 999999.
|
TildeEnabled
|
tilde-enabled
|
false
|
Set TildeEnabled to true, specifying special characters in barcode data.
Support escape '~' for data message
-
1-byte character: ~ddd (character value from 0 ~ 255)
ASCII (with EXT): from ~000 to ~255
For example, ASCII char [GS] is non-printable, and its decimal value is 29. In barcode data, you need use ~029 for char [GS].
- 2-byte character: ~6ddddd (character value from 0 ~ 65535)
- Unicode: from ~600000 to ~665535
- ECI: from ~7000000 to ~7999999
- SJIS: from ~9ddddd (Shift JIS 0x8140 ~ 0x9FFC and 0xE040 ~ 0xEBBF)
|
How to Create QR Code in Class Library Using C#
Lastly, you can always resort to Visual C# code for easy QR Code barcode generation in .NET projects. Below is the C# sample code for you with some basic settings.
Please copy to your barcoding application for a test. You may make some adjustments for the
QR Code Parameters if necessary.
C# Sample code
BarCode qrcode = new BarCode(); qrcode.Symbology = KeepAutomation.Barcode.Symbology.QRCode;
//Select a QR Code supported data mode according to your code: //AlphaNumeric: for 0 - 9, upper case letters A - Z, and nine punctuation characters space, $ % * + - . / : //Byte data: for (ISO/IEC 8859-1) encoding characters at 8 bits per character //Kanji Characters (JIS) //Numeric: for digits 0 - 9 qrcode.QRCodeDataMode = QRCodeDataMode.Auto;
//Input your QR Code encoding data: qrcode.CodeToEncode = "C#QRCodeGenerator";
// Unit of measure, pixel, cm and inch supported. qrcode.BarcodeUnit = BarcodeUnit.Pixel; // QR Code image resolution in dpi qrcode.DPI = 72; // QR Code bar module width (X dimention) qrcode.X = 3; // QR Code bar module height (Y dimention), Y=X qrcode.Y = 3;
// QR Code image left margin size, the minimum value is 4X. qrcode.LeftMargin = 12; // Image right margin size, minimum value is 4X. qrcode.RightMargin = 12; // Image top margin size, minimum value is 4X. qrcode.TopMargin = 12; // Image bottom margin size, minimum value is 4X. qrcode.BottomMargin = 12;
// QR Code orientation, 90, 180, 270 degrees supported. qrcode.Orientation = KeepAutomation.Barcode.Orientation.Degree0;
// QR Code barcode version, valid from V1-V40 qrcode.QRCodeVersion = QRCodeVersion.V5;
// QR Code barcode Error Correction Lever, supporting H, L, M, Q. qrcode.QRCodeECL = QRCodeECL.H;
// QR Code image formats, supporting Png, Jpeg, Gif, Tiff, Bmp, etc. qrcode.ImageFormat = ImageFormat.Png;
// Generate QR Code barcodes in image format GIF qrcode.generateBarcodeToImageFile("C://barcode-qrcode-csharp.png");
/* Create QR Code barcodes in Stream object qrcode.generateBarcodeToStream(".NET System.IO.Stream Object");
Draw & Print QR Code barcodes to Graphics object qrcode.generateBarcodeToGraphics(".NET System.Drawing.Graphics Object");
Generate QR Code barcodes & write to byte[] byte[] barcodeInBytes = qrcode.generateBarcodeToByteArray();
Generate QR Code barcodes & encode to System.Drawing.Bitmap object Bitmap barcodeInBitmap = qrcode.generateBarcodeToBitmap(); */
QR Code Barcode Generation Using VB.NET Demo Code
You can generate QR Code barcode image using the following VB demo code in .NET applications. According to your needs, you may make some adjustment to the QR Code parameters. Before using the demo code, you need to add reference from the trial package to your project. VB Sample code
Dim qrcode As KeepAutomation.Barcode.Bean.BarCode = New KeepAutomation.Barcode.Bean.BarCode qrcode.Symbology = KeepAutomation.Barcode.Symbology.QRCode
'QR Code Version options, V1-V40 supported. qrcode.QRCodeVersion = KeepAutomation.Barcode.QRCodeVersion.V10 'QR Code Version Error Correction Level, 4 modes (H, L, M, Q) supported. qrcode.QRCodeECL = KeepAutomation.Barcode.QRCodeECL.H 'QR Code data mode, supporting AlphaNumeric, Auto, Byte, Customer, Kanji, Numeric qrcode.QRCodeDataMode = KeepAutomation.Barcode.QRCodeDataMode.Auto 'Set QR Code valid input: All ASCII characters, including 0-9, A-Z, a-z, special characters. Length: variable. qrcode.CodeToEncode = "vbQRCode"
'QR Code unit of measure: pixel, cm and inch qrcode.BarcodeUnit = KeepAutomation.Barcode.BarcodeUnit.Pixel 'QR Code image resolution in dpi qrcode.DPI = 72
'QR Code Size-related Settings 'QR Code bar module width (X dimention) qrcode.X = 2 'QR Code bar module height (Y dimention), Y=X qrcode.Y = 2 'Image margin size, minimum value is 4X on all four sides according to specification. qrcode.LeftMargin = 8 qrcode.RightMargin = 8 qrcode.TopMargin = 8 qrcode.BottomMargin = 8 'Generate Data Matrix in Png, Jpeg, Gif, Bmp, Tiff image formats. qrcode.ImageFormat = Drawing.Imaging.ImageFormat.Png qrcode.generateBarcodeToImageFile("C://qrcode_4_vb.png")
|
Free Trial DownloadC#/VB QR CodeFor Web QR CodeFor Windows QR CodeFor Reports QR CodeHow To Start Using C#Using VB.NETData Matrix for .NETPDF417 for .NETQR Code for .NET moreCodabar for .NETCode 39 for .NETCode 128 for .NETEAN-8 for .NETEAN-13 for .NETEAN 128 for .NETIntelligent Mail for .NETInterleaved 2 of 5 for .NETISBN for .NETITF-14 for .NETRM4SCC for .NETUPC-A for .NETUPC-E for .NETmore
|