Chrome浏览器将页面打印成两页而不是单页因为IE 8 / Firefox打印成单页

问题描述:

您好,



我使用的是java脚本函数(document.execCommand('print',  false,  null))我们在页面上的打印按钮上打开此功能打开打印文档的打印窗口,但打印文档的行为因浏览器而异。当我通过点击页面的打印按钮到IE 8打印文件时打印只进入单页。但是当我通过点击页面上的打印按钮将相同的文档打印到chrome时,它将文档打印到第二页上的最后一行的页面。任何人都可以告诉我我需要做些什么。尽快回复。

Hi There,

I am using java script function(document.execCommand('print', false, null)) and we cal this function on print button on page to open the print window for printing the document, but the behavior of printing document is differ browser by browser.When i print document by clicking print button of page into IE 8 it prints only into single page. But when I print same document by clicking print button on page into chrome it prints document into page with last line on second page. Can any one please suggest me what i need to do for this. Reply ASAP.

使用Print @media CSS为此..



它将设置为全部您想要的浏览器。

了解更多信息,请点击以下链接。



http://www.w3schools.com/css/css_mediatypes.asp [ ^ ]



https://developer.mozilla.org/en-US/docs/Web/CSS/@media [ ^ ]



http://www.tutorialspoint.com/css/css_printing.htm [ ^ ]



问候,

AARIF SHAIKH
Use Print @media CSS for this ..

it will setting to all browsers which you want.
for more info about it, please follow below links.

http://www.w3schools.com/css/css_mediatypes.asp[^]

https://developer.mozilla.org/en-US/docs/Web/CSS/@media[^]

http://www.tutorialspoint.com/css/css_printing.htm[^]

Regards,
AARIF SHAIKH


您必须更改打印设置。在chrome中删除页眉页脚。在Web开发下,客户浏览器或打印选项
you have to change print setting . in chrome like remove header footer . paper size either client browser or print option


的纸张大小,您无法使用javascript触摸打印机。您甚至无法知道查看您网站的计算机是否连接了打印机。在发出window.print()之后,您无法确定页面是否已成功打印。
under web development, you can't touch the printer using javascript. You can't even know whether there's a printer attached to the computer viewing your website. And after you issued window.print(), you can't find out whether the page has been printed successfully.