Get started with bwip-js CDN

MIT licensed

Bwip-js: Lightweight library for generating barcode images using BWIPs engine.

Tags:
  • qr
  • itf
  • gs1
  • upc
  • ean
  • pdf417
  • matrix
  • data
  • datamatrix
  • qrcode
  • databar
  • code128
  • code93
  • code39
  • code
  • bar
  • generator
  • barcode

Stable version

Copied!

How to start using bwip-js CDN


<!DOCTYPE html>
<html>
<head>
  <title>Get started with bwip-js CDN - cdnhub.io</title>
  <script src="https://cdn.cdnhub.io/bwip-js/4.3.0/bwip-js-min.js"></script>
</head>
<body>
  <button id="print-button">Print Barcode</button>
  <div id="barcode-container"></div>

  <script>
    const printButton = document.getElementById('print-button');
    const barcodeContainer = document.getElementById('barcode-container');

    printButton.addEventListener('click', () => {
      const bwip = new BWIPJS({
        bwipWidth: 200,
        bwipHeight: 100,
        dpi: 300,
      });

      bwip.addData('John Doe', BarcodeSymbology.CODE_128, (result) => {
        const img = new Image();
        img.src = result;
        barcodeContainer.appendChild(img);
      });

      bwip.create();
    });
  </script>
</body>
</html>
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!

All versions