下面列出了怎么用com.google.zxing.oned.Code128Writer的API类实例代码及写法,或者点击链接到github查看源代码。
public static BufferedImage generateCode128BarcodeImage(String barcodeText) throws Exception {
Code128Writer barcodeWriter = new Code128Writer();
BitMatrix bitMatrix = barcodeWriter.encode(barcodeText, BarcodeFormat.CODE_128, 300, 150);
return MatrixToImageWriter.toBufferedImage(bitMatrix);
}