web网页使用javascript连接打印机进行配置打印

网络技术 1566 0 2014-12-30

web网页使用javascript连接打印机进行配置打印
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
    <head>
        <meta http-equiv="content-type" content="text/html; charset=gb2312" />
        <title>
            WU XIN
        </title>
        <style type="text/css" media=print>
            .noprint{display : none } .PageNext{ PAGE-BREAK-AFTER: always }
        </style>
        <style type="text/css">
            .colorcss{ background-color:#B8E3FA; }
        </style>
        <SCRIPT language=javascript>
            function printsetup() {
                // 打印页面设置 
                wb.execwb(8, 1);
            }
            function printpreview() {
                // 打印页面预览 
                wb.execwb(7, 1);

            }

            function printit() {
                if (confirm('确定打印吗?')) {
                    wb.execwb(6, 6)
                }
            }
        </SCRIPT>
    </head>
    
    <body>
<!--调用active-->
        <OBJECT classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" height=0 id=wb name=wb width=3></OBJECT>
        <input class="noprint" type=button name=b utton value="打印" onclick="  javascript  :printit();">
        <input class="noprint" type=button name=button value="打印页面设置" onclick="  javascript  :  printsetup();">
        <input class="noprint" type=button name=button_show value="打印预览" onclick="javascript:printpreview();">
        <input class="noprint" type=button name=b utton value="关闭" onclick="    javascript:window.close();">
        <!--startprint-->
        <p class="noprint colorcss">
           不打印该区域
        </p>
        <p class="colorcss">
            打印区域
        </p>
        <!---endprint-->
    </body>

</html>

上一篇:服务器与虚拟主机、空间的区别

下一篇:网页发送udp数据问题总结,但还没有实现

讨论数量:0

请先登录再发表讨论。 2024-04-26

天涯网魂
3 杠 5 星
TA 的文章
TA 的随言
TA 的资源链