lodop.PRINT_INIT("wageSalaryRetireRecordService"); var strBodyStyle = "<style>" + document.getElementById("print_style").innerHTML + "</style>"; setTimeout(function () { var strFormHtml = strBodyStyle + "<body>" + document.getElementById("print_area1").innerHTML + "</body>"; lodop.SET_PRINT_STYLEA(0, "ItemType", 1); lodop.SET_PRINT_STYLEA(0, "LinkedItem", 1); lodop.SET_PRINT_STYLEA(0, "Vorient", 3); lodop.SET_PRINT_STYLEA(0, "FontName", "仿宋"); lodop.SET_PRINT_STYLEA(0, "LineSpacing", "14pt"); lodop.SET_SHOW_MODE("LANDSCAPE_DEFROTATED", 1); // 设置显示模式(显示模式的名称, 显示模式的值) lodop.NewPageA(); //page_index lodop.ADD_PRINT_HTM('10mm', '1%', "94%", '25mm', document.getElementById("page_index1").innerHTML); //内容 lodop.ADD_PRINT_TABLE('2.54cm', '2.8cm', "RightMargin:2.8cm", "BottomMargin:2.54cm", strFormHtml); //页码 lodop.ADD_PRINT_HTM("282mm", "48%", "200mm", 100, "<font color='#000'><span tdata='pageNO'>第##页</span>/<span tdata='pageCount'> 共##页</span></font>"); // 打印页码 lodop.SET_PRINT_STYLEA(0,"ItemType",1); //ItemType:设置上面的为页眉页脚,每页固定位置输出 //新切一页 lodop.NewPageA(); //流程 lodop.ADD_PRINT_HTM('2.54cm', '2.8cm', "RightMargin:2.8cm", "BottomMargin:2.54cm", document.getElementById("comments").innerHTML); lodop.PREVIEW(); }, 2000);
table格式要求:
标签:SET,cm,innerHTML,表头,STYLEA,lodop,PRINT,table From: https://www.cnblogs.com/skytiger/p/17215501.html