欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

JavaWeb實(shí)現(xiàn)打印功能

 更新時(shí)間:2016年05月29日 11:19:05   作者:abin  
這篇文章主要介紹了JavaWeb實(shí)現(xiàn)打印功能的相關(guān)資料,非常不錯(cuò)具有參考借鑒價(jià)值,需要的朋友可以參考下

廢話不多說了,直接給大家貼代碼了,具體代碼如下所示:

<script language="javascript"> 
  function printsetup(){ 
  // 打印頁面設(shè)置 
  wb.execwb(8,1); 
  } 
  </script> 
  </head> 
  <body> 
  <OBJECT classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"  height=0 id=wb name=wb width=0></OBJECT> 
  <input type=button class="button" name=button_setup value="打印頁面設(shè)置" onclick="javascript:printsetup();"> 

整理的關(guān)于打印的內(nèi)容

1、控制"縱打"、 橫打”和“頁面的邊距。

(1)<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
 factory.printing.leftMargin = 1.0
 factory.printing.topMargin = 1.0
 factory.printing.rightMargin = 1.0
 factory.printing.bottomMargin = 1.0
}
</script>

(2)

<script language="javascript">
  function printsetup(){
  // 打印頁面設(shè)置
  wb.execwb(8,1);
  }
  function printpreview(){
  // 打印頁面預(yù)覽
    
  wb.execwb(7,1);
     
    
  }
  function printit()
  {
  if (confirm('確定打印嗎?')) {
  wb.execwb(6,6)
  }
  }
  </script>
</head>
<body>
<OBJECT classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"
height=0 id=wb name=wb width=0></OBJECT>
<input type=button name=button_print value="打印"
onclick="javascript:printit()">
<input type=button name=button_setup value="打印頁面設(shè)置"
onclick="javascript:printsetup();">
<input type=button name=button_show value="打印預(yù)覽"
onclick="javascript:printpreview();">
<input type=button name=button_fh value="關(guān)閉"
onclick="javascript:window.close();">

關(guān)于這個(gè)組件還有其他的用法,列舉如下:

WebBrowser.ExecWB(1,1) 打開
Web.ExecWB(2,1) 關(guān)閉現(xiàn)在所有的IE窗口,并打開一個(gè)新窗口
Web.ExecWB(4,1) 保存網(wǎng)頁
Web.ExecWB(6,1) 打印
Web.ExecWB(7,1) 打印預(yù)覽
Web.ExecWB(8,1) 打印頁面設(shè)置
Web.ExecWB(10,1) 查看頁面屬性
Web.ExecWB(15,1) 好像是撤銷,有待確認(rèn)
Web.ExecWB(17,1) 全選
Web.ExecWB(22,1) 刷新
Web.ExecWB(45,1) 關(guān)閉窗體無提示

2、分頁打印

<HTML>
<HEAD>
<STYLE>  
  P {page-break-after: always}
</STYLE>
</HEAD>
<BODY>
<%while not rs.eof%>
<p><%=rs(0)%></P>
<%rs.movenext%>
<%wend%>
</BODY>
</HTML>

以上所述是小編給大家介紹的JavaWeb實(shí)現(xiàn)打印功能的相關(guān)內(nèi)容,希望能夠幫助到大家!

相關(guān)文章

最新評論