Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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

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”

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

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.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading