setting 128 barcode bar width in zxing

523 views
Skip to first unread message

Sachin Kulshrestha

unread,
Feb 24, 2018, 2:53:31 AM2/24/18
to zxing
Hi,

I've been on this for some time, would be extremely helpful if you can answer:

I need to add barcode bar size while generating barcode in zxing library's Code128writer.

I read the code and documentation but didn't find a suitable way.
the required bar width is 15mil, does zxing provide such functionality?

Lachezar Dobrev

unread,
Feb 26, 2018, 5:32:22 AM2/26/18
to Sachin Kulshrestha, zxing
ZXing creates Bar-Code rasters (black-and-white matrices).
The mil is when printing the bar-codes, which is not covered in
ZXing (it's your task).

When generating the bar-code request a width of 0px, which will
generate the least possible size (width wise). Then you can scale the
image using 1px -> 15 mil scaling, which would be around 66.7 ppi
(pixels per inch) if I am not badly mistaken (1mil is 0.001 inches
right?).

Alternatively check the printable size that you have available.
Let's say you have 2 inches available. That means you have 2000 mils
available for the bar-code, which means you have about 130 pixels
available, and you can request ZXing to generate 130 pixels wide
bar-code that you would scale 100% in your document.

HTH
> --
> You received this message because you are subscribed to the Google Groups "zxing" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to zxing+un...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages