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

Free Support Forum - aspose.com

Pdf417 aspect ratio


Refering to https://docs.aspose.com/barcode/java/set-aspect-ratio-of-barcodes/
how is the aspect ratio calulated?
I mean the first barcode image.png (646 Bytes)
as per link “An aspect ratio of 3:2 means the barcode is 1.5 (or 3/2) times wider than it is tall”

however the barcode is wider more than twice the height of the barcode.

image.png (574 Bytes)

It says “An aspect ratio of 2 means that the barcode width is two times greater than the height.”
however if i measure width is about six time wider than its height.

When calculating aspect ration what width and height are being used in the calculations?


Thanks for the screenshots and details.

I did evaluate some code segments a bit to set aspect ratio for Pdf417 barcode. Apparently, the results which I got do not justify what is mentioned in the document. I have logged a ticket with an id “BARCODEJAVA-1336” for it. We need to investigate and look into the details of the issue. We will get back to you with more details to sort it out. We will also clarify your doubts about the aspect ration attribute.

Once we have an update on it, we will let you know.

The Pdf417Parameters.AspectRatio property should be used for customizing Height/Width ratio of 2D BarCode module. The width of specific barcode bar can be customized by BarcodeParameters.setXDimension() method. The height of specific barcode bar is xDimension * AspectRatio.
If you want to customize the barcode image size, you should use AutoSizeMode.INTERPOLATION and related API.