lodop 简单实现订单批量打印

引入lodop插件

引入webuploader.js

代码:

var LODOP;
//定义用来点击打印时调用的函数
function myPrintSetup1(datasNum) {
    CreatePage1(datasNum);
    //纸张大小
    LODOP.SET_PRINT_PAGESIZE(1,2300,1520,'');
    LODOP.ADD_PRINT_SETUP_BKIMG("img/newsswl.jpg'/>");
    LODOP.SET_PRINT_STYLEA('a',"FontSize",14);
    LODOP.SET_PRINT_STYLEA('b',"FontSize",14);
    LODOP.SET_PRINT_STYLEA('c',"FontSize",10);
    LODOP.SET_PRINT_STYLEA('d',"FontSize",10);
    LODOP.SET_PRINT_STYLEA('e',"FontSize",10);
    LODOP.SET_PRINT_STYLEA('f',"FontSize",10);
    LODOP.SET_PRINT_STYLEA('g',"FontSize",10);
    LODOP.SET_PRINT_STYLEA('h',"FontSize",10);
    LODOP.SET_PRINT_STYLEA('i',"FontSize",10);
    LODOP.SET_PRINT_STYLEA('j',"FontSize",10);
    LODOP.SET_PRINT_STYLEA('k',"FontSize",10);
    LODOP.SET_PRINT_STYLEA('l',"FontSize",10);
    LODOP.SET_PRINT_STYLEA('m',"FontSize",10);
    LODOP.SET_PRINT_STYLEA('n',"FontSize",10);
    LODOP.SET_SHOW_MODE("SETUP_IN_BROWSE",1);
    LODOP.SET_SHOW_MODE("SETUP_ENABLESS","11111111000000");//隐藏关闭(叉)按钮
    LODOP.SET_SHOW_MODE("HIDE_GROUND_LOCK",true);//隐藏纸钉按钮
    LODOP.SET_SHOW_MODE("BKIMG_LEFT",'-80px');//BKIMG_LEFT”:设置背景图位置X值
    //LODOP.PREVIEW();    //预览打印
    LODOP.PRINT();
};

function CreatePage1(datasNum) {
    LODOP=getLodop();
    LODOP.PRINT_INIT("生生物流订单打印");
    for(var i=0;i');
        LODOP.ADD_PRINT_TEXTA('m',320,165,180,24,datasNum[i]['cp_no']);
        LODOP.ADD_PRINT_TEXTA('n',458,35,50,24,datasNum[i]['to_insure_value']);
        LODOP.NEWPAGE();  //强制分页
    }

你可能感兴趣的:(lodop 简单实现订单批量打印)