<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>
<BODY>
<OL>
<LI>windows2000中打印无对话框,但在winxp中有对话框
<OBJECT id=WebBrowser classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 width=0></OBJECT>
<input type=button value="Print" class=btn onclick="document.all.WebBrowser.ExecWB(6,6)">
<input type=button value=prt name=p onclick="document.execCommand('Print');">
<br>
<LI>开始控件打印,无打印弹出对话框
</OL>
<object id=factory viewastext style="display:none"
classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814"
codebase="http://www.meadroid.com/scriptx/ScriptX.cab#Version=6,2,433,14">
</object>
<script defer>
function window.onload() {
// -- advanced features
factory.printing.SetMarginMeasure(2); // measure margins in inches
factory.printing.printer = "HP DeskJet 870C";
factory.printing.paperSize = "A4";
factory.printing.paperSource = "Manual feed";
factory.printing.collate = true;
factory.printing.copies = 2;
factory.printing.SetPageRange(false, 1, 3); // need pages from 1 to 3
// -- 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;
}
function Print(frame) {
factory.printing.Print(true, frame) // print with prompt
}
function printTure() //打印函数
{
document.all("dayinDiv").style.display="none";//隐藏按钮
factory.printing.Print(false); //调用控件打印
document.all("dayinDiv").style.display="";//显示
}
</script>
<DIV align="center" id="dayinDiv" name="dayinDiv">
<input type=button value="打印本页" onclick="printTure()">
<input type=button value="页面设置" onclick="factory.printing.PageSetup()">
<input type=button value="打印预览" onclick="factory.printing.Preview()"><br>
</DIV>
</BODY>
</HTML>