为什么打印机在内容下方打印更多空白页? [英] Why Printer is printing more blank page below the content..?

查看:326
本文介绍了为什么打印机在内容下方打印更多空白页?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个票据打印页面..通过javascript函数打印整页内容..它打印整个内容很好..



但它离开了很多BLANK PAGE BELOW ..



以下是我使用的javascript打印乐趣..我在按钮点击时调用此乐趣..

PrintArea是面板的id



I have a page for bill printing ..i m printing whole page content through javascript func.. It is printing well whole content..

BUT IT LEAVES MUCH BLANK PAGE BELOW..

Following are javascript print fun which i use.. i m calling this fun on button click..
PrintArea is id of panel

<script type="text/javascript">
    


function CallPrint() {
        var res = document.getElementById('<%=PrintArea.ClientID%>');
        var contentFormat = "<style>td{font-family:verdana;font-size:10px}th{font-family:verdana;font-size:11px;font-weight:bold}</style><table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\"><tr><td align=\"center\" valign=\"top\" style=\"font-family:verdana; font-size:14px; font-weight:normal\">" + "</td></tr><tr><td align=\"left\" valign=\"top\" style=\"font-family:verdana; font-size:12px;height:24px; font-weight:normal\"> " + "</td></tr><tr><td align=\"left\" valign=\"top\"><br />" + res.innerHTML + "</td></tr></table>"
        var WinPrint = window.open('', '', 'scrollbars,left=0,top=0,width=500,height=600,status=0');
        WinPrint.document.write(contentFormat);
        WinPrint.document.close();
        WinPrint.focus();
        WinPrint.print();
    }
</script>

推荐答案

整个页面正在显示,因为您要打印1整页。空白不是问题。问题是你正在打印一个页面。我认为你的代码是正确的。

谢谢。

Rashed ::孟加拉国
The whole page is showing because you are printing 1 full page. Blank is not issue. issue is you are printing a page. I think your code is correct.
Thank you.
Rashed:: Bangladesh


这篇关于为什么打印机在内容下方打印更多空白页?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆