C# 快递单批量打印

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/LYfrighting/article/details/81361853

接着上一个单个快递单打印来做个升级

     最主要就是在调取排版的时候有变化

<script>
        function myPrintSetupyundaBatchPrint() {//批量打印韵达快递单
            LODOP = getLodop(document.getElementById('LODOP_OB'), document.getElementById('LODOP_EM'));
            LODOP.PRINT_INITA(0, 0, 1500, 1100, "打印");
            LODOP.SET_SHOW_MODE("BKIMG_TOP", -25);
            LODOP.SET_PRINT_PAGESIZE(1, 2300, 1290, "CreateCustomPage");
            //  LODOP.SET_PRINTER_INDEX(getSelectedPrintIndex());
            LODOP.ADD_PRINT_SETUP_BKIMG("<img border='0' src='imgs/yunda.jpg'>");
            LODOP.SET_SHOW_MODE("BKIMG_IN_PREVIEW", true);
            // LODOP.SET_PRINT_STYLE("FontName", "微软雅黑");
            LODOP.SET_PRINT_STYLE("FontSize", 11);
            //LODOP.SET_PRINT_STYLE("Bold", 1);  
            var slist = Array();
            slist = document.getElementById("<%=HiddenField1.ClientID %>").value.toString().split('^');
            for (i = 0; i < slist.length; i++) {
                var s = Array();
                s = slist[i].toString().split('~');
                LODOP.NewPage();
                LODOP.ADD_PRINT_TEXT(50, 59, 233, 23, s[0]);
                LODOP.ADD_PRINT_TEXT(74, 129, 75, 23, s[10]);
                LODOP.ADD_PRINT_TEXT(123, 114, 263, 70, s[7]);
                LODOP.ADD_PRINT_TEXT(182, 609, 120, 21, s[4]);
                LODOP.ADD_PRINT_TEXT(123, 403, 276, 68, s[3]);
                LODOP.SET_PRINT_STYLEA(0, "LineSpacing", 10);
                //  LODOP.ADD_PRINT_TEXT(377, 462, 195, 50, s[5]);
                //  LODOP.SET_PRINT_STYLEA(0, "FontSize", 9);
                LODOP.ADD_PRINT_TEXT(206, 154, 113, 23, s[9]);
                LODOP.ADD_PRINT_TEXT(77, 657, 120, 38, s[2]);
                LODOP.SET_PRINT_STYLEA(0, "LineSpacing", 1);
                LODOP.ADD_PRINT_TEXT(77, 461, 110, 35, s[1]);
                LODOP.ADD_PRINT_TEXT(77, 276, 100, 23, s[8]);
                var mdate = new Date();
                LODOP.ADD_PRINT_TEXT(362, 180, 45, 23, mdate.getFullYear());
                LODOP.ADD_PRINT_TEXT(362, 230, 25, 23, mdate.getMonth() + 1);
                LODOP.ADD_PRINT_TEXT(362, 260, 25, 23, mdate.getDate());
                LODOP.ADD_PRINT_TEXT(362, 290, 25, 23, mdate.getHours());
            }
            //  LODOP.PRINT_SETUP(); //维护模式
            //  LODOP.PRINT_DESIGN(); //设计模式
            LODOP.PREVIEW(); //预览模式
        };
    </script>

看出变化了?

就是将读取的数据先分割成一个数组{[1,2],[3.4]},分别读取

 

 

展开阅读全文

没有更多推荐了,返回首页