JsBarcode
JsBarcode copied to clipboard
Measurement Units for Width and Height
I am working on a project which the width and height of should be really specific. With that i am not sure on which value should i set the width and height because i do not know what units of measurement they are using. for example if i put the width of 100 . What is the unit of that 100 ? Like is it : 100px, 100mm or which unit ?
I tried to find the answer in the documentations , but was not available ! Wish i can get the answer here :)
Thanks,
width is for a line. https://github.com/lindell/JsBarcode/wiki/Options#width
I would like to know as well:)
It seems this is the code for drawing a barcode.
https://github.com/lindell/JsBarcode/blob/19cdeea9a03c3cd863a74d074ed8f7d66825b718/bin/renderers/canvas.js#L91-L99
And this is the usage of fillRect
for Canvas. here
fillRect(x, y, width, height)
And is says that default unit is px
. here.
By default, one unit on the canvas is exactly one pixel.
So, it must be px
.