We have purchased a license for the Aspose Java BarCode component and are having real issues with trying to dynamically size the barcodes based on users settings. If the size is not specified then the barcodes prints to A4 fine and can be scanned. When trying to set the size manually this results in the barcode not sizing to fit the available label and as such is not a valid barcode.
I have tried playing with the setXdimension() but this seems to take a different value depending on the symbology used and doesn't seem to behave as expected. e.g. setting XDimension to a value of 0.6 makes it smaller but then going down to 0.4 the image get bigger!?
Is there any standard utility methods etc to allow the barcode to be generated dynamically based on unknown sizes/symbology/fonts etc. How should this XDimension figure be calculated at runtime?
I had already seen the documentation and the problem is with knowing what to set the X dimension to given the size of the codetext? After spending quite some time on this and getting no where is it possible to get a refund on the licenses we have purchased as I suspect the barcode support in your product is not flexable enough for our requirements.
We are very sorry for your inconvenience and investigating how to generate the barcode after automatically calculating x, y dimensions and other properties according to the codetext length and specified height and width of image. I have also logged this issue in our bug tracking system (ID: 24312). We will inform you here once it gets resolved.
If you want to get a refund, then please reply, I will move this thread to our Purchase forums. My colleagues there will help you in this matter.
As mentioned by Saqib, we have logged this feature request in our Issue Tracking System. Once a feature request is logged into the Issue Tracking System, it is scheduled by our Development Team according to their plans. We are discussing this feature request with our Development Team Leader and will get back to you soon.
Thank you for the updates I look forward to hearing your suggestions on how to acheive this barcode solution based on image size and different symbologies/codetext. Do you have any idea on timescales for a proposed solution to this issue?
As the issue has just been logged and it requires some investigation before sharing an ETA for the solution. Hopefully, we shall come up with the solution or a timeline for the solution by the start or mid of the next week. We shall keep you posted about the proceedings on our end.
1. I'd attached a beta version of Aspose.BarCode for Java within this post.A new function called "public void preCheckSize()" was added to BarCodeBuilder class for checking the size setting. For example:
The above code snippet will print "Given height is too small,desired value is not less than 1.1458334."
2. For the issue of unexpected behavior of xDimension(setting XDimension to a value of 0.6 makes it smaller but then going down to 0.4 the image get bigger), it's because of the xDimension was reset once if the given value is too small to generate the barcode. In this beta version, it will throw BarCodeException with a message saying "xDimension is too small." for this case;
Please try this beta version and tell me if it's able to fit your requirement.
Thanks for the change to throw the exception rather than defaulting back to a larger size but I am still unable to calculate the XDimension at runtime. Is there a utility method or even a mapping against which size image needs which XDimension based on the selected symbology and code text?
We are investigating on this issue, to automatically set properties like x and y dimensions based on the codetext, symbology and specified size, to generate the barcode image equal or smaller than the specified size. I will get back to you with more information shortly. Sorry for the inconvenience.
Thanks for the change to throw the exception rather than defaulting back to a larger size but I am still unable to calculate the XDimension at runtime. Is there a utility method or even a mapping against which size image needs which XDimension based on the selected symbology and code text?
Hi Rog,
We can provide a beta version to acquire the XDimension automatically next week.