1.电脑安装c-Lodop 下载地址 http://www.lodop.net/download.html
安装成功
2. 在要控制打印页面引入 LodopFuncs.js
3.
template:
<el-button @click="onStart">打印</el-button>
script:
onStart: function () {
let LODOP=getLodop();
LODOP.PRINT_INIT("");
LODOP.SET_PRINT_PAGESIZE(1, 750, 1280);
this.AddPrintContent("10101010101010", "郭德强");
LODOP.PRINT();
},
AddPrintContent: function (strCode, strName) {
LODOP.SET_PRINT_STYLE("FontColor", 16711680);
LODOP.ADD_PRINT_TEXT(15, 70, 157, 25, "交通银行( )");
LODOP.SET_PRINT_STYLEA(2, "FontName", "隶书");
LODOP.SET_PRINT_STYLEA(2, "FontSize", 11);
LODOP.SET_PRINT_STYLEA(2, "FontColor", 0);
LODOP.ADD_PRINT_TEXT(41, 166, 70, 20, "2008年11月9日");
LODOP.ADD_PRINT_TEXT(55, 166, 70, 20, "个人业务受理书");
LODOP.SET_PRINT_STYLEA(4, "FontColor", 0);
LODOP.ADD_PRINT_TEXT(75, 37, 431, 20, "机构:109110 交易代码:010110");
LODOP.ADD_PRINT_TEXT(102, 37, 431, 20, "个人网银用户签约成功!");
LODOP.ADD_PRINT_TEXT(129, 37, 431, 20, "网点名称:东城分行营业部");
LODOP.ADD_PRINT_TEXT(156, 37, 431, 20, "主卡卡号:" + strCode);
LODOP.ADD_PRINT_TEXT(183, 37, 431, 20, "客户姓名:" + strName);
LODOP.ADD_PRINT_TEXT(212, 37, 431, 20, "登陆方式:用户名登陆");
LODOP.ADD_PRINT_