zoukankan      html  css  js  c++  java
  • 打印print

    <script type="text/javascript">
    function printpreview() {
    try {
    var HKEY_Root, HKEY_Path, HKEY_Key;
    HKEY_Root = "HKEY_CURRENT_USER";
    HKEY_Path = "\Software\Microsoft\Internet Explorer\PageSetup\";
    var Wsh = new ActiveXObject("WScript.Shell");
    HKEY_Key = "header";
    Wsh.RegWrite(HKEY_Root + HKEY_Path + HKEY_Key, "");
    HKEY_Key = "footer";
    Wsh.RegWrite(HKEY_Root + HKEY_Path + HKEY_Key, "");
    }
    catch (e) {
    }
    }
    function printerDiv(printpage) {

    var headstr = "<html><head><title></title></head><body>";
    var footstr = "</body>";
    var newstr = document.all.item(printpage).innerHTML;
    var oldstr = document.body.innerHTML;
    document.body.innerHTML = headstr + newstr + footstr;
    window.print();
    document.body.innerHTML = oldstr;
    printpreview();
    return;
    }
    </script>
    <div class="main_content">
    <div class="bread_crumbs">
    <a href="#"><span class="home_icon"></span>首页</a>&nbsp; > &nbsp;<label>订单管理</label></div>
    <div style="margin-top: 20px; margin-left: 20px; font-size: 20px; color: Black; font-weight: bold;">
    <a onclick="printerDiv('content')" style="cursor: hand; cursor: pointer;">打 印 </a>
    </div>

  • 相关阅读:
    Java annotation
    子类 父类强转 HttpServlet service实现
    父类 子类 强转
    HttpServlet Service方法
    java go
    IO写 PrintWriter
    IO读 BufferedReader+FileReader
    Java NIO-3
    心跳包(HeartBeat)
    Git学习笔记(一)
  • 原文地址:https://www.cnblogs.com/zwei1121/p/3919137.html
Copyright © 2011-2022 走看看