1: 在特定的标签中设置class="pagenext" 这打印机识别到时,会自动的分页。
<style media="print">
.pagenext{page-break-after: always;}
</style>
2:程序控制打印的横向或纵向。
//设置打印时的纸张方向
//0 纵向 1 横向;
function setPortrait(portraitType){
factory.printing.portrait = true;
if (portraitType==1){
factory.printing.portrait = false;
}
}
3:程序设置页面的样式
function setPrintPageInfo(){
factory.printing.header = "";
factory.printing.footer = "";
factory.printing.leftMargin =19.05;
factory.printing.topMargin =19.05;
factory.printing.rightMargin =19.05;
factory.printing.bottomMargin =19.05;
}
还有在程序中追加打印机的对象
<OBJECT classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814" viewastext id="factory"
codebase="smsx.cab#Version=6,5,439,50" width="0" height="0"></OBJECT>