We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Issue with Bar Code generation / using the bar code generation java API

Hi Support,

we are corporate and purchased aspose tool kit and need little help to use your API.

we would like to create a bar code image with 60 (width) and 120 (height) - pixels.
her the image as well as bar has to be of the same size as specified above.

we are trying to set different parameters as shown below and so far not able to get the desired result.

could any one help us on this, what are the best settings to get the desired result which is scannable.

we were very close to the deployment and prompt help in this is regard is greatly appreciated.

public static Image generateBarcodeWithAspose(Barcode barcodeObj)
{
BarCodeBuilder b = new BarCodeBuilder(PDF147,
barcodeObj.getCodeText());
b.setAutoSize(false);
b.setCodeTextVisible(false);
b.setRotationAngle(barcodeObj.getAngle());
b.setGraphicsUnit(GraphicsUnit.MILIMETER);
// b.setHeight(120);
// b.setWidth(60);
// b.setPDF417Columns(4);
// b.setPDF417Rows(6);
// b.setPDF417AspectRatio(3.0F);
b.setXDimension(0.3F);
b.setYDimension(1.25F);
// b.setPDF417Rows(6);
return b.generateBarCodeImage();
}

Thanks,
Vinil

Hi,

issue we are facing here is co-ordination between the size of the image and bar code genrated inside the image.

what parameters do we need to set to achieve BarCode and genrated image to be of the same size.

Thanks,
Vinil

Hi Vinil,

The size of the barcode will be impacted by the data(CodeText) to be encoded, longer codetext will cause lager barcode size. What’s the type and length of the codetext in your application?

Thanks


Dean,



symbiology : pdf417
type : alphanumeric

length of the code text : 150 characters (maximum)


Example of code text:

"eRIVQCFOVR80557041511110000000000 01008291291126GBSPXFRPNO09006 82833090120211 AF "

output for Image should be:

java.awt.Image.getHeight() : 60

java.awt.getWidth() : 120



Thanks,

Vinil

Hi Vinil,

Could you please set the properties as below:

CodeLocation: None

XDimension: 0.3

yDimension: 0.3

Columns: 1

This will generate the barcode 116x73 pixels, if you set the license. You will get this width and height when codetext is set to none. Aspose Demo text will also be removed if you apply the license file. Are these dimensions ok for you?