Pixel shaving for linear barcodes

Does the barcode library support pixel shaving (or bar width reduction) for linear barcodes?

I don’t want to change the xDim value or the overall size of the barcode. For some ink jet printers depending on the media type it can cause the ink to bleed leading to a larger printed bar width.

Hi Lynn,

Thank you for your inquiry.

Please note that you can use Resolution property of the BarCodeBuilder class to reduce or shrink the barcode Bars’ width. For more information access the link Customize Barcode Image Resolution.

Hope the above information helps. Feel free to contact us in case you have further comments or queries.

Thanks for your response, but this is not quite what I am looking for. Setting the xDim will increase/decrease the width of the barcode’s bars but I do not want it to change the overall width of the barcode for a given dpi. What I would like to do is maintain the width of the entire barcode but “shave off” “n” number of pixels for each bar. Or perhaps a % of the bar width.

This is for ink jet printers where there is an issue with ink spread and I would like to compensate by making the bars thinner.

Hi Lynn,

Thank you for writing us back.

Please forward us the sample barcode image that you want to be generated as well as the sample barcode image that you had generated along with the code that you used. This will help us to analyze the issue.

Hi Ikram,



Attached you will find 2 barcode images. The first image, barcode.jpg has been generated with the attached sample java code. The second image, barcode_shaved.jpg is a hand edited version using “paint” of the first image where I “shaved” off approximately 3 pixels from the right side of the barcode. You will see that I left a few pixels at the bottom to demonstrate where I did the shaving.

Hi Lynn,

Thank you for providing the sample barcode images.

Please note that we are looking into the issue. We will update you about the progress accordingly.

Hi Lynn,

Please note that while investigating it was found that currently it is not possible to generate barcode of your requirement. Therefore, a request for a new feature has been logged into our system with ID BARCODJAVA-33589. Our product team will further look into it and provide feedback. We will update you accordingly.