LODOP演示如何打印条形码
更新:2023-01-11 19:59:12
人气:2070
来源:本站原创
A+
Lodop绘制条码图功能让条码打印变得很简单,客户端不用安装专门的条码字库,该函数格式如下:
ADD_PRINT_BARCODE(Top,Left,Width,Height,BarCodeType,BarCodeValue);
关键参数含义:
Width 条码的总宽度,计量单位px(1px=1/96英寸)
Height 条码的总高度(一维条码时包括文字高度)
BarCodeType 条码的类型(规制)名称
BarCodeValue 条码值
目前控件支持的条码类型有如下26种,包含24种一维码和2种二维码:
128A 128B 128C 128Auto EAN8 EAN13 |
EAN128A EAN128B EAN128C Code39 39Extended 2_5interleaved |
2_5industrial 2_5matrix UPC_A UPC_E0 UPC_E1 UPCsupp2 |
UPCsupp5 Code93 93Extended MSI PostNet Codabar |
QRCode PDF417 |
演示各种条码(条形码及二维码的生成)
注意:打印设计中改变对象区域大小时,条码会自动随之适应调整,也可以360度范围随便定义旋转方向。
双击对象,在弹出的属性窗口中修改其它属性,然后生成程序代码看看其实现方法。
示例代码:
<input type="button" value="打印预览" name="B3" onclick="prn_Preview()">
function prn_Preview() {
CreatePrintPage();
LODOP.PREVIEW();
};
function CreatePrintPage() {
LODOP=getLodop(document.getElementById('LODOP1'),document.getElementById('LODOP_EM1'));
LODOP.PRINT_INITA(0,0,800,1600,"打印控件功能演示_Lodop功能_打印条码");
LODOP.ADD_PRINT_BARCODE(28,34,307,47,"128A","123456789012");
LODOP.ADD_PRINT_BARCODE(88,32,206,78,"128B","123456789012");
LODOP.SET_PRINT_STYLEA(0,"FontSize",18);
LODOP.ADD_PRINT_BARCODE(107,255,161,64,"128C","888888");
LODOP.SET_PRINT_STYLEA(0,"Color","#FF0000");
LODOP.ADD_PRINT_BARCODE(179,42,130,47,"128Auto","12345678901");
LODOP.ADD_PRINT_BARCODE(252,42,153,54,"EAN8","12345678");
LODOP.SET_PRINT_STYLEA(0,"Angle",180);
LODOP.ADD_PRINT_BARCODE(173,244,235,172,"EAN13","1234567890123");
LODOP.SET_PRINT_STYLEA(0,"Angle",35);
LODOP.ADD_PRINT_BARCODE(351,34,360,36,"EAN128A","123456789012");
LODOP.SET_PRINT_STYLEA(0,"ShowBarText",0);
LODOP.ADD_PRINT_BARCODE(403,34,360,47,"EAN128B","123456789012");
LODOP.SET_PRINT_STYLEA(0,"AlignJustify",2);
LODOP.ADD_PRINT_BARCODE(462,34,360,47,"EAN128C","123456789012");
LODOP.ADD_PRINT_BARCODE(513,34,360,47,"Code39","*123ABC4567890*");
LODOP.SET_PRINT_STYLEA(0,"Color","#0000FF");
LODOP.ADD_PRINT_BARCODE(570,34,360,47,"39Extended","*1234567890*");
LODOP.ADD_PRINT_BARCODE(621,34,360,47,"2_5interleaved","123456789012");
LODOP.ADD_PRINT_BARCODE(677,34,360,47,"2_5industrial","123456789012");
LODOP.ADD_PRINT_BARCODE(729,34,360,47,"2_5matrix","123456789012");
LODOP.SET_PRINT_STYLEA(0,"Color","#408080");
LODOP.ADD_PRINT_BARCODE(787,34,360,47,"UPC_A","089600124569");
LODOP.ADD_PRINT_BARCODE(844,34,135,64,"UPC_E0","08960007");
LODOP.ADD_PRINT_BARCODE(65,595,45,95,"UPC_E1","1122333");
LODOP.SET_PRINT_STYLEA(0,"Angle",90);
LODOP.ADD_PRINT_BARCODE(87,676,57,122,"UPCsupp2","12345");
LODOP.SET_PRINT_STYLEA(0,"Angle",90);
LODOP.ADD_PRINT_BARCODE(359,435,78,181,"UPCsupp5","123456789012");
LODOP.SET_PRINT_STYLEA(0,"Angle",90);
LODOP.ADD_PRINT_BARCODE(309,579,44,238,"Code93","BJ100080");
LODOP.SET_PRINT_STYLEA(0,"Angle",90);
LODOP.ADD_PRINT_BARCODE(241,663,73,246,"93Extended","123456789012");
LODOP.SET_PRINT_STYLEA(0,"Angle",-90);
LODOP.ADD_PRINT_BARCODE(583,419,58,251,"MSI","123456789012");
LODOP.SET_PRINT_STYLEA(0,"Color","#FF00FF");
LODOP.SET_PRINT_STYLEA(0,"ShowBarText",0);
LODOP.SET_PRINT_STYLEA(0,"Angle",90);
LODOP.ADD_PRINT_BARCODE(589,504,74,270,"PostNet","123456789012");
LODOP.SET_PRINT_STYLEA(0,"Angle",90);
LODOP.ADD_PRINT_BARCODE(565,626,115,253,"Codabar","123456789012");
LODOP.SET_PRINT_STYLEA(0,"Angle",285);
LODOP.ADD_PRINT_BARCODE(30,405,176,67,"PDF417","我是pdf417value");
LODOP.ADD_PRINT_BARCODE(130,434,168,146,"QRCode","1234567890版本7的最大值是122个字符123123");
LODOP.SET_PRINT_STYLEA(0,"GroundColor","#0080FF");
};
推荐的文章
随手记
- ● 统信UOS开机指定网址全屏启动自带浏览器以及屏蔽ALT+F4关闭
- ● xshellSSH连接Linux服务器防止超时退出
- ● php8开启OpenSSL扩展库报错disabledinstallext
- ● 统信系统linux安装php时的报错libxml-2.0>=2.7.6
- ● tidb关闭sql_mode=ONLY_FULL_GROUP_BY模式
- ● windows10如何开机自动运行bat文件
- ● Win10Mysql8初始密码丢失,初始化又不显示密码
- ● UOS系统关闭防火墙或者放行tcp80端口
- ● 统信系统UOS纯命令行与图形模式界面桌面切换方法
- ● javascript(js)的小数点乘法除法问题详解
PHP经验分享
- ● apache下php生成验证码图片不能显示
- ● PHP使用AES加密解密示例(无偏移)
- ● Pluginmysql_native_passwordreported:''mysql_native_password'isdeprecate问题
- ● PHP实现计算CRC-16/MODBUS校验位
- ● MySQLSUM在没有符合查询条件时返回结果为空的处理办法
- ● 如何开启PHP8的JIT提升运行速度
- ● 钉钉API接口-用PHP+Curl实现获取用户信息
- ● 钉钉API接口-用PHP+Curl实现获取应用Access_Token
- ● 在PHP中使用CURL,“撩”服务器只需几行——phpcurl详细解析和常见大坑
- ● MySQLInnodb并发涉及参数说明