com.google.zxing.oned.Code128Writer Java Examples

The following examples show how to use com.google.zxing.oned.Code128Writer. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ZxingBarcodeGenerator.java    From tutorials with MIT License 4 votes vote down vote up
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);
}