关键代码
printDialysisRecordSheet() {
var LODOP = getLodop();;
LODOP.PRINT_INIT("");
var style = "<style>" + document.getElementById("divPrint").innerHTML + "</style>";
var style1 = " <link href='/Metronic/assets/global/plugins/bootstrap/css/bootstrap.min.css' type='text/css' rel='stylesheet' />";
var strStyle2 = "<style>td {border:solid 1px black;border-collapse: collapse }</style>";
var strStyle3 = "<style>table,td{border:solid 1px black;border-collapse: collapse }</style>";
var style4 = "<link href='/Metronic/assets/global/css/components.min.css' type='text/css' rel='stylesheet'/>"
var style5 = " <link href='/App/Main/common/printDialysisRecord.css' rel='stylesheet'>"
for (var i = 0; i < app.items.length; i++) {
var recordId = app.items[i].recordId;
LODOP.ADD_PRINT_HTM(50, "1%", "98%", 900, style + style1 + strStyle2 + strStyle3 + style4 + style5 + document.getElementById(recordId).innerHTML);
LODOP.NewPage();
LODOP.ADD_PRINT_HTM(1060, "40%", 300, 100, "<font color='#333' format=''><span tdata='pageNO'>第 ## 页</span><span tdata='pageCount' style='margin-left:15px;'>共 ## 页</span></font>");
LODOP.SET_PRINT_STYLEA(0, "ItemType", 1);
LODOP.SET_PRINT_PAGESIZE(1, 0, 0, "A4");
}
LODOP.PREVIEW();
}