【发布时间】:2018-07-08 01:41:32
【问题描述】:
我想编写一个 Java 代码来生成三行条码。下面的代码是在一行中创建一个条形码。如果您对此有任何解决方案,那将非常有帮助。
Barcode barcode = BarcodeFactory.createCode128(codeValue);
barcode.setDrawingText(false);
barcode.setBarHeight(200);
barcode.setBarWidth(5);
BufferedImage image = new BufferedImage(500, 500,
BufferedImage.TYPE_BYTE_GRAY);
Graphics2D g = (Graphics2D) image.getGraphics();
barcode.draw(g, 6, 30);
在此之后我为条形码创建图像。
File f = new File("Path\\Bar_Img.jpeg");
FileOutputStream fileOutputStream = new FileOutputStream(f);
// Let the barcode image handler do the hard work
BarcodeImageHandler.writeJPEG(barcode, fileOutputStream);
所以这将创建一个单行条形码。但我想用三行条形码创建一个图像
【问题讨论】:
-
需要三个 codeValues,打印条形码。
标签: java image barcode multiline