Aspose barcode version - 16.10
BarCodeBuilder builder = null;
builder = new BarCodeBuilder(“55005”, Symbology.Code39Extended);
builder.getOnlyBarCodeImage().getWidth()
it gives result of 111
Aspose barcode version - 23.9
BarcodeGenerator builder = new BarcodeGenerator(EncodeTypes.CODE_39_EXTENDED, “55005”); builder.getParameters().getBarcode().getCodeTextParameters().setLocation(CodeLocation.NONE);
builder.generateBarCodeImage().getWidth()
it gives result of 235
so please help us with the settings get the image as the old one’s, java version used is 1.8
I noticed this behavior as you mentioned by using your sample code segment with newer version of Aspose.BarCode for Java. We will evaluate and confirm if this is expected with newer APIs so you may customize the image size manually in code as per your needs. We have logged a ticket with an id “BARCODEJAVA-1714” for it. We will look into it and get back to you soon.
after setting these parameters builder.getParameters().getBarcode().getPadding().getBottom().setPixels(0); builder.getParameters().getBarcode().getPadding().getLeft().setPixels(0); builder.getParameters().getBarcode().getPadding().getRight().setPixels(0); builder.getParameters().getBarcode().getPadding().getTop().setPixels(0);
the size is getting exactly doubled, so in this case it will be 222
Also in the previous version of 16.10 the image width is dynamic based on the text we are sending so we can’t manually mention the size for each and every code
Since we have logged a ticket with an id “BARCODEJAVA-1714” for it, so please spare us little time to evaluate your issue in details.
Once we have an update on it, we will let you know here.
You also can set XDimension to Pixels 1.
https://docs.aspose.com/barcode/net/setting-barcode-parameters/#measuring-barcode-size-in-different-units
@manasag @amjad.sahi
Hello!
Use this BarcodeGenerator settings:
BarcodeGenerator builder = new BarcodeGenerator(EncodeTypes.CODE_39_EXTENDED, "55005");
builder.getParameters().getBarcode().getCodeTextParameters().setLocation(CodeLocation.NONE);
builder.getParameters().getBarcode().getXDimension().setPixels(1);
builder.getParameters().getBarcode().getPadding().getLeft().setPixels(0);
builder.getParameters().getBarcode().getPadding().getRight().setPixels(0);
int width = builder.generateBarCodeImage().getWidth();
Width of generated barcode is 111