KA.Barcode for Java
QR Code Image Setting for Java
Create QR Code 2D barcodes with all image settings like resolution, format, colors, rotation, etc using Java
QR Code Barcode Generator for Java Overview
  • Supports Java Reports software to set your wanted size of QR Code
  • Generate and print QR Code in JDK 1.4.0 and later version
  • Easy to generate QR Code images in Java Reports, such as Jasper Report, iReport, Eclipse BIRT and Oracle Reports
  • Encode any version from version 1 to version 40 to create 2D QR Code barcode images in Java applications
  • High quality QR Code images may be printed with any printers, including those low resolution printers
  • Common-used image formats are valid here, which are png, tiff, gif, jpeg and bmp
  • The generated QR Code image resolution can be set to be a fixed value with your need
Related QR Code Java Generation Setting Guide
KA.Barcode Generator for Java is a mature and reliable barcode generation SDK for Java which includes various setting guides excluding QR Code image setting in Java:
Java QR Code Image Setting Properties

QR Code Special Image Settings

QR Code in Java has the following properties which influence the QR Code image generated in Java developmental environment:
  • qrCodeEcl - error correction level capability to restore data if the data is dirty or damaged with valid value L, M, Q, H
  • qrCodeVersion - the symbol version for QR Code which ranges from version 1 to version 40

QR Code Common Image Settings

The following properties are the common settings for QR Code image in Java projects:
  • rotate - QR Code image rotate angle with 0, 90, 180 and 270 degrees and the default setting is 0
  • resolution - QR Code image resolution in dpi (short for dot per inch) and the default value is 72
  • backgroundColor - the color of QR Code barcode image background
  • foregroundColor - the color of QR Code barcode image foreground
  • barAlignment - put the barcode in the left, right and center inside the QR Code image
QR Code Image Setting in Java - Implementation
After you have installed and set up the QR Code generator for Java, please open a new Java project or an existing project to implementing QR Code generator for Java and do as below guide:
//Open QR Code barcode object in Java
BarCode barcode = new BarCode();
//Set barcode type to be QR Code
barcode.setType(IBarCode.QRCODE);
//Encode QR Code valid data with valid data length, and for some specific data encoding, please set QR Code valid data mode with AUTO, NUMERIC, ALPHANUMERIC, BYTE, KANJI.
Barcode.setqrCodeDataMode(0(MODE_AUTO));
barcode.setData("456456456");

QR Code Version and ECL Setting in Java

As a special 2D barcode type, QR Code version and error correction level can be set to change the generated QR Code image in Java platform like below example:
//Set QR Code version with valid value from 1 to 40 using Java
barcode.setqrCodeVersion(1);
//Set QR Code error correction level in Java with QRCode.ECL_L (0), QRCode.ECL_M (1), QRCode.ECL_Q (2), QRCode.ECL_H (3).
barcode.setqrCodeEcl(QRCode.ECL_L (0));

QR Code Image Resolution Setting in Java

For QR Code image resolution using Java, it can be set to be any fixed value for the QR Code image, like the following example:
//Set QR Code image resolution in dpi, default value is 72
barcode.setResolution(66);

QR Code Image Placement Setting using Java

QR Code image placement in Java can be influenced with two aspects which are rotation and bar alignment for QR Code image in Java developmental environment like below:
//Set QR Code rotation angle using Java with 0, 90, 180, 270 degrees
barcode.setRotate(IBarCode.ROTATE_270);
//Set QR Code bar alignment in Java with left, right and center choices
Barcode.setbarAlignment(left);

QR Code Image Color Setting with Java

Traditional QR Code image generated in Java is black bars and white space, however, QR Code image can be set to be colorful to meet some special need for some item packages.
//Set QR Code image background color in Java
barcode.setbackgroundColor(red);
//Set QR Code image foreground color in Java
barcode.setforegroundColor(white);