zoukankan      html  css  js  c++  java
  • web打印功能

    1.http://www.jb51.net/article/38083.htm

    2。

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
       
    </head>
    <body>
        <form id="form1" runat="server">
        <div id="PrintContent" runat="server">
            ASP.NET网页打印测试<br />
            内容内容内容内容内容内容内容内容内容内容内容内容内容<br />
            内容内容内容内容内容内容内容内容内容内容内容内容内容<br />
            内容内容内容内容内容内容内容内容内容内容内容内容内容<br />
            内容内容内容内容内容内容内容内容内容内容内容内容内容<br />
            内容内容内容内容内容内容内容内容内容内容内容内容内容<br />
            内容内容内容内容内容内容内容内容内容内容内容内容内容<br />
            内容内容内容内容内容内容内容<br />
        </div>
        <asp:Button ID="btnPrint" runat="server" Text="打印" OnClientClick="return PrintArticle();" />
        </form>
    </body>
    </html>
    <script type="text/javascript">
        function PrintArticle() {
            var pc = document.getElementById("<%=PrintContent.ClientID%>");
            var pw = window.open('', '', 'width=500,height=400'); pw.document.write('<html>');
            pw.document.write('<head>'); pw.document.write('<title>ASP.NET网页打印测试</title>'); pw.document.write('</head>');
            pw.document.write('<body>'); pw.document.write(pc.innerHTML); pw.document.write('</body>');
            pw.document.write('</html>'); pw.document.close();
            setTimeout(function () {
                pw.print();
            }, 500); return false;
        }
        </script>

  • 相关阅读:
    Oracle merge
    ORA-1461 encountered when generating server alert SMG-3500
    COALESCE NVL NVL2 DECODE
    oracle限制ip訪問
    java动态代理实现与原理详细分析
    MySql/Oracle树形结构查询
    微信公众号Java接入demo
    支付宝转账
    支付宝 查看订单 退款
    linux网络编程--UNIX域套接字
  • 原文地址:https://www.cnblogs.com/kaiwanlin/p/3704843.html
Copyright © 2011-2022 走看看