web打印不显示页眉页脚
<SCRIPT language=javascript>
function printsetup()//页面设置函数
{
document.all("qingkongyema").click();//打印之前去掉页眉,页脚
document.all("dayinDiv").style.display="none";//打印之前先隐藏不想打印输出的元素(此例中隐藏“打印”和“打印预览”两个按钮)
wb.execwb(8,1);
document.all("dayinDiv").style.display="";//打印之后将该元素显示出来(显示出“打印”和“打印预览”两个按钮,方便别人下次打印)
}
function printpreview()//预览函数
{
document.all("qingkongyema").click();
document.all("dayinDiv").style.display="none";
wb.execwb(7,1);
document.all("dayinDiv").style.display="";
}
function printTure() //打印函数
{
document.all('qingkongyema').click();//同上
document.all("dayinDiv").style.display="none";//同上
window.print();
document.all("dayinDiv").style.display="";
}
function doPage()
{
layLoading.style.display = "none";//同上
}
</SCRIPT>
<OBJECT classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" height=0 id=wb name=wb width=0></OBJECT>
<script language="VBScript">
dim hkey_root,hkey_path,hkey_key
hkey_root="HKEY_CURRENT_USER"
hkey_path="\Software\Microsoft\Internet Explorer\PageSetup"
'//设置网页打印的页眉页脚为空
function pagesetup_null()
on error resume next
Set RegWsh = CreateObject("WScript.Shell")
hkey_key="\header"
RegWsh.RegWrite hkey_root+hkey_path+hkey_key,""
hkey_key="\footer"
RegWsh.RegWrite hkey_root+hkey_path+hkey_key,""
end function
'//设置网页打印的页眉页脚为默认值
function pagesetup_default()
on error resume next
Set RegWsh = CreateObject("WScript.Shell")
hkey_key="\header"
RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"&w&b页码,&p/&P"
hkey_key="\footer"
RegWsh.RegWrite hkey_root+hkey_path+hkey_key,"&u&b&d"
end function
</script>
<BODY background="images/background_01.gif" leftMargin=0
topMargin=0 rightMargin=0 bottomMargin=0 style="BACKGROUND-POSITION: center 50%">
<DIV align=center>
</DIV>
<DIV id="dayinDiv" name="dayinDiv" class="style8">
<input type="button" class="tab" value=" 打印 " onclick="printTure();">
<input type="button" class="tab" value="打印预览" onclick="printpreview();">
<input type="button" class="tab" value="页面设置" onclick="printsetup();">
<input type="hidden" name="qingkongyema" id="qingkongyema" class="tab" value="清空页码" onclick="pagesetup_null()">
<br>
<br>
<strong><span class="style12">在首次打印前请先进行页面设置:</span><span class="style11">纸张大小:B4 (JIS) 左边距:24mm 右边距:31mm 上边距:8mm 下边距:5mm
</span></strong>
<br>
<span class="style13">如果点“页面设置”后所有按钮均不见了,这是由于IE的安全设置太高,觖决方法为:
</span>
<br>
<span class="style13">
进入IE-->工具-->Internet选项-->安全-->自定义级别:“对没有标记为安全的ActiveX控件进行初始化脚本运行”选择“启用”,确认后返回即可!
</span>
</DIV>
上一篇: 关于java中对事件监听的理解 java事件监听布局计算器
下一篇: java内部类的知识点
推荐阅读
-
让Word页眉或页脚中显示的页码从 1 以外的值开始
-
C# 打印网页不显示页眉页脚的实现方法
-
asp.net修改注册表(页面打印时页眉、页脚、页边距、背景颜色和图像)
-
火狐浏览器页面打印的时候怎么设置页眉页脚?
-
C# 操作Word页眉页脚——奇偶页/首页不同、不连续设置页码、复制页眉页脚、锁定页眉页脚、删除页眉页脚
-
缩放Excel2010工作表的同时让页眉和页脚保持100%的大小打印输出
-
Excel表格实用打印技巧 对称页码 页眉页脚 打印注释 错误值
-
Word2003打印主控文档时,每一节的开头都显示错误的页码和页眉
-
js 客户端打印html 并且去掉页眉、页脚的实例
-
让Word页眉或页脚中显示的页码从 1 以外的值开始