Thank you for your answer.
I have checked that documentation.
The version 11 can store 468 alphanumeric characters with ECC Level L.
The version 12 can store 535 alphanumeric characters with ECC level L.
When I’m trying to use
com.aspose.barcode.QRVersion.VERSION_12
I get a
com.aspose.barcode.BarCodeException: QR Barcode - incorrect version number
I use the following sample code to get QR code version 12 image, it work fine, see the attached output barcode image for your reference:
e.g Sample code:
// Instantiate BarcodeGenerator object
BarcodeGenerator generator = new BarcodeGenerator(com.aspose.barcode.EncodeTypes.QR,
"ABCDEFGHIJKLMNOPQRSTUVWXYZ");
// Set the error level
generator.getParameters().getBarcode().getQR().setQrErrorLevel(QRErrorLevel.LEVEL_Q);
// Set the QR barcode version number
generator.getParameters().getBarcode().getQR().setQrVersion(com.aspose.barcode.QRVersion.VERSION_12);
// Save the image
generator.save("f:\\files\\qr_version12_errorQ.png");
Could you provide your sample runnable code (same as above) to show the issue, we will check it soon. qr_version12_errorQ.png (1.9 KB)
// Instantiate BarCodeBuilder object
BarcodeGenerator generator = new BarcodeGenerator(com.aspose.barcode.EncodeTypes.QR, "HTTP://XXX.YY/A/BB0112000011234567895100112345678020200601BBXYWIXHT2WDH66ZC5OFKK2TGTG4VPUNOI23EFT3Y7OIYTMNXBJ4LPT742G4YIZCXPLS5CVVE5ADTUFFSXZYKGMISKCVLSUXWO6VV37QFKW7VHHI2AFXHC2Z6P5VBPLHDE2NIGSOPDFAWTZPIKTWJKP4GVPCC6JIR6TJ4N33IFMO33APVP6KJUOVWXXYMDXFPSH6HMBPK7NTPDUE6KOJAC6WEDRGZZ7RMM2EQ27CAJCNQEHVCXWQ3GISP6UFTGBXBKXYE5BXUZIUGV5OD5NKYCSTRYE6LIV55B5OQ2IRC6NJSOJ6YLWVVRAVZLOBQQNGW2KXNXD7IJDZGFY36X5E64SMQK3PETGIU775CDRFMKH6M73HQQQVURX7RGYMKSYJHKOEVWSGRPNRZ2NEAIYJNBOHRU======");
//Disable text under QR generator.getParameters().getBarcode().getCodeTextParameters().setLocation(CodeLocation.NONE);
//Set dimension
generator.getParameters().getBarcode().getXDimension().setMillimeters(0.2f);
//Set Paddings
generator.getParameters().getBarcode().getPadding().getBottom().setPixels(0f);
generator.getParameters().getBarcode().getPadding().getLeft().setPixels(0f);
generator.getParameters().getBarcode().getPadding().getRight().setPixels(0f);
generator.getParameters().getBarcode().getPadding().getTop().setPixels(0f);
// Set the error level
generator.getParameters().getBarcode().getQR().setQrErrorLevel(QRErrorLevel.LEVEL_L);
@deferi,
We were able to observe the issue but we need to look into it more. We have logged the issue in our database for investigation and for a fix. Once, we will have some news for you, we will update you in this topic.
This issue has been logged as
BARCODEJAVA-918 – Exception raised while generating QR code with version 12 having characters more than 366
Ok, found problem. Curently we are encoding characters with ECI mode not to optimally. We will add changes to our encoding engine. As quick workaround you can use encoding without ECI, it must encode in max density.