您的位置:首页 > Web前端 > JavaScript

用javascript设置IE的打印页边距

2007-01-22 13:18 232 查看
<html>
<head><tilte></title></head>
<SCRIPT LANGUAGE=javascript>
function setPrint()
{
factory.printing.PageSetup();
}
function previewPrint()
{
WB.ExecWB(7,1)
}
function initPrintSet()
{
factory.printing.header = "Hello Ken";
factory.printing.footer = "Good Bye Ken";
factory.printing.leftMargin = 8;
factory.printing.topMargin = 1.5;
factory.printing.rightMargin = 0.75;
factory.printing.bottomMargin = 1.5;
//factory.printing.printBackground = true;
factory.printing.portrait = false;
}
</SCRIPT>

<body onload="initPrintSet()">
<OBJECT classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814" id="factory" codebase="http://www.meadroid.com/scriptx/ScriptX.cab#Version=6,1,429,14" width=0>
</OBJECT>

<INPUT type="button" value="Set" id=button1 name=button1 onclick="setPrint();">
<INPUT type="button" value="Preview" id=button2 name=button2 onclick="previewPrint();">
</body>
</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: