canvas-barcode
v1.0.1
Published
draw EAN13 and code128 barcode on the canvas --javascript
Downloads
5
Readme
用于条码生成,支持 code128 ABC类编码和EAN13标准码,C类需要将barcode.js中注释的代码,重新打开
安装
浏览器导入:<script src="js/EAN13_b.js" type="text/javascript" charset="utf-8"></script>
<script src="js/code128.js" type="text/javascript" charset="utf-8"></script>
NPM:install --save-dev canvas-barcode
var barcode=require('canvas-barcode');
调用draw方法,第一个参数是canvas的id,第二个参数为每个条形模块的宽度,第三个参数为条形码高度
var barcode=require('canvas-barcode');
new barcode.EAN13('535350244626').draw('canvas', 2, 100);
new barcode.code128('535350244626').draw('canvas', 2, 100);