您的位置:首页 > 其它

调用IE打印

2010-11-09 21:45 309 查看
示例1:

<object id="WebBrowser" classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" height="0"
width="0">
</object>
<input type="button" value="打印" onclick="document.all.WebBrowser.ExecWB(6,1)">
<input type="button" value="直接打印" onclick="document.all.WebBrowser.ExecWB(6,6)">
<input type="button" value="页面设置" onclick="document.all.WebBrowser.ExecWB(8,1)">
<input type="button" value="打印OK" onclick="  return  myprint(this);">
<input type="button" value="打印预览" onclick="document.all.WebBrowser.ExecWB(7,1)">


示例2:

1.<center id="center"><input type="button" onclick=javascript:printit()  value="打印" class="input2"/>
2.   <input onclick="this.window.close();" type="button" value="退出" class="input2"/>
3.<INPUT onclick=javascript:printsetup(); type=button value=打印页面设置 class="input2" />
1.<INPUT onclick=javascript:printpreview(); type=button value=打印预览 class="input2" />
1.center>


1.function printa(){
2.        var form = document.getElementById("order1form");
3.        var hid = document.getElementById("print");
4.        hid.value=1;
5.        form.action = "/searchOrder1.do";
6.        form.submit();
7.    }
8.
9.    function go(url){
10.        window.location.href=url;
11.    }
12.    function printsetup(){
13.    // 打印页面设置
14.    wb.execwb(8,1);
15.    }
16.    function printpreview(){
17.    // 打印页面预览
18.
19.    wb.execwb(7,1);
20.
21.
22.    }
23.
24.    function printit()
25.    {
26.    if (confirm('确定打印吗?')) {
27.        var cen = document.getElementById("center");
28.        cen.innerHTML = '';
29.        wb.execwb(6,6)
30.        }
31.    }
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: