Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
QR Code corresponds to a group of 2D square types that benefits from high data density and allows encoding streams of bytes and textual data composed of Unicode symbols. Aspose.BarCode for Java supports Extended Channel Interpretation (ECI) to encode Unicode data and provides various encoding modes; UTF8 is one of the most widely used encoding modes.
Reserving the minimum possible amount of data for error correction, the QR Code standard can be used to encode at most 7,089 numerical digits or 4,296 alphanumeric characters or 2,953 bytes. The other standard, Micro QR Code, allows encoding up to 35 numerical digits or 21 alphanumeric characters or 15 bytes. Micro QR Code serves to create considerably small QR Code images. However, it does not enable Extended Channel Interpretation (ECI) and does not allow encoding Unicode characters. In particular, Micro Qr Code barcodes corresponding to the M1 version can encode at most five numerical digits; the M2 version allows encoding up to ten numerical or six alphanumeric characters. This encoding capacity is usually suitable to work with industrial markers.
The main advantages of the QR Code symbology can be outlined as follows:
It should be noted that considerable damage to target patterns in QR Code images may result in the deterioration of barcode scanning and reading efficiency.
Aspose.BarCode for Java allows generating QR Code or Micro QR Code images corresponding to different versions. This can done through two methods of class QrParameters, i.e. setQrEncodeType (using values from the QREncodeType enum) and setQrVersion (with values from the QRVersion enum). By default, the AUTO setting is enabled.
The first way to set the required version of QR Code or Micro QR Code is to use the setQrVersion method. If data inputted for encoding does not occupy the entire capacity of the target version, padding characters are used to fill the leftover space. If barcode information exceeds the available capacity, barcode images cannot be generated, and the corresponding exception is thrown.
The second way to determine the desired QR Code generation mode is applicable when QrVersion remains set to AUTO. In this case, the setQrEncodeType method can be used to select the barcode type according to the input data size. The QREncodeType enum can take the following values:
The following barcode images are given to explain how to create different types of QR Code using various automatic version setting modes.
Generation Mode | AUTO | FORCE_QR | FORCE_MICRO_QR |
---|---|---|---|
![]() |
![]() |
![]() |
In Aspose.BarCode for Java, developers can manually select the desired QR Code version for barcode generation. In this case, it is required to call the setQRVersion method of class QrParameters passing a value from the QRVersion enum, i.e. from VERSION_01 to VERSION_40 for QR Code or from VERSION_M1 to VERSION_M4 for Micro QR Code. The following barcode images are intended to explain how to create QR Code barcodes using manual settings to define the requested version.
Version | QR Code VERSION_05 | Micro QR VERSION_M4 |
---|---|---|
![]() |
![]() |
Aspose.BarCode for Java enables the variety of widely used data encoding specifications, such as Unicode and others. Developers can select the desired encoding mode through the setQrEncodeMode method of class QrParameters passing a value from the QrEncodeMode enum that includes the following options:
To encode input data when the AUTO encoding mode is enabled, the library applies the encoding defined through the setCodeTextEncoding method. If the required encoding is not specified explicitly, UTF8 is applied.
When the BYTES encoding mode is used, input information presented in a form of a plain byte stream is transformed into an array of symbols and then to a string. Digits from 0 to 255 can be encoded. If a byte stream contains digits larger than 255, this symbol gets encoded as two bytes in the UTF16LE encoding (the lower byte is put first).
The library provides two special encoding modes called UTF_8_BOM and UTF_16_BEBOM, which serve to encode information according to UTF8 and UTF16BE specifications. A byte order mark (BOM) symbol is added as the first digit. The following code sample shows how to enable with the UTF_16_BEBOM encoding mode.
The ECI_ENCODING encoding mode suggests applying one of the encodings listed in the ECIEncodings enum. Aspose.BarCode for Java supports the variety of widely used encodings. In this mode, the extended channel interpretation (ECI) identifier is added to denote the enabled encoding to transfer the information about it to decoders. It is recommended to use the UTF8 value.
Aspose.BarCode for Java supports the EXTENDED_CODETEXT mode that allows customizing settings for the QR Code generation process manually. This mode enables activating the multi-ECI mode and adding FNC characters (special symbols to differentiate between fields in variable-length identifiers) to work with extended textual information. The library provides a special class called ExtCodetextBuilder that facilitates working with this encoding mode. When the multi-ECI mode is enabled, barcode information gets processed for all predefined encodings automatically. In all other cases, the encoding defined through the setCodeTextEncoding method is applied.
The QR Code group of barcode standards provides four types of Reed-Solomon error correction (EC). The error correction mechanism prescribes storing redundant data to facilitate automatic error detection and correction in the case of barcode image distortions or damages. To recover 1% of corrupted data, 2% redundancy is required.
Following error correction levels are supported for QR Code symbologies.
Error Correction Level | Data Recovery Capacity |
---|---|
Level L | 7% |
Level M | 15% |
Level Q | 25% |
Level H | 30% |
For all QR Code subtypes with the exception of Micro QR developers can use any error correction level. For Micro QR, different subtypes are compatible with specific EC levels only, i.e. M1 enables EC level L; M2 - levels L and M; M3 and M4 - levels L, M, and Q.
Error Correction Level | Level L | Level M | Level Q | Level H |
---|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
QR Code types (except Micro QR) support the possibility to generate composite barcodes using the structured append mechanism. In this mode, the input data can be divided among different QR Code barcodes and then composed into a single image. Aspose.BarCode for Java does not enable distributing input barcode data across several QR Code barcodes; however, it allows creating a composite QR Code label manually. This can be done through the setStructuredAppend method passing an object of class QrStructuredAppendParameters class. This class provides the following methods:
Sample barcode images provided below have been created using the structured append mechanism.
Structured Append Type | First Type | Second Type |
---|---|---|
![]() |
![]() |
Aspect Ratio is the ratio between the height and the width of a barcode. To adjust barcode proportions using the X and Y coordinates in Aspose.BarCode for Java, it is required to use the setAspectRatio method of class QrParameters. This property is defined as a relative coefficient to the value of XDimension parameter. Generally, the value of AspectRatio should be set to 1. When it is necessary to adjust the proportions of generated QR Code barcodes, the setAspectRatio method can be used. Sample barcode labels shown below have been generated using different aspect ratio settings.
Aspect Ratio | Is Set to 1 | Is Set to 2 |
---|---|---|
![]() |
![]() |
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.