Example usage for com.itextpdf.text.pdf.qrcode Encoder encode

List of usage examples for com.itextpdf.text.pdf.qrcode Encoder encode

Introduction

In this page you can find the example usage for com.itextpdf.text.pdf.qrcode Encoder encode.

Prototype

public static void encode(String content, ErrorCorrectionLevel ecLevel, QRCode qrCode) throws WriterException 

Source Link

Document

Encode "bytes" with the error correction level "ecLevel".

Usage

From source file:com.mui.certificate.core.HalalCertification.java

License:Apache License

private ByteMatrix generateQRCode(String data) throws Exception {

    QRCode qrcode = new QRCode();
    qrcode.setMode(Mode.BYTE);/*from   w w w. ja va2  s.co m*/
    Encoder.encode(data, ErrorCorrectionLevel.L, qrcode);
    ByteMatrix matrix = qrcode.getMatrix();
    return matrix;
}