首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java面试 >

jsp 用window.print()打印,怎么去掉页眉页脚

2012-06-29 
jsp 用window.print()打印,如何去掉页眉页脚如题打印的时候老是有时间,页码,网址什么的,怎么去掉啊?急急急

jsp 用window.print()打印,如何去掉页眉页脚
如题
打印的时候老是有时间,页码,网址什么的,怎么去掉啊?急急急。。。。。。。。
网上找那些办法都不行。。~~~~(>_<)~~~~


只有9分了

[解决办法]
添加ActiveX控件就可以了
http://blog.sina.com.cn/s/blog_629788b70100n9zr.html
[解决办法]
在window.print();之前 添加这些就可以了
var HKEY_Root,HKEY_Path,HKEY_Key;

HKEY_Root="HKEY_CURRENT_USER";

HKEY_Path="\\Software\\Microsoft\\Internet Explorer\\PageSetup\";

var head,foot,top,bottom,left,right;

 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,"");

HKEY_Key="margin_bottom";

//设置下页边距(0) 根据你自己要设置的填入 


Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"0");

HKEY_Key="margin_left";

//设置左页边距(0) 根据你自己要设置的填入 


Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"0");

HKEY_Key="margin_right";

//设置右页边距(0)

Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"0");

HKEY_Key="margin_top";

//设置上页边距(8)

Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"8");

热点排行