用WebBrowser 打印设置网页时,它的字体不太合适,并且还会自动加上网址页眉之类的东西。
怎么设置字体大小?
和不打印页眉、页脚和网址?
网上看了几个文章,都不行
怎么设置字体大小?
和不打印页眉、页脚和网址?
网上看了几个文章,都不行
解决方案 »
- jsp表格设置,急!!!!!!!!!!
- 类似鲜果,抓虾这样的RSS订阅网站怎么做?RSS的XML我拿到了是不是要解析
- hibernate中outer-join与fetch的区别是什么
- 你页调用showmodaldialog返回后,原页动态绑定的onclick点击出错。
- 80分相送:空目录可以用File.delete()删除,那么删除非空的目录用什么?
- oracle问题
- request对象的setAttribute()方法究竟有什么用呢?
- ■■■百分相求求javaBean封装分页代码。■■■
- 招募斑竹
- 我是个新手 我想学JSP 但不知道怎么入门 请指教
- JPA到底要用哪种写法?
- 请教页面来回传值的问题
http://support.microsoft.com/kb/267240
<head><title>打印</title></head>
<script>
function fn01()
{
try
{
var Wsh=new ActiveXObject("WScript.Shell");
HKEY_Key="header";
Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"");
HKEY_Key="footer";
Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"");
}
catch(e){}
document.getElementById("div1").style.display="none";
document.all.WebBrowser.ExecWB(7,1);
document.getElementById("div1").style.display="block";
}
function fn02()
{
try
{
var Wsh=new ActiveXObject("WScript.Shell");
HKEY_Key="header";
Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"");
HKEY_Key="footer";
Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"");
}
catch(e){}
document.getElementById("div1").style.display="none";
document.all.WebBrowser.ExecWB(6,1);
document.getElementById("div1").style.display="block";
}
</script>
<body>
<OBJECT id=WebBrowser classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 width=0></OBJECT>
<div id="sp1">这里填写打印内容<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>这里填写打印内容
</div>
<div id="div1">
<input type=button value=打印 onclick=fn02()>
<input type=button value=页面设置 onclick=document.all.WebBrowser.ExecWB(8,1)>
<input type=button value=打印预览 onclick=fn01()>
</div>
</body>
</html>
<script defer>
function window.onload() {
factory.printing.header = ""
factory.printing.footer = ""
factory.printing.leftMargin = 0.75
factory.printing.topMargin = 1.5
factory.printing.rightMargin = 0.75
factory.printing.bottomMargin = 1.5
}
</script>
<p><input type="button" value="打印本页"
onclick="factory.printing.Print(false)">
<input type="button" value="页面设置"
onclick="factory.printing.PageSetup()">