javascript实现window.print()去除页眉页脚
打印时去除页眉页页脚打印前加入下面代码即可varHKEY_Root,HKEY_Path,HKEY_Key;
HKEY_Root="HKEY_CURRENT_USER";
HKEY_Path="\\Software\\Microsoft\\InternetExplorer\\PageSetup\\";
varhead,foot,top,bottom,left,right;
varWsh=newActiveXObject("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,"1");
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,"1");
热门推荐
10 财运虎年祝福语简短语
11 单亲爸爸春节祝福语简短
12 狗狗上厕所训练
13 植物种植祝福语简短
14 翻译考试祝福语朋友简短
15 个人周年庆简短祝福语
16 狗狗怎么训练
17 分别祝福语简短搞笑英文
18 生日广州男生祝福语简短