网页打印—— ScriptX

官网:[url]www.meadroid.com/ScriptX/[/url]
引用ScriptX.cab
<OBJECT  id=factory  style="DISPLAY:  none"  
codeBase=../../cicerone/ScriptX.cab#Version=5,60,0,360
classid=clsid:1663ed61-23eb-11d2-b92f-008048fdd814 viewastext></OBJECT>


几个属性:
<script language=JavaScript>
function setPrintBase(headerText,footerText,rootUrl) {
//var header = (headerText==null||headerText=="")?'默认页眉':headerText;
//var footer = (footerText==null||footerText=="")?'默认页角':footerText;
//factory.printing.header = "&b"+header+"&b" ;
//factory.printing.footer = "&b"+footer;
factory.printing.portrait = true;
factory.printing.leftMargin =0.00;
factory.printing.topMargin =0.00;
factory.printing.rightMargin =0.00;
factory.printing.bottomMargin =0.00;
}
</SCRIPT>


几个方法:
<input name="printbutton" type="button"  class="input" value="打印"  onclick="factory.printing.Print(true)" > 
<input id="idPrint2" type="button" value="页面设置" class="input"
onclick="factory.printing.PageSetup()">
<input id="idPrint3" type="button" value="打印预览" class="input"
onclick="factory.printing.Preview()">
<input name="backbutton" type="button" class="input" value="返回" onClick="javascript:history.go(-1)">

PageSetup()中能设置上下左右边距,挺好用
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值