How can I add right quiet zone indicator '>' by using 'bwip-js-min.js'

45 views Asked by At

I want to provide my code by using 'bwip-js-min.js'

<!DOCTYPE html>
<html>
<head>
  <title>EAN13 Barcode Generator</title>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/bwip-js/3.1.0/bwip-js-min.js"></script>
</head>
<body>
    <div class="size">
        <canvas id="canvas" width="500"></canvas>

    </div>
  
  <script>
    // Get the canvas element
    var canvas = document.getElementById('canvas');

    // Generate the barcode
    bwipjs.toCanvas(canvas, {
      bcid: 'ean13', // Barcode type
      text: '883123456789', // Barcode data
      scale: 2, // Scale factor
      height: 25, // Barcode height in mm
      paddingright: 10,
      includetext: true, // Show human-readable text
      
   
    });
  </script>
</body>
</html>

The main reason that I want to ask about is adding right quiet zone indicator '>' in the edge of 'text: '883123456789''

1

There are 1 answers

0
Mark Warren On BEST ANSWER

When working with a specific barcode type, always look at the BWIPP documentation to see what options are available. For EAN-13: https://github.com/bwipp/postscriptbarcode/wiki/EAN-13

The option you want is guardwhitespace:true.