Generate Barcode using jQuery Plugin – jquery-barcode.js

942

This plugin help you to display barcodes on your website or you can manually or automatically create 8 types of Barcode and outputs as CSS, BMP, SVG or Canvas for your website.

Barcode Supported Format

  • standard 2 of 5 (std25)
  • interleaved 2 of 5 (int25)
  • ean 8 (ean8)
  • ean 13 (ean13)
  • upc (upc)
  • code 11 (code11)
  • code 39 (code39)
  • code 93 (code93)
  • code 128 (code128)
  • codabar (codabar)
  • msi (msi)
  • datamatrix (datamatrix)

Barcode Supported Output Format

  • CSS (compatible with any browser)
  • SVG inline (not compatible with IE)
  • BMP inline (not compatible with IE)
  • CANVAS html 5 (not compatible with IE)

Creating Barcode

Libraries

Include latest jQuery on page after that add jquery-barcode.min.js

 <script src="//code.jquery.com/jquery-latest.min.js"></script>
 <script type="text/javascript" src="jquery-barcode.min.js"></script>

HTML

Create html container which display barcode.

<div id="barcode"></div>

JS

Call the plugin and generating a barcode.

$(function() {   
 $("#barcode").barcode(
"12345670", // Value barcode (dependent on the type of barcode)
"ean8" // type (string)
);
});

See live demo and download source code.

DEMO | DOWNLOAD

Visit official github repository for more information and follow for future updates. Don’t forget to read license for using this plugin in your projects.