页眉重叠且多出下边距
let nowHtmlText = `<div id="page1" class="breakable" style="line-height:28px;word-break:break-all;">${printObj.contentText}</div>`const jcp = getJCP();
var myDoc = {
settings : {
paperWidth : "185.5mm", // 纸张宽度
paperHeight : "265.5mm", // 纸张高度
duplex : 3, // 1: 不双面打印, 2:左侧装订, 3: 上方装订
portrait : true, // 纵向
marginLeft : 7, //设置左边距,单位为mm
marginTop : 12,
marginRight : 9,
marginBottom : 5
},
header:{
html:`
<div style="width:185.5mm;text-align:center;font-size:21px;font-family:'楷体';">${printObj.headerText}</div>
<div style="width:185.5mm;text-align:center;font-size:28px;font-family:'黑体';font-weight: bold;">${printObj.titleText}</div>
<div style="width:185.5mm;>
<span style="display:inline-block;width:25%">${printObj.patinetMsg.dept}</span>
<span style="display:inline-block;width:25%">${printObj.patinetMsg.wardDept}</span>
<span style="display:inline-block;width:10%">${printObj.patinetMsg.bedNo}</span>
<span style="display:inline-block;width:17%">${printObj.patinetMsg.name}</span>
<span style="display:inline-block;width:20%">${printObj.patinetMsg.inpatNum}</span>
</div>
`,
},
footer:{
html:`<div style="width:185.5mm;text-align: center;">第 #p 页</div>`
},
documents : {
pages:nowHtmlText
},
copyrights : '版权信息'
};
//jcp.print(myDoc)
jcp.printPreview(myDoc,true)
代码如上
图片如下
[img]C:\Users\Administrator\Desktop\20190808113109.png[/img]
[img]C:\Users\Administrator\Desktop\20190808113121.png[/img]
见附件 此为bug,现已修正,谢谢!
页:
[1]