- Home
- Products
- Integration
- Tutorial
- Barcode FAQ
- Purchase
- Company
QR Code, also known as Denso Barcode, QRCode, Quick Response Code, is a kind of 2D (two dimensional) barcode widely used today.
Generate and create QR Code barcode using Java is one of the functions in OnBarcode's
Barcode for Java Generating Java library (jar file), which supports
generating & printing QR Code and 20+ other linear & 2D bar codes in Java application and software.
QR Code Generator and Reader library, SDK & application
QR Code Generator components and software include
QR Code .NET,
QR Code C#,
QR Code VB.NET,
QR Code ASP.NET,
QR Code iPhone,
QR Code iPad,
QR Code Android,
QR Code Generator.
This document is providing a detailed Java sample source code about generating QR Code barcodes in Java class using
Java Barcode generation component.
Complete QR Code custmoization settings is included in
Java QR Code generating guide.
Generating QR Code barcode in Java class example:
QRCode barcode = new QRCode(); /* QR Code Valid data char set: numeric data (digits 0 - 9); alphanumeric data (digits 0 - 9; upper case letters A -Z; nine other characters: space, $ % * + - . / : ); byte data (default: ISO/IEC 8859-1); Kanji characters */ barcode.setData("http://www.onbarcode.com"); barcode.setDataMode(QRCode.M_AUTO); barcode.setVersion(10); barcode.setEcl(QRCode.ECL_M); // Set the processTilde property to true, if you want use the tilde character "~" to specify special characters in the input data. Default is false. // 1-byte character: ~ddd (character value from 0 ~ 255) // ASCII (with EXT): from ~000 to ~255 // 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) barcode.setProcessTilde(false); // QR Code unit of measure for X, Y, LeftMargin, RightMargin, TopMargin, BottomMargin barcode.setUom(IBarcode.UOM_PIXEL); // QR Code barcode module width in pixel barcode.setX(3f); barcode.setLeftMargin(10f); barcode.setRightMargin(10f); barcode.setTopMargin(10f); barcode.setBottomMargin(10f); // barcode image resolution in dpi barcode.setResolution(72); barcode.drawBarcode("C:\\qrcode.gif");