以编程方式更改浏览器的打印方向 [英] Programmatically changing browser print orientation
问题描述
我们正面临IE打印(IE7和IE8)的问题.由.Net 3.5开发的应用程序.我们要p 通过图表自动设置 面向风景或人像的打印方向.如果可以,请给我们一些工作代码.
We are facing the issue with IE printing(IE7 and IE8). The application developed by .Net 3.5. we want to programmatically set the print orientation to landscape or portrait .Can that be possible if so please give us some working code.
我们还要在打印中隐藏页眉和页脚内容.请帮助我们.
Also we want hide the header and footer content in the print.Please help us.
谢谢
Anand
推荐答案
For printing page in landscape, check out this link.
要隐藏页眉和页脚,只需添加一个打印按钮,然后将CSS样式设置为"display", 无"在window.print()之前,然后弹出一个带有按钮的窗口,在完成打印后按此按钮.当按下按钮时,将该显示"按钮恢复为原先的状态.属性为"然后关闭 那个窗口.
For hiding header and footer, just add a print button and set CSS style "display" to "none" before window.print(), then popup an window with a button to press when print is done. When the button is pressed, revert this "display" property to "" and close that window.
或者,您可以提供一个按钮来生成打印机友好"标签.网页版本并在那里打印.
Alternatively you can offer a button to generate a "printer friendly" version of the webpage and print there.
这篇关于以编程方式更改浏览器的打印方向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!