Hi All,R-1082503101704_20210409142256.PNG (7.5 KB)
W-1082503101704_20210409135832.PNG (7.2 KB)
Lately I have noticed one strange behavior on databar expended stacked in the barcode API 21.3 java version. The text showing in one row when i run the barcode ap in windows but the same text showing two rows running in docker linux image. pls see my testing code and attached for your investigation the issue may be the similar toBARCODENET-37428 .
String GTIN1 = "(01)1082503101704";
int row = 2;
float xdim=0.33f;
float height=23.43f;
// Generate and save the image to file
BarcodeGenerator builder = new BarcodeGenerator(EncodeTypes.DATABAR_EXPANDED_STACKED);
// Set code text
builder.setCodeText(GTIN1);
builder.getParameters().getBarcode().getDataBar().setRows(row);
builder.getParameters().setAutoSizeMode(AutoSizeMode.NONE);
builder.getParameters().getBarcode().getCodeTextParameters().getFont().getSize().setMillimeters(80);
builder.getParameters().getBarcode().getXDimension().setMillimeters(xdim);
builder.getParameters().getBarcode().getBarHeight().setMillimeters(height);
builder.getParameters().getBarcode().getPadding().getLeft().setInches(0);
builder.getParameters().getBarcode().getPadding().getRight().setInches(0);
builder.getParameters().getBarcode().getPadding().getTop().setInches(0);
builder.getParameters().getBarcode().getPadding().getBottom().setInches(0);
builder.getParameters().setResolution(600f);
try {
//ByteArrayOutputStream bye = new ByteArrayOutputStream();
//builder.save(bye, BarCodeImageFormat.PNG);
//BufferedImage newBi = builder.generateBarCodeImage();
//builder.save("c:\\temp\\" + row + "_Row_" + "XDIM_" + xdim*1000 + ".png", BarCodeImageFormat.PNG);
//ImageIO.write(newBi, "svg", new File("c:\\temp\\google-decode.svg"));
//ImageIO.write(newBi, "png", new File("c:\\temp\\google-decode.png"));
builder.save("c:\\temp\\" + "j1.png", BarCodeImageFormat.PNG);
//builder.save("c:\\temp\\" + "j1.svg", BarCodeImageFormat.SVG);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
the Dockerfile is FROM adoptopenjdk:13-jdk-openj9
RUN ln -fs /usr/share/zoneinfo/America/Toronto /etc/localtime &&
apt-get update
&& apt-get upgrade -y
&& apt-get install -y tzdata libsqlite3-0 apt ca-certificates libssl1.1 libcurl4 curl
&& dpkg-reconfigure --frontend noninteractive tzdata
&& apt-get clean
&& rm -rf /var/lib/apt/lists/*
…