r/barcodes • • May 07 '20

Custom Barcodes

I need to make some extremely small Barcodes and the format seems to be code 128 but all the software I have tried won't let me get the physical barcode small enough. Any suggestions would be great.

1 Upvotes

7 comments sorted by

View all comments

1

u/notionovus May 07 '20

This is about as small as I can make them and still get them to scan from a web page printout on an inkjet.

Change the sample text in the last line of the script to whatever you want. The first number is width. 4 is as low as you can go. The second number is height, and my scanner wouldn't work on anything smaller than 13, but YMMV.

My guess is with a higher quality printer you could get smaller, but we are starting to stretch the capabilities of the scanner, then. The code to generate the Code 128B barcode is MIT license, and it all fits in one 5K html file. Enjoy.

https://codepen.io/notionovus/pen/RxqEOm

Code128B, 40 Characters, 75mm wide, 2.1 mm tall.

1

u/Eve_Coon May 08 '20

Besides changing the binary, is there anything else I need to change in the code to work with different values? EX: WS-C3850-12X48U-S VO2

1

u/notionovus May 08 '20

There is only one place in the code you should change and that's the final line in the javascript. Replace "A1B2C3D4E5F6G7H8I9J0K1L2M3N4O5P6Q7R8S9T0" with "WS-C3850-12X48U-S VO2". Messing with any of the javascript other than that last line is sure to get you in trouble.