KA.Barcode for ASP.NET
How to Create & Resize QR Code in ASP.NET
Complete ASP.NET source code to generate, print QR Code images using Barcode for ASP.NET Control
  • Full integration into .NET Framework 2.0 and above, and ASP.NET development environments like VS.NET
  • Easy to add matrix QR Code barcoding capabilities to ASP.NET IDEs
  • Provide complete tutorials for QR Code image setting in C#, VB.NET and IIS
  • Provide detailed Excel barcode tutorial, .NET barcode tutorial & .NET WinForms barcode guide guides for users
  • Drawing, creating QR Code with cm, inch or pixel as unit of measure for displaying in ASP.NET webform/ websites
  • Create and save QR Code matrix bar codes into 40 different version ranging from V1 to V40
  • Allow developers to programmatically customize module size and image size of QR Code barcode
  • Easy to control quiet zones of top, bottom, right and left surrounding QR Code symbols
  • Java Code 128, EAN 128 C#, ASP.NET ISBN, ITF-14 C# & Intelligent Mail ASP.NET can be created as well
  • Accurate QR Code generation configured to ISO / IEC 18004 (2nd edition)
ASP.NET QR Code generator software plugin is a powerful, reliable barcode generating component API for adding advanced QR Code barcode creation and printing features into you ASP.NET webform/ website/ web pages. In addition, it also support other linear and bidimensional barcode symbologies. Here's a tutorial for resizing QR Code barcode in ASP.NET; other tutorials about QR Code data encoding and image settings in ASP.NET, please see:
2D QR Code Bar Code Structure
QR Code
QR Code barcode (a.k.a Denso Barcode, Quick Response Code) is constructed of:
Function patterns:
  • Finder pattern
  • Separator
  • Timing patterns
  • Alignment patterns
  • Format information
  • Version information
  • Data and Error Correction codewords
QR Code Size Setting with C#, VB.NET Class in ASP.NET

Install QR Code Barcode Generator Control into .NET Projects

  1. 1.
  2. 2.
    Add reference: Add "KeepAutomation.Barcode.Web.dll" to your ASP.NET project reference
  3. 3.
    Add to toolbox: To add BarcodeControl to your ASP.NET toolbox
Copy those following C# or VB.NET barcode onto you forms to produce a QR Code object in ASP.NET:
using KeepAutomation.Barcode.Bean;
BarCode barcode= new BarCode();
barcode.Symbology= KeepAutomation.Barcode.Symbology.QRCode;
barcode.CodeToEncode = "QR Code";
Dim barcode As KeepAutomation.Barcode.Bean.BarCode = New KeepAutomation.Barcode.Bean.BarCode

barcode.Symbology= KeepAutomation.Barcode.Symbology.QRCode
barcode.CodeToEncode = "QR Code"
BarcodeUnit (URL: barcode-unit; Default: Pixel): it is the unit measurement for all size related settings in QR Code barcodes. User may change it with "Pixel", "Inch" and "Cm". Replace sample code with following one:
barcode.BarcodeUnit = KeepAutomation.Barcode.BarcodeUnit.Pixel;
barcode.BarcodeUnit = KeepAutomation.Barcode.BarcodeUnit.Pixel

Drawing QR Code Barcode with Specified Version

QRCodeVersion (URL: qrcode-version; Default: V1): it is used for setting QR Code version from 21x21 (V1) to 177x177 (V40). Replace sample code with following one:
barcode.QRCodeVersion = KeepAutomation.Barcode.QRCodeVersion.V1;
barcode.QRCodeVersion = KeepAutomation.Barcode.QRCodeVersion.V1

Creating QR Code with Defined Bar Width & Height (X & Y)

X (URL: x; Default: 1): it is the width of the narrow bar in QR Code barcodes

Y (URL: y; Default: 50): it is the height of bars in QR Code barcodes.
barcode.X = 3;
barcode.Y = 3;
barcode.X = 3
barcode.Y = 3

Printing QR Code with Fixed BarCodeWidth and BarCodeHeight

BarCodeWidth (URL: barcode-width; Default: 0): it is the barcode width of QR Code barcodes.

BarCodeHeight (URL: barcode-height; Default: 0): it is the barcode height of QR Code barcodes.
barcode.BarCodeWidth = 200;
barcode.BarCodeHeight = 75;
barcode.BarCodeWidth = 200
barcode.BarCodeHeight = 75

Barcoding QR Code Quiet Zones/ Margin

TopMargin (URL: top-margin; Default: 0): it is the barcode image top margin in QR Code barcodes.

BottomMargin (URL: bottom-margin; Default: 0): it is the barcode image bottom margin in QR Code barcodes.

LeftMargin (URL: left-margin; Default: 0): it is the barcode image left margin in QR Code barcodes.

RightMargin (URL: right-margin; Default: 0): it is the barcode image right margin in QR Code barcodes.
barcode.TopMargin = 8;
barcode.BottomMargin = 8;
barcode.LeftMargin = 6;
barcode.RightMargin = 6;
barcode.TopMargin = 8
barcode.BottomMargin = 8
barcode.LeftMargin = 6
barcode.RightMargin = 6
QR Code Size Setting with Drag & Drop BarcodeControl
  1. 1.
    In "Choose Toolbox Items" form, click button "Browse...", and select KeepAutomation.Barcode.Web.dll
  2. 2.
    Now you'll see BarCodeControl in your toolbox
  3. 3.
    Drag and drop the BarCodeControl into the Forms and a Codabar image is generated
  4. 4.
    Find barcode setting panel, choose "Symbology" to "QRCode" and write down encode data
  5. 5.
    Set "BarcodeUnit" to "Pixel", and "QRCodeVersion" to V10
  6. 6.
    Set "X" to 3, "Y" to 3; Set "BarcodeWidth" to 200 and "BarcodeHeight" to 75
  7. 7.
    Set "TopMargin" & "BottomMargin" to 8; and set "RightMarign" & "LeftMargin" to 6
  8. 8.
    A QR Code barcodes with different customized size occurs
QR Code Size Setting in Internet Information Service (IIS)
  1. 1.
    Copy folder "barcode" in your download the trial package to your IIS web application folder
  2. 2.
    Create a virtual directory, named "barcode", and link to your just copied "barcode" folder
  3. 3.

    Restart IIS and now you have successfully installed the ASP.NET Barcode Generator web application
  4. 4.
    To test it, open your web browser, and navigate to "http://localhost/barcode/barcode.aspx?symbology=103&code-to-encode=0123456789&barcode-unit=0&qrcode-version=5&x=3&y=3&barcode-width=200&barcode-height=3&top-margin=8&bottom-margin=8&left-margin=6&right-margin=6"
  5. 5.
    A QR Code barcode with customized size occurs will be displayed