generate barcode in node.js

Barcodes are used to visually represent the data in the form of graphical objects. Different types of barcodes are used in various cases, such as Code128, QR code, Aztech, Pdf127, and etc. In this article, you will learn how to implement barcode generation features in your web applications. Particularly, you will learn to develop Node.js Barcode Generator application and you will also learn how to generate QR code in Node.js applications.

Node.js Barcode Generator API

In order to generate barcodes, we will use Aspose.BarCode for Node.js via Java. It is a feature-rich API that lets you generate and read popular barcode symbologies from within your Node.js applications. You can either download the API or install it using the following NPM command.

> npm install aspose.barcode

Aspose.BarCode for Node.js via Java supports the following barcode symbologies.

Australia PostEAN8
AztecInterleaved2of5
BarCode supplementITF14
BooklandEANMatrix 2 of 5
CodabarMSI
Code11Pdf417
Code128Planet
Code39 ExtendedPostnet
Code39 StandardPZN (Pharma Zentral Nummer, Pharmazentralnummer barcode)
Code93 ExtendedQR
Code93 StandardSSCC18
DatamatrixStandard2of5
Deutsche Post IdentcodeSwiss QR
EAN128UPCA
EAN13UPCE
EAN14(SCC14)

Generate a Barcode in Node.js

The following are the steps to generate a barcode in Node.js applications.

The following code sample shows how to generate a barcode image in Node.js.

Barcode

generate barcode node.js

Generate a QR Code in Node.js

Aspose.BarCode for Node.js via Java also allows you to generate two-dimensional barcodes such as QR codes. The following are the steps to generate a QR code in Node.js.

The following code sample shows how to generate a QR code in Node.js.

QR Code

generate QR node.js

Customize Appearance of a Barcode

You can also customize the appearance of a barcode by changing the forecolor, back color, font, border, resolution, etc. The following are the steps to customize the appearance of a barcode.

The following code sample shows how to customize a barcode in Node.js.

Barcode

customize barcode

Get a Free API License

In order to use the API without evaluation limitations, you can get a free temporary license.

Conclusion

In this article, you have learned how to generate a barcode in Node.js applications. Also, you have seen how to customize the appearance of the barcodes using different options. Furthermore, you can explore more about the API using its documentation. In addition, you can share your queries with us via our forum.

See Also