QRCode with ErrorCorrectionLevel for ireport

Nov 26, 2014 at 6:57 PM
Edited Nov 26, 2014 at 6:58 PM
Hi,

I'm working on ireport and I have the following code, this works great but I need to specify the error correction level M (15%), please does someone help me on this?
com.google.zxing.client.j2se.MatrixToImageWriter.toBufferedImage(
     new com.google.zxing.qrcode.QRCodeWriter().encode(
         $V{qr_code},
         com.google.zxing.BarcodeFormat.QR_CODE, 160, 160))
Thanks in advance.
Coordinator
Dec 20, 2014 at 7:17 PM
You have to specify the encoding hint EncodeHintType.ERROR_CORRECTION (as fifth argument inside a Map<EncodeHintType,?>).