Spire.Barcode for Java 3.9.3

Spire.Barcode for Java 3.9.3 supports setting the alignment of the barcode top text

We're pleased to announce the release of Spire.Barcode for Java 3.9.3. This version supports setting the alignment of the barcode top text, and it also supports adding custom text at the bottom of the barcode. Besides, some issues that occurred when scanning the barcode and QR code are successfully fixed. More details are listed below.

Here is a list of changes made in this release

Category ID Description
New Feature SPIREBARCODE-126 Supports setting the alignment of the barcode top text.
int width = 399;
int height = 159;

BarcodeSettings bs = new BarcodeSettings();
bs.setType(BarCodeType.UPCA);
bs.setUnit(GraphicsUnit.Pixel);
bs.setWideNarrowRatio(0.5f);

bs.setTextFont(new Font("Arial", Font.PLAIN,20 ));
String data = "602318275035";
bs.setData(data);
bs.setData2D(data);
bs.setShowTextOnBottom(true);

bs.setTopText(data);
bs.setShowTopText(true);
bs.setTextAlignment(StringAlignment.Center);
bs.setTopTextAligment(StringAlignment.Center);
bs.setTopTextFont(new Font("Arial", Font.PLAIN, 20));

bs.setAutoResize(false);

bs.setX(3.0f);
bs.setBarHeight(height * 0.6f);
bs.setImageHeight(height);
bs.setImageWidth(width);

BarCodeGenerator barCodeGenerator = new BarCodeGenerator(bs);
BufferedImage bufferedImage = barCodeGenerator.generateImage();
ImageIO.write(bufferedImage, "png", new File("result.png"));
New Feature SPIREBARCODE-155 Supports adding custom text at the bottom of the barcode.
barsetting.setBottomText("EAN");
barsetting.setBottomTextFont(new Font("fangsong", Font.BOLD, 25));
barsetting.setBottomTextColor(Color.BLACK);
barsetting.setShowBottomText(true);
barsetting.setBottomTextAlignment(StringAlignment.Center);
Bug SPIREBARCODE-85
SPIREBARCODE-113
SPIREBARCODE-156
Fixes the issue that the scan result was incorrect.
Bug SPIREBARCODE-101
SPIREBARCODE-106
SPIREBARCODE-157
Fixes the issue that scanning the barcode failed.
Bug SPIREBARCODE-146 Fixes the issue that the application threw “NullPointerException” when scanning barcode.
Bug SPIREBARCODE-154 Fixes the issue that adding custom text did not take effect.
Bug SPIREBARCODE-156 Fixes the issue that the scan result was incorrect when scanning QR code with special characters.
Click the link to download Spire.Barcode for Java 3.9.3: