admin管理员组文章数量:1414605
I want to change print settings of browser by javascript or CSS.
Specifically I need to clear Headers and Footers.
For example in GoogleChrome when I press Ctrl+p the print dialog appears and there is an option named "Headers and Footers" that by default has checked in my browser (Chrome version 30.0.1599.101 m).
1. I don't need a cross-browser solution. It's enough for me if I could find a solution in one browser such as Google Chrome or firefox or IE.
2. I know that this is possible by using ActiveX but I don't want to use ActiveX.
I want to change print settings of browser by javascript or CSS.
Specifically I need to clear Headers and Footers.
For example in GoogleChrome when I press Ctrl+p the print dialog appears and there is an option named "Headers and Footers" that by default has checked in my browser (Chrome version 30.0.1599.101 m).
1. I don't need a cross-browser solution. It's enough for me if I could find a solution in one browser such as Google Chrome or firefox or IE.
2. I know that this is possible by using ActiveX but I don't want to use ActiveX.
Share Improve this question edited Oct 23, 2013 at 9:50 hitautodestruct 20.9k14 gold badges75 silver badges95 bronze badges asked Oct 23, 2013 at 7:04 Mohammad NouraeinMohammad Nouraein 1631 gold badge1 silver badge8 bronze badges 7- 2 Very, very unlikely without any additional browser extension. JavaScript isn't meant to manipulate browser preferences. Also, the there's no print API (and the CSS printing module is really old). After all, it's the user's choice what to print. – Zeta Commented Oct 23, 2013 at 7:11
- see as: stackoverflow./questions/1960939/… – ijse Commented Oct 23, 2013 at 7:15
- possible duplicate of Is there a way to get a web page header/footer printed on every page? – C3roe Commented Oct 23, 2013 at 7:16
- stackoverflow./questions/2601761/… duplicate – user2822316 Commented Oct 23, 2013 at 7:21
- thank you Zeta. but I know that CSS2+ has some controls on printer settings w3/TR/CSS21/page.html#page-box. – Mohammad Nouraein Commented Oct 23, 2013 at 7:25
1 Answer
Reset to default 1you can hide your header/footer by using css @media print querys...
w3schools
css-print-media-query
本文标签: Is there any way to change Browser print settings by Javascript or CSSStack Overflow
版权声明:本文标题:Is there any way to change Browser print settings by Javascript or CSS - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745193688a2647033.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论