• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
  • web打印的終極秘籍(整理)

    發表于:2007-05-25來源:作者:點擊數: 標簽:
    通常在WEB 打印中都需要ScriptX.cab,這里也是一樣,所以原理都是一樣的,這里將要詳細說明的是,如何控制打印的問題。 打印的必須文件有2個: 1:配置文件:setting.js 2:顯示文件:print.js setting.js 如下: document.write(object id=\factory\ style=

    通常在WEB 打印中都需要ScriptX.cab,這里也是一樣,所以原理都是一樣的,這里將要詳細說明的是,如何控制打印的問題。

    打印的必須文件有2個:

    1:配置文件:setting.js
    2:顯示文件:print.js

    setting.js 如下:

    document.write("<object id=\"factory\" style=\"display:none\" viewastext classid=\"clsid:1663ed61-23eb-11d2-b92f-008048fdd814\" codebase=\"images/events/ScriptX.cab#Version=5,60,0,360\"></object>");
    function Printers() {
    agree = confirm('確定打印嗎?');
    if (agree) {
    if (agree)
    {
    NoPrinter.style.visibility='hidden';
    factory.printing.Print();}
    else NoPrinter.style.visibility='visible';
       }
    }

      factory.printing.header = ""
      factory.printing.footer = ""
      factory.printing.leftMargin = 0.75
      factory.printing.topMargin = 0.75
      factory.printing.rightMargin = 0.75
      factory.printing.bottomMargin = 0.75

    顯示文件print.js 如下:

    document.write('<style media="print">@media print { .noprint{display:none} } </style>');
    /////////////////////////////////~~控制打印時不顯示按鈕的樣式,在頁面不需要打印的地方只需要引用該樣式即可
    document.write('<div id=NoPrinter name=NoPrinter align=right style="visibility:visible" class="noprint"><br>&nbsp;');
    document.write('<input type=button class=button value=關閉 name="bFQ" id="bFQ" onclick=\"javascript\:window.close()\">');
    document.write('<input  type="button" value="打印設置" onclick=\"factory.printing.PageSetup()\">');
    document.write('<input type="button" value="打印預覽" onclick=\"factory.printing.Preview()\">');
    document.write('<input type=button name=button3 value="打印" onclick="Printers()">&nbsp;&nbsp;&nbsp;&nbsp;</div>');


    在使用打印功能時,只要把文件2個文件包含在頁面中放置打印按鈕的地方即可,代碼如下:
      <script src="../inc/print/Printer.js"></script>
      <script src="../inc/print/Printers.js"></script>

    原文轉自:http://www.kjueaiud.com

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>