Java QR Code Generator Image Setting Tutorial

sample source code to generate QR Code in png, jpeg, etc. image formats in Java


  • QR Code image width in Java can be changed with Y (bar height), barcodeHeight, topMargin and bottomMargin
  • Easy to generate QR Code images in Java Reports, such as Jasper Report, iReport, Eclipse BIRT and Oracle Reports
  • Check sum digit of QR Code image can be automatically computed
  • Detailed tutorial guide for Java QR Code generator is provided for your easier programming
  • Servlets, Applets, JavaBean and class library are provided in QR Code generator for Java
  • Permanent license with the purchase of the developer license
  • Resolution setting and margin setting to ensure high readability for QR Code
  • Version 1-40 of QR Code are supported

QR Code, also known as Denso Barcode, QRCode, Quick Response Code, is a kind of 2D (two dimensional) barcode widely used today.

Java 2D Barcode Generator consists of three important barcode types which are QR Code in Java, PDF 417 in Java and Data Matrix in Java, all of which supports all detailed guide for data encoding and size seting except image setting:

QR Code Size Setting for Java provides various samples on how to set X, Y, barcodeWidth, barcodeHeight and other properties;

QR Code Data Encoding for Java provides various samples on how to QR Code valid data set and data length.


Java QR Code Image Setting Aspects and Implementation

Java QR Code image setting can be divided into image placement, image color, image resolution and image four aspects to impelment for superb quality 2D QR Code image using Java.

      QRCode barcode = new QRCode();
barcode.setData("QR Code");

QR Code Image Placement Setting in Java

QR Code image placement refers to two aspects which are rotate and barlignment in Java development.

      //For rotating QR Code image, there are four choices which are 0 (IBarcode.ROTATE_0); 1 (IBarcode.ROTATE_90);
        2 (IBarcode.ROTATE_180); 3 (IBarcode.ROTATE_270); default is 0
      barcode.setRotate(IBarcode.ROTATE_10);
//For QR Code barlignment, you can put the QR Code barcode in the left , right and center inside the image in Java. 1: center, 2: right; default is 1: center.Default is 1: center barcode.setbarAlignment(1(center));

Java QR Code Image Color Setting

The color of 2D barcode - QR Code generated in Java refer to two aspects which are bacground color and foreground color by setting to any human-seen color

      barcode.setbackColor(white);
barcode.setforeColor(yellow);

Java QR Code Image Resolution Setting

QR Code image resolution can be set to be any fixed value with QR Code generation library:

      barcode.setResolution(72);

Java QR Code Image Format Setting

Java QR Code generation control supports generating high quality QR Code image with common used image formats like png, tiff, gif, jpeg and bmp. A sample code is below for your easier implementation with just copying and changing to the target format.

      //For bmp image format
      barcode.drawBarcode("C:\\QR Code.bmp");
//For png format barcode.drawBarcode("C:\\QR Code.png");
//For jpeg format barcode.drawBarcode("C:\\QR Code.jpeg");
//For tiff format barcode.drawBarcode("C:\\QR Code.tiff");
//For gif format barcode.drawBarcode("C:\\QR Code.gif");




OnBarcode is a market-leading provider of barcode imaging generator, reader controls and components for ASP.NET, Windows Forms, WPF, as well Java, Android, iOS (iPhone, iPad) across all major enterprise development platforms. We provides comprehensive tutorials and how-tos for various linear, 2d barcode information, such as C# in ASP.NET, C# .NET, C# Barcode Encoding, C# Barcode Image, VB.NET in ASP.NET, VB.NET Winforms, VB.NET Barcode Encoding. OnBarcode barcode products are supported by RasterEdge ASP.NET Document Viewer, which supports ASP.NET PDF Viewer, ASP.NET MVC Document Viewer, ASP.NET PDF Editor, MVC PDF Viewer. And provide high quality C# Convert PDF to Tiff, C# Convert PDF to Word, C# Convert PDF to HTML, C# Convert PDF to Jpeg images, and their easy and simple documents, like C# PDF SDK, C# extract text from PDF, C# Compress PDF, Print PDF in C# and C# extract image from PDF.
Terms of Use | Privacy Policy
Copyright © OnBarcode.com . All rights reserved.