html 打印

<object id="WebBrowser" classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" height="0"
width="0">
</object>
<input type="button" value="打印" onclick="document.all.WebBrowser.ExecWB(6,1)">
<input type="button" value="直接打印" onclick="document.all.WebBrowser.ExecWB(6,6)">
<input type="button" value="页面设置" onclick="document.all.WebBrowser.ExecWB(8,1)">
<input type="button" value="打印预览" onclick="document.all.WebBrowser.ExecWB(7,1)">
<input type="button" value="直接打印1" onclick="javascript:shows()">


</div>
</body>
<script type="text/javascript">
         function show(){
              document.getElementById("btnsn").style.display="none";
              document.all.WebBrowser.ExecWB(6,1);
              document.getElementById("btnsn").style.display="block";
         }
         function shows(){
             alert("当您打印的时候,按钮会自动隐藏!");
             document.getElementById("btnsn").style.display="none";
             document.all.WebBrowser.ExecWB(6,6);
             document.getElementById("btnsn").style.display="block";
         }
</script>

你可能感兴趣的:(print)