Reduce the size of barcode (CODE 128)

432 views
Skip to first unread message

Vaibhav Garg

unread,
Jul 2, 2016, 7:17:20 AM7/2/16
to zxing
I have very large text (can contain upto 21 characters) and unfortunately it has to be printed on a very limited space. I cannot use 2D barcode (otherwise I would have chosen QR code format). Can someone please help me in generating minimum size barcode (CODE128 format) that can be scanned easily?

Bas Vijfwinkel

unread,
Jul 3, 2016, 9:23:20 PM7/3/16
to zxing
Are you using a standard handheld scanner or are you using the Zxing library (and are able to modify it)?
handheld/commercial scanners do have some limitations regarding the size of the barcode.
If it gets too small, it can't read them.
Also, ZXing and some of the better scanners support multiple barcodes of the same type.
Also, if you control the logic behind the scanner, you could go for using id's and look up the information online based upon the id.

Vaibhav Garg

unread,
Jul 4, 2016, 11:02:25 AM7/4/16
to zxing

I am going to read the barcode from handheld scanner. No, I did not touch any code in the library. I just want the code such that it consumes minimum space when printed.

Bas Vijfwinkel

unread,
Jul 5, 2016, 3:34:56 AM7/5/16
to zxing

Then I guess the only way to get a lot of data in the barcode is to print on good quality paper or plastic labels. Most printer can print with a high enough resolution but normal paper is too coarse.
Photopaper or plastic labels allow for far better quality.
Just select the data you want and create a number of sizes to determine which one the handheld reader can still read.
Probably the quality of the reader is also something to take into account.
But I have seen a lot of small barcodes on computer products so that should be no problem.

Vaibhav Garg

unread,
Jul 5, 2016, 4:25:25 AM7/5/16
to zxing

Hi,

Thanks for the suggestion. Is there any option to reduce the size of the barcode in zxing library (like reducing the size of the bar and spacing, etc)? That's what I am specifically looking for.

Bas Vijfwinkel

unread,
Jul 5, 2016, 11:38:24 PM7/5/16
to zxing

As far as I know, the spacing of the bars and gaps is relative just like a zoom function.
Scanners also expect these relative dimensions so one just can't reduce the width of the bars and gaps.
So the only thing is to get a good quality printed barcode and a scanner that has enough resolution to capture small barcodes.
Maybe a salesperson of a barcode scanner manufacturer can tell you more about those details.

Vaibhav Garg

unread,
Jul 7, 2016, 7:05:22 AM7/7/16
to zxing

OK. Thanks for the advice.

Reply all
Reply to author
Forward
0 new messages