我想使用“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>
我想问的主要原因是添加了右侧安静区域指示器'>'在“text:”883123456789“”的边缘