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>

  • 相关阅读:
    我是怎么做App token认证的
    APP和服务端-架构设计(二)
    APP和服务端-架构设计(一)
    拦截和跟踪HTTP请求的主要方法及实现
    权限控制方案之——基于URL拦截
    你真的会用Retrofit2吗?Retrofit2完全教程
    科学的解决Http Token拦截器TokenInterceptor实现
    谈谈敏捷开发(转)
    Modbus TCP 示例报文
    Modbus 通信协议详解
  • 原文地址:https://www.cnblogs.com/kaiwanlin/p/3704843.html
Copyright © 2011-2022 走看看