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");