TSC条码打印机 条形码ActiveXbarcode()方法参数详解
ActiveXbarcode(a,b,c,d,e,f,g,h,i)
例子:
HTML部分代码
<table id="datalist"></table>
JS部分代码
function reportprinting() {var selectrow = $("#datalist").datagrid("getChecked");if (DetectActiveX() == true) {var now = new Date();$.messager.confirm('确认', '您确定要打印选中的' + selectrow.length + '行记录?', function (r) {if (r == true) {$.each(selectrow, function (i, record) {//选择多条记录markPrint(now, record);});}});} else {alert("插件未安装!");}}function markPrint(now, record) {//调用DLL封装的打印接口PartProcessIDSingleLablePrint("TSC TTP-342E Pro", 60, 30, record.bill);}/*** 初始化加载dll*/var TSCObj;function PartProcessIDSingleLablePrint(printModel, sizeX, sizeY, bill) {if (DetectActiveX()) {// TSCObj.ActiveXabout();输出版本信息var font = "微软雅黑";var strPrintTime = formatPrintDate(new Date());//取当前时间作为标记时间TSCObj.ActiveXopenport(printModel);//设置打印机型号TSCObj.ActiveXsetup(sizeX, sizeY, "5", "30", "0", "2", "0");//設定標籤的寬度、高度、列印速度、列印濃度、感應器類別、gap/black mark 垂直間距、gap/black mark 偏移距離)TSCObj.ActiveXclearbuffer();//清除缓存TSCObj.ActiveXbarcode("120", "50", "128", "150", "0", "0", "8", "1", bill);//条形码TSCObj.ActiveXwindowsfont(290, 200, 60, 0, 2, 0, "微软雅黑", bill);TSCObj.ActiveXprintlabel("1", "1");TSCObj.ActiveXcloseport();} else {alert("TSC打印机插件未安装,无法打印,请联系技术人员安装打印机插件");}}function DetectActiveX() {try {TSCObj = new ActiveXObject("TSCActiveX.TSCLIB");//初始化,加载dll} catch (e) {return false;}return true;}
TSC TTP-342E Pro打印效果展示