We are unable to generate QR code using Aspose.BarCode in Java.
The code line throwing error is below:
com.aspose.barcode.generation.BarcodeGenerator generator = new com.aspose.barcode.generation.BarcodeGenerator(com.aspose.barcode.EncodeTypes.QR, "My sample text");
Which version of Aspose.BarCode for Java you are using? Please try using newer version of the product. I tested using the following sample code in a simple console application, it works fine and the output image is generated (attached) fine:
e.g Sample code:
// Instantiate BarcodeGenerator object
com.aspose.barcode.generation.BarcodeGenerator generator = new com.aspose.barcode.generation.BarcodeGenerator(com.aspose.barcode.EncodeTypes.QR, "My sample text");
// 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_version12QR1.png");
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.