用javascript打印在顶部和底部留下一些空间如何使用这些空格? [英] printing in javascript leaving some space on top and bottom how to use those spaces?

查看:115
本文介绍了用javascript打印在顶部和底部留下一些空间如何使用这些空格?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hai all ..

i有一个为进度报告打印开发的网站,因此它包含更多行,下一页打印几行,如果我使用那些,它不使用顶部和底部空格白色空间我的问题将得到解决

i使用此代码

Hai all..
i have a web site developed for progress report printing so it contains more number of lines few lines printing in next page and it is not utilizing top and bottom spaces if i use those white space my problem will be solved
i used this code

function print() {
          var pntcnt = document.getElementById("divprint");
          var windowUrl = 'about:blank';
          var num;
          var UniquName = new Date();
          var windowName = 'Print' + UniquName.getTime();
          var PrintWindow=window.open(num,windowName,left=300,top=300,width=5000,height=5000')
          PrintWindow.document.write(pntcnt.innerHTML);
          PrintWindow.document.close();
          PrintWindow.focus();
          PrintWindow.print();
          PrintWindow.close();
      }



任何人请帮助我

提前感谢..


any one please help me
thanks in advance..

推荐答案

,left = 300,top = 300,width

您可以从较低的值开始这里。
,left=300,top=300,width
You could start with lower values here.


尝试使用 @media [ ^ ]规则,以区分浏览器中的打印和渲染。 br $> b $ b

最好的问候

Espen Harlinn
Try using the @media[^] rule to differentiate between printing and rendering in the browser.

Best regards
Espen Harlinn


这篇关于用javascript打印在顶部和底部留下一些空间如何使用这些空格?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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