lindell / JsBarcode

Barcode generation library written in JavaScript that works in both the browser and on Node.js
http://lindell.me/JsBarcode
MIT License
5.5k stars 1.11k forks source link

when width is 1, barcodes generated is not getting scanned in my mobile #308

Open sanjeevuideveloper opened 5 years ago

walderich commented 3 years ago

I have experienced the same issue here. Using a scaled EAN-13 SVG with a width of 0.7 renders the barcode unreadable to barcode scanners.

When visually comparing the code, the distances between some of the bars is not correct.

I looked at the resulting SVG and my guess is that the generated bar groups (i.e. <g> tags) are only translated by full integer values. With narrow barcodes this leads to rounding which results in invalid spacing between those groups.