在线 JsBarcode

 

https://codepen.io/lindell/pen/mPvLXx?editors=1010

https://www.jianshu.com/p/ab71ab75d360

复制代码
<svg id="barcode1"></svg>
<svg id="barcode2"></svg>
<svg id="barcode3"></svg>
 <div>
        <img id="barcodeArcher"/>
    </div>
<style>
        #barcodeArcher{
            width:23mm;//在这里更改你想要的宽度
            height:5.3mm;//在这里更改你想要的宽度
        }
    </style>
复制代码
复制代码
var barcode = document.getElementById('barcodeArcher'),
        str = "6902395774234",
        options = {
            format:"CODE128",
            displayValue:true,
            fontSize:36,
            height:100
        };
        JsBarcode(barcode, str, options);//原生


JsBarcode("#barcode1", "6902395774234", {
 ormat: "CODE39",//选择要使用的条形码类型
  width:2,//设置条之间的宽度
  height:23,//高度
  displayValue:true,//是否在条形码下方显示文字
   
  fontOptions:"bold italic",//使文字加粗体或变斜体
  font:"fantasy",//设置文本的字体
  textAlign:"left",//设置文本的水平对齐方式
  textPosition:"top",//设置文本的垂直位置
  textMargin:1,//设置条形码和文本之间的间距
  fontSize:6,//设置文本的大小
  background:"#eee",//设置条形码的背景
  lineColor:"#2196f3",//设置条和文本的颜色。
  margin:15//设置条形码周围的空白边距
});

JsBarcode("#barcode2", "6902395774239", {
  textAlign: "left",
  textPosition: "top",
  font: "cursive",
  fontOptions: "bold",
  fontSize: 6,
  textMargin: 15,
  text: "Special"
});

JsBarcode("#barcode3", "1234", {
  format: "pharmacode",
  displayValue: false,
  height: 50,
  width: 6
});
复制代码

 

posted @   纵一苇之所如-  阅读(664)  评论(0编辑  收藏  举报
编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· DeepSeek 开源周回顾「GitHub 热点速览」
历史上的今天:
2017-11-13 通过ping 主机名,或者主机名对应的IP地址
点击右上角即可分享
微信分享提示