Java Barcode QR-Code Generator

Create, Generate, Draw, Print Barcode QR-Code in Java Application


  • Easy to generate QR-Code barcodes in Java Class, J2EE applications
  • Simple to redistribute Java QR-Code barcode library. No registration key. No activation code.
  • Generating high quality QR-Code Bar Code images in GIF, PNG, JPEG, EPS & BITMAP
  • Generate QR-Code barcodes in Jasper Reports, iReport & Eclipse BIRT
  • Compatible with ISO / IEC 18004 (2rd edition 2006-09-01)
  • Completely developed in Java
  • Mature QR-Code barcode generation Java library used by 2000+ clients
Index
 

Java Barcode QR-Code Generator Introduction

Java Barcode is a Java barcode generator which generates high quality 1D (linear) and 2D (matrix) barcodes in Java, Jasper Reports, iReport, and Eclipse BIRT projects.

 

Barcode QR-Code Introduction

QR Code is a matrix code (or two-dimensional bar code) created by Japanese corporation Denso-Wave in 1994. The "QR" is derived from "Quick Response", as the creator intended the code to allow its contents to be decoded at high speed.

 

Java QR-Code Generator - Valid Data Scope

Java QR Code Generator encodes:



 

Java Barcode QR-Code Generation FAQ?

  1. How to generate barcode QR-Code in Java class?

    // Create Java QRCode object 
    QRCode barcode = new QRCode(); 
    
    // Set QRCode data text to encode
    barcode.setData("Create-QR-Code-in-Java"); 
    
    // Generate QRCode barcode & print into Graphics2D object
    barcode.drawBarcode("Java Graphics2D object"); 
    
    // Generate QRCode barcode & encode into GIF format
    barcode.drawBarcode("C://barcode-qrcode.gif"); 
    
    // Generate QRCode barcode & encode into JPEG format
    barcode.drawBarcode("C://barcode-qrcode.jpg"); 
    
    


  2. How to generate & encode QR-Code barcodes to EPS?

    // Create Java QRCode object 
    QRCode barcode = new QRCode(); 
    
    // Set QRCode data text to encode
    barcode.setData("Create QRCode in EPS"); 
    
    // Generate QRCode barcode & encode into EPS
    barcode.drawBarcode2EPS("C://barcode-qrcode.eps"); 


  3. How to create & encode QR-Code image in html or jsp pages?



    • Under demo package, copy barcode folder and its contents to your tomcat.

    • Start tomcat, navigate to http://YourDomain:Port/barcode/qrcode?DATA=QRCode

    • To create bar code images in html or jsp pages, you can insert a image tag (img) into your page.
      For example, <img src="http://YourDomain:Port/barcode/qrcode?DATA=QRCode" />



  4. How to create & print barcode QR-Code image in Java Servlet class?

    import com.onbarcode.barcode.AbstractBarcode; 
    import com.onbarcode.barcode.QRCode; 
    import javax.servlet.http.HttpServlet; 
    import javax.servlet.http.HttpServletRequest; 
    import javax.servlet.http.HttpServletResponse; 
    import javax.servlet.ServletException; 
    import javax.servlet.ServletOutputStream; 
       
    public class BarcodeServlet extends HttpServlet 
    { 
        public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException 
        { 
            try { 
                QRCode barcode = new QRCode(); 
                barcode.setData("QRCode"); 
                     
                ServletOutputStream servletoutputstream = response.getOutputStream(); 
                  
                response.setContentType("image/jpeg"); 
                response.setHeader("Pragma", "no-cache"); 
                response.setHeader("Cache-Control", "no-cache"); 
                response.setDateHeader("Expires", 0); 
               
                // Generate QRCode barcode & output to ServletOutputStream
                barcode.drawBarcode(servletoutputstream); 
          
            } catch (Exception e) { 
                throw new ServletException(e); 
            } 
        } 
    } 


  5. How to generate & print barcode QR-Code image in Jasper Reports?



    Complete Guide for Barcode Generation in Jasper Reports

  6. How to generate & print barcode QR-Code image in iReport?



    Complete Guide for Barcode Generation in iReport

  7. How to generate & print barcode QR-Code image in Eclipse BIRT?



    Complete Guide for Barcode Generation in Eclipse BIRT

  8. How to set generated barcode QR-Code image width and height?

    1) You can set barcode image width and height through properties barcodeWidth and barcodeHeight values.

    or

    2) You can set X (bar module width) and Y (bar module height) values

 

Java QR Code Generator - Barcode Property Settings


Java QR Code Generator in Java Class: com.onbarcode.barcode.QRCode

Category Class Properties Servlet Properties Default Comments
Basic data DATA "" value to encode
 
QRCode
Special
processTilde PROCESS-TILDE false Set the processTilde property to true, if you want use the tilde character "~" to specify special characters in the input data. Default is false.
~NNN: is used to represent the ASCII character with the value of NNN. NNN is from 000 - 255.
dataMode DATA-MODE 0 (QRCode.M_AUTO)
  • QRCode.M_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
  • QRCode.M_ALPHANUMERIC: It allows encoding alphanumeric data (digits 0 - 9; upper case letters A -Z; nine other characters: space, $ % * + - . / : ).
  • QRCode.M_BYTE: It allows encoding byte data (default: ISO/IEC 8859-1).
  • QRCode.M_NUMERIC: It allows encoding numeric data (digits 0 - 9).
  • QRCode.M_KANJI: It allows encoding Kanji characters.
ecl ECL 0 QRCode Error Correction Level. Default is QRCode.ECL_L (0).
  • QRCode.ECL_L (0)
  • QRCode.ECL_M (1)
  • QRCode.ECL_Q (2)
  • QRCode.ECL_H (3)
eci ECI 3 Valid values are from 000000 to 999999.
fnc1Mode FNC1MODE IBarcode.FNC1_NONE (0) valid values:
IBarcode.FNC1_NONE (0)
IBarcode.FNC1_ENABLE (1)
applicationIndicator AI 0  
isStructuredAppend STRUCTURE-APPEND false Set isStructuredAppend property to true, then Structured Append is enabled.
symbolCount SYMBOL-COUNT 0 the number of total symbols which make the sequence.
symbolIndex SYMBOL-INDEX 0 the position of current symbol in the secuence (Start with 0).
parity PARITY 0  
version VERSION 1 Valid values are from 1 to 40.
 
Size Related uom UOM 0 Unit of meature for all size related setting in the library.
0: pixel; 1: inch; 2: cm.
X X 2 width of barcode module (narrow bar), default is 2 pixel
barcodeWidth BARCODE-WIDTH 0 generted barcode image width
barcodeHeight BARCODE-HEIGHT 0 generted barcode image height
leftMargin LEFT-MARGIN 0 image left margin
rightMargin RIGHT-MARGIN 0 image right margin
topMargin TOP-MARGIN 0 image top margin
bottomMargin BOTTOM-MARGIN 0 image bottom margin
resolution RESOLUTION 72 in DPI
rotate ROTATE IBarcode.ROTATE_0 (0) valid values:
IBarcode.ROTATE_0 (0),
IBarcode.ROTATE_90 (1),
IBarcode.ROTATE_180 (2),
IBarcode.ROTATE_270 (3)



All Java Barcode Generator Supporting Bar Code Symbology Types



Java Barcode Generator Tutorial