com.google.zxing.oned.UPCAWriter Java Examples

The following examples show how to use com.google.zxing.oned.UPCAWriter. 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 generateUPCABarcodeImage(String barcodeText) throws Exception {
    UPCAWriter barcodeWriter = new UPCAWriter();
    BitMatrix bitMatrix = barcodeWriter.encode(barcodeText, BarcodeFormat.UPC_A, 300, 150);

    return MatrixToImageWriter.toBufferedImage(bitMatrix);
}