極光下載站 - 打造齊全的綠色軟件家園

極光下載站

當前位置: 首頁 技術開發 ASP專區 WEB打印設置解決方案二(利用ScriptX.cab控件改變IE打印設置)

WEB打印設置解決方案二(利用ScriptX.cab控件改變IE打印設置)

時間:2006/7/19 4:26:11 作者:佚名 人氣:2878

下載ScriptX.cab控件,修改codebase的值,默認下面的設置也可以。

頁面加載控件:
<object id="factory" style="display:none" viewastext classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814" codebase=">

控件使用教本:
<script defer> 
       function SetPrintSettings() { 
              // -- advanced features  ,未曾使用過,有待確認。
              factory.printing.SetMarginMeasure(2)    // measure margins in inches 
              factory.SetPageRange(false, 1, 3)          // need pages from 1 to 3 
              factory.printing.printer = "HP DeskJet 870C" 
              factory.printing.copies = 2 
              factory.printing.collate = true 
              factory.printing.paperSize = "A4" 
              factory.printing.paperSource = "Manual feed" 

              // -- basic features  使用過
              factory.printing.header = "This is MeadCo" 
              factory.printing.footer = "Advanced Printing by ScriptX" 
              factory.printing.portrait = false     //方向,true
              factory.printing.leftMargin = 1.0 
              factory.printing.topMargin = 1.0 
              factory.printing.rightMargin = 1.0 
              factory.printing.bottomMargin = 1.0
    
             factory.printing.Print(false)      //直接打印,true ,好像不起作用,總是彈出選擇打印機窗口
             factory.printing.PageSetup()   //打印設置
             factory.printing.Preview()         //打印預覽
       } 
</script>

<

公眾號

彩票平台大全