Closed sloopsight closed 3 years ago
Hi @sloopsight,
No, it doesn't.
But lib Zing has the ability to do this job easily.
Thanks,
Hi @sloopsight,
Ex.
<dependency>
<groupId>com.google.zxing</groupId>
<artifactId>core</artifactId>
<version>3.4.1</version>
</dependency>
<dependency>
<groupId>com.google.zxing</groupId>
<artifactId>javase</artifactId>
<version>3.4.1</version>
</dependency>
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import javax.imageio.ImageIO;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.WriterException;
import com.google.zxing.client.j2se.MatrixToImageWriter;
import com.google.zxing.common.BitMatrix;
import com.google.zxing.qrcode.QRCodeWriter;
public final class QRCodeImage {
private QRCodeImage() {
super();
}
/**
* Create QRCode image
*
* @param value Base64 string
* @return array of bytes image
* @throws IOException
* @throws WriterException
*/
public static byte[] create(final String value) throws IOException, WriterException {
try (final ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) {
final QRCodeWriter qrcodeWriter = new QRCodeWriter();
final BitMatrix bitMatrix = qrcodeWriter.encode(value, BarcodeFormat.QR_CODE, 100, 100);
final BufferedImage bufferedImage = MatrixToImageWriter.toBufferedImage(bitMatrix);
ImageIO.write(bufferedImage, "png", outputStream);
return outputStream.toByteArray();
}
}
}
Closing this issue for being without activity.
Could please confirm if this lib has capability to generate ISO 18004 QR code if not does zing does?