A very simple guide to generate barcode (NO BS!)

I was recently looking for a way to generate barcode (not QR code) out of curiosity. But there were hundreds of articles telling longer routes. While digging further, I found a very simple way to generate a barcode with given data in real-time.

You neither need any NPM Package to perform this, nor any link which generates the image of barcode. As this can lead to security issues in your application and could be bit slower.

I would recommend using a font (usually free) from Google Fonts, for creating a barcode. If you simply search "barcode" there will be a lot of results for the same.

For a live demo, I would like to pick Libre Barcode 39 Text. It is a simple font and can be used to demo easily.

I have created this pen below as a demo that would help you understand the basic steps:

Happy coding!


Leave a Reply

Your email address will not be published. Required fields are marked *