document内容显示与打印的格式不符?
document.all.WebBrowser.ExecWB(7,1)调用打印预览,预览页面中的内容上沿总是离页眉很远,打印出来也是如此——普通显示页面内容的时候是正常的,可能是哪里的问题?
着急...先感谢帮忙了!
问题点数:40、回复次数:3Top
1 楼KimSoft(革命的小酒天天醉-http://blog.csdn.net/kimsoft/)回复于 2006-03-07 13:40:30 得分 0
在打印设置里设置一下。Top
2 楼TIANDALINDE(大林)回复于 2006-03-07 18:43:53 得分 0
如下代码保存成一个html。
页面显示正常,但是菜单“文件”——“打印预览”时,显示的内容第一页中的内容成了“至底”的了...
<html>
<head>
<title>电子政务平台</title>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<link rel="stylesheet" href="../css/printpage.css" type="text/css">
<style media=print>
.Noprint{display:none;}
.PageNext{page-break-after: always;}
</style>
<style type="text/css">
<!--
.nonevalue {
font-style: normal;
}
-->
</style>
<SCRIPT src="../js/publiclist.js"></SCRIPT>
<SCRIPT src="../js/systembar.js"></SCRIPT>
<SCRIPT src="../js/edithtm.js"></SCRIPT>
<SCRIPT src="../js/buttonstyle.js"></SCRIPT>
<SCRIPT src="../js/flatbar.js"></SCRIPT>
</head>
<body leftmargin="0" topmargin="0" id=all scroll=yes onLoad='fix()' onScroll="fix()" onResize="fix()">
<center class="Noprint">
<OBJECT id=WebBrowser classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 width=0>
</OBJECT>
<span id="bar" style="position:absolute; left:0px; top:80px; width:100%; height:45px; z-index:1">
<script language="JavaScript">
writePass("打印");
writeSplitLine();
writeBarBegin("文件管理 -> 文件查阅");
writeBarButton("打 印","../images/button/return.gif","document.all.WebBrowser.ExecWB(6,1)");
writeBarButton("直接打印","../images/button/return.gif","document.all.WebBrowser.ExecWB(6,6)");
//writeBarButton("打印预览","../images/button/return.gif","document.all.WebBrowser.ExecWB(7,1)");
document.write("<td width='1' height='18'></td>");
document.write("<td width='70' height='18' align='center' class='coolButton' onClick='document.all.WebBrowser.ExecWB(7,1)'>");
document.write("<table width='100%' height='100%' border='0' cellspacing='0' cellpadding='0'><tr><td valign='middle'>");
document.write("<img src='../images/button/return.gif' width='16' height='16'></td><td valign='bottom' class=pt9n> ");
document.write("打印预览</td></tr></table></td>");
document.write("<td width='1'></td>");
writeBarButton("页面设置","../images/button/return.gif","document.all.WebBrowser.ExecWB(8,1)");
writeBarButton("关闭","../images/button/return.gif","window.close();");
writeBarEnd();
writeSplitLine();
</script>
</span>
</center>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td height="50"></td></tr>
<tr>
<td><table width="95%" border="0" cellspacing="0" cellpadding="0" align="top" class="nonevalue">
<tr>
<td><br>
<html><head></head><body><P align=center><FONT face=黑体 color=#ff0000 size=+4><STRONG>签 报 运 转 单</STRONG></FONT></P>
<TABLE borderColor=#000000 cellSpacing=0 borderColorDark=#ffffff width=640 align=center borderColorLight=#000000 border=1>
<TBODY>
<TR>
<TD width=79 height=65>
<DIV align=center><FONT face=黑体>事 由</FONT></DIV></TD>
<TD colSpan=3> </TD></TR>
<TR>
<TD height=65>
<DIV align=center><FONT face=黑体>呈报领导</FONT></DIV></TD>
<TD width=231> </TD>
<TD width=79>
<DIV align=center><FONT face=黑体>编号</FONT></DIV></TD>
<TD width=233> </TD></TR>
<TR>
<TD height=65>
<DIV align=center><FONT face=黑体>密 级</FONT></DIV></TD>
<TD>普通</TD>
<TD>
<DIV align=center><FONT face=黑体>缓 急</FONT></DIV></TD>
<TD>普通</TD></TR>
<TR>
<TD height=65>
<DIV align=center><FONT face=黑体>主办单位</FONT></DIV></TD>
<TD> </TD>
<TD>
<DIV align=center><FONT face=黑体>拟 稿 人</FONT></DIV></TD>
<TD>admin</TD></TR>
<TR>
<TD height=65>
<DIV align=center><FONT face=黑体>拟稿日期</FONT></DIV></TD>
<TD>
<P>2006年03月07日</P>
<P> </P></TD>
<TD>
<DIV align=center><FONT face=黑体>联系电话</FONT></DIV></TD>
<TD> </TD></TR>
<TR>
<TD height=65>
<DIV align=center><FONT face=黑体>主办处室<BR>负 责 人</FONT></DIV></TD>
<TD>(***主办处室负责人***)</TD>
<TD>
<DIV align=center><FONT face=黑体>处室会签</FONT></DIV></TD>
<TD> </TD></TR>
<TR>
<TD height=65>
<DIV align=center><FONT face=黑体>(单<BR>位)领导</FONT></DIV></TD>
<TD>(***司局领导***)</TD>
<TD>
<DIV align=center><FONT face=黑体>会签</FONT></DIV></TD>
<TD>(***司局会签***)</TD></TR>
<TR>
<TD height=65>
<DIV align=center><FONT face=黑体>办 公 厅<BR>审 核</FONT></DIV></TD>
<TD> </TD>
<TD>
<DIV align=center><FONT face=黑体> 领 导<BR>签 字</FONT></DIV></TD>
<TD> </TD></TR>
<TR>
<TD height=65>
<DIV align=center><FONT face=黑体><BR>领导意见</FONT></DIV></TD>
<TD colSpan=3>
<P align=left> </P>
<P> </P>
<P> </P></TD></TR>
<TR>
<TD height=65>
<DIV align=center><FONT face=黑体>运转情况</FONT></DIV></TD>
<TD colSpan=3>
<P> 2006年03月07日2006年03月07日</P>
<P> </P>
<P> </P>
<P> </P>
<P> </P>
<P> </P></TD></TR></TBODY></TABLE>
<P> </P></body></html> <div class='PageNext'></div> <html><head></head><body><BR>
<TABLE cellSpacing=0 cellPadding=0 width=640 align=center border=0>
<TBODY>
<TR>
<TD colSpan=2 height=40>
<P align=center><FONT face=黑体 color=#ff0000 size=6><B>签报</B></FONT></P></TD></TR>
<TR>
<TD vAlign=top colSpan=2 height=16>
<HR color=red noShade SIZE=5>
<TR>
<TD style="BORDER-TOP: red 1px solid; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" colSpan=2> </TD>
<TR>
<TD vAlign=top colSpan=2 height=598>
<P><FONT color=#ff0000>意见:</FONT></P>
<P> </P>
<TR>
<TD vAlign=top colSpan=2><FONT color=#ff0000 size=4><STRONG> 呈报领导: </STRONG></FONT></TD></TR>
<TR>
<TD vAlign=top colSpan=2 height=150>
<P>
<HR width="94%" color=red noShade>
</P>
<P><FONT color=#ff0000 size=4><STRONG> 事由: </STRONG></FONT></P>
<P><STRONG><FONT color=#ff0000 size=4></FONT></STRONG> </P>
<P> </P></TD></TR>
<TR>
<TD vAlign=top width=440>
<DIV align=right><FONT color=#ff0000 size=4><STRONG>
<TABLE borderColor=#ff0000 height=103 cellSpacing=0 width=640 border=1>
<TBODY>
<TR>
<TD width=36 height=101><FONT color=#ff0000><STRONG>
<DIV align=center>主办 </DIV></STRONG>
<P align=center><STRONG>司局</STRONG></P></FONT></TD>
<TD width=72> </TD>
<TD width=41>
<DIV align=center><STRONG><FONT color=#ff0000>经办 </FONT></STRONG></DIV>
<P align=center><FONT color=#ff0000><STRONG>处室</STRONG></FONT></P></TD>
<TD width=73> </TD>
<TD width=22>
<DIV align=center><STRONG><FONT color=#ff0000>日<BR><BR>期</FONT></STRONG></DIV></TD>
<TD width=74>2006年03月07日</TD>
<TD width=37>
<DIV align=center><STRONG><FONT color=#ff0000>局 </FONT></STRONG></DIV>
<P align=center><FONT color=#ff0000><STRONG>编号</STRONG></FONT></P></TD>
<TD width=78> </TD>
<TD width=54>
<DIV align=center><STRONG><FONT color=#ff0000>秘书处 </FONT></STRONG></DIV>
<P align=center><FONT color=#ff0000><STRONG>编 号</STRONG></FONT></P></TD>
<TD width=111>(***秘书处编号***)</TD></TR></TBODY></TABLE>签发:</STRONG></FONT></DIV></TD>
<TD vAlign=top width=140> </TD></TR>
<TR>
<TD vAlign=top colSpan=2 height=100></TD></TR>
<TR>
<TD vAlign=top colSpan=2>
<HR color=red noShade SIZE=5>
</TD></TR>
<TR>
<TD style="BORDER-TOP: red 1px solid; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" colSpan=2> </TD></TR></TBODY></TABLE></body></html> <div class='PageNext'></div> <html><head></head><body><P align=center>0307_7打印测试</P>
<P><P>0307_7打印测试</P>
<P>0307_7打印测试</P>
<P>0307_7打印测试</P>
<P>0307_7打印测试</P>
<P>0307_7打印测试</P>
<P>0307_7打印测试</P>
<P>0307_7打印测试</P> </P>
<P> </P>
<P>2006年03月07日 </P></body></html>
</td>
</tr>
</table> </td>
</tr></table>
</body>
</html>Top
3 楼manyou(他山之石【养万头猪,行万里路】)回复于 2006-03-14 16:07:40 得分 40
<html>
<head>
<title>电子政务平台</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../css/printpage.css" type="text/css">
<style media=print>
.Noprint{display:none;}
.PageNext{page-break-after: always;}
</style>
<style type="text/css">
<!--
.nonevalue {
font-style: normal;
}
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
-->
</style>
<SCRIPT src="../js/publiclist.js"></SCRIPT>
<SCRIPT src="../js/systembar.js"></SCRIPT>
<SCRIPT src="../js/edithtm.js"></SCRIPT>
<SCRIPT src="../js/buttonstyle.js"></SCRIPT>
<SCRIPT src="../js/flatbar.js"></SCRIPT>
</head>
<body id=all scroll=yes onLoad='fix()' onScroll="fix()" onResize="fix()">
<center class="Noprint">
<OBJECT id=WebBrowser classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 width=0>
</OBJECT>
<span id="bar" style="position:absolute; left:0px; top:80px; width:100%; height:45px; z-index:1">
<script language="JavaScript">
writePass("打印");
writeSplitLine();
writeBarBegin("文件管理 -> 文件查阅");
writeBarButton("打 印","../images/button/return.gif","document.all.WebBrowser.ExecWB(6,1)");
writeBarButton("直接打印","../images/button/return.gif","document.all.WebBrowser.ExecWB(6,6)");
//writeBarButton("打印预览","../images/button/return.gif","document.all.WebBrowser.ExecWB(7,1)");
document.write("<td width='1' height='18'></td>");
document.write("<td width='70' height='18' align='center' class='coolButton' onClick='document.all.WebBrowser.ExecWB(7,1)'>");
document.write("<table width='100%' height='100%' border='0' cellspacing='0' cellpadding='0'><tr><td valign='middle'>");
document.write("<img src='../images/button/return.gif' width='16' height='16'></td><td valign='bottom' class=pt9n>");
document.write("打印预览</td></tr></table></td>");
document.write("<td width='1'></td>");
writeBarButton("页面设置","../images/button/return.gif","document.all.WebBrowser.ExecWB(8,1)");
writeBarButton("关闭","../images/button/return.gif","window.close();");
writeBarEnd();
writeSplitLine();
</script>
</span>
</center>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><table width="95%" border="0" cellspacing="0" cellpadding="0" align="top" class="nonevalue">
<tr>
<td>
<P align=center><FONT face=黑体 color=#ff0000 size=+4><STRONG>签 报 运 转 单</STRONG></FONT></P>
<TABLE borderColor=#000000 cellSpacing=0 borderColorDark=#ffffff width=640 align=center borderColorLight=#000000 border=1>
<TBODY>
<TR>
<TD width=79 height=65>
<DIV align=center><FONT face=黑体>事 由</FONT></DIV></TD>
<TD colSpan=3> </TD></TR>
<TR>
<TD height=65>
<DIV align=center><FONT face=黑体>呈报领导</FONT></DIV></TD>
<TD width=231> </TD>
<TD width=79>
<DIV align=center><FONT face=黑体>编号</FONT></DIV></TD>
<TD width=233> </TD></TR>
<TR>
<TD height=65>
<DIV align=center><FONT face=黑体>密 级</FONT></DIV></TD>
<TD>普通</TD>
<TD>
<DIV align=center><FONT face=黑体>缓 急</FONT></DIV></TD>
<TD>普通</TD></TR>
<TR>
<TD height=65>
<DIV align=center><FONT face=黑体>主办单位</FONT></DIV></TD>
<TD> </TD>
<TD>
<DIV align=center><FONT face=黑体>拟 稿 人</FONT></DIV></TD>
<TD>admin</TD></TR>
<TR>
<TD height=65>
<DIV align=center><FONT face=黑体>拟稿日期</FONT></DIV></TD>
<TD>
<P>2006年03月07日</P>
<P> </P></TD>
<TD>
<DIV align=center><FONT face=黑体>联系电话</FONT></DIV></TD>
<TD> </TD></TR>
<TR>
<TD height=65>
<DIV align=center><FONT face=黑体>主办处室<BR>负 责 人</FONT></DIV></TD>
<TD>(***主办处室负责人***)</TD>
<TD>
<DIV align=center><FONT face=黑体>处室会签</FONT></DIV></TD>
<TD> </TD></TR>
<TR>
<TD height=65>
<DIV align=center><FONT face=黑体>(单<BR>位)领导</FONT></DIV></TD>
<TD>(***司局领导***)</TD>
<TD>
<DIV align=center><FONT face=黑体>会签</FONT></DIV></TD>
<TD>(***司局会签***)</TD></TR>
<TR>
<TD height=65>
<DIV align=center><FONT face=黑体>办 公 厅<BR>审 核</FONT></DIV></TD>
<TD> </TD>
<TD>
<DIV align=center><FONT face=黑体> 领 导<BR>签 字</FONT></DIV></TD>
<TD> </TD></TR>
<TR>
<TD height=65>
<DIV align=center><FONT face=黑体><BR>领导意见</FONT></DIV></TD>
<TD colSpan=3>
<P align=left> </P>
<P> </P>
<P> </P></TD></TR>
<TR>
<TD height=65>
<DIV align=center><FONT face=黑体>运转情况</FONT></DIV></TD>
<TD colSpan=3>
<P> 2006年03月07日2006年03月07日</P>
<P> </P>
<P> </P>
<P> </P>
<P> </P>
<P> </P></TD></TR></TBODY></TABLE>
<P> </P></body></html> <div class='PageNext'></div> <html><head></head><body><BR>
<TABLE cellSpacing=0 cellPadding=0 width=640 align=center border=0>
<TBODY>
<TR>
<TD colSpan=2 height=40>
<P align=center><FONT face=黑体 color=#ff0000 size=6><B>签报</B></FONT></P></TD></TR>
<TR>
<TD vAlign=top colSpan=2 height=16>
<HR color=red noShade SIZE=5>
<TR>
<TD style="BORDER-TOP: red 1px solid; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" colSpan=2> </TD>
<TR>
<TD vAlign=top colSpan=2 height=598>
<P><FONT color=#ff0000>意见:</FONT></P>
<P> </P>
<TR>
<TD vAlign=top colSpan=2><FONT color=#ff0000 size=4><STRONG> 呈报领导: </STRONG></FONT></TD></TR>
<TR>
<TD vAlign=top colSpan=2 height=150>
<P>
<HR width="94%" color=red noShade>
</P>
<P><FONT color=#ff0000 size=4><STRONG> 事由: </STRONG></FONT></P>
<P><STRONG><FONT color=#ff0000 size=4></FONT></STRONG> </P>
<P> </P></TD></TR>
<TR>
<TD vAlign=top width=440>
<DIV align=right><FONT color=#ff0000 size=4><STRONG>
<TABLE borderColor=#ff0000 height=103 cellSpacing=0 width=640 border=1>
<TBODY>
<TR>
<TD width=36 height=101><FONT color=#ff0000><STRONG>
<DIV align=center>主办 </DIV></STRONG>
<P align=center><STRONG>司局</STRONG></P></FONT></TD>
<TD width=72> </TD>
<TD width=41>
<DIV align=center><STRONG><FONT color=#ff0000>经办 </FONT></STRONG></DIV>
<P align=center><FONT color=#ff0000><STRONG>处室</STRONG></FONT></P></TD>
<TD width=73> </TD>
<TD width=22>
<DIV align=center><STRONG><FONT color=#ff0000>日<BR><BR>期</FONT></STRONG></DIV></TD>
<TD width=74>2006年03月07日</TD>
<TD width=37>
<DIV align=center><STRONG><FONT color=#ff0000>局 </FONT></STRONG></DIV>
<P align=center><FONT color=#ff0000><STRONG>编号</STRONG></FONT></P></TD>
<TD width=78> </TD>
<TD width=54>
<DIV align=center><STRONG><FONT color=#ff0000>秘书处 </FONT></STRONG></DIV>
<P align=center><FONT color=#ff0000><STRONG>编 号</STRONG></FONT></P></TD>
<TD width=111>(***秘书处编号***)</TD></TR></TBODY></TABLE>签发:</STRONG></FONT></DIV></TD>
<TD vAlign=top width=140> </TD></TR>
<TR>
<TD vAlign=top colSpan=2 height=100></TD></TR>
<TR>
<TD vAlign=top colSpan=2>
<HR color=red noShade SIZE=5>
</TD></TR>
<TR>
<TD style="BORDER-TOP: red 1px solid; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" colSpan=2> </TD></TR></TBODY></TABLE></body></html> <div class='PageNext'></div> <html><head></head><body><P align=center>0307_7打印测试</P>
<P><P>0307_7打印测试</P>
<P>0307_7打印测试</P>
<P>0307_7打印测试</P>
<P>0307_7打印测试</P>
<P>0307_7打印测试</P>
<P>0307_7打印测试</P>
<P>0307_7打印测试</P> </P>
<P> </P>
<P>2006年03月07日 </P>
</td>
</tr>
</table> </td>
</tr></table>
</body>
</html>
Top




