How do I make an HTML page print in landscape when the user selects 'print'?

后端 未结 4 869
后悔当初
后悔当初 2021-02-15 10:20

We generate web pages that should always be printed in landscape mode. Web browser print dialogs default to portrait, so for every print job the user has to manually select land

相关标签:
4条回答
  • 2021-02-15 11:02

    I was looking to do this same thing and found this article. It looks particularly "hacky" and as the author points out, may invoke an active x warning in IE. Seems like a losing proposition to confuse the user with an active x warning when they just wanted to print a web page.

    0 讨论(0)
  • 2021-02-15 11:08

    The @page rule is supposed to allow this, but is only implemented in Opera.

    0 讨论(0)
  • 2021-02-15 11:09

    Possible in CSS2 (@page, looks like Opera only) and in CSS3 which will work nowhere. Sorry.

    0 讨论(0)
  • 2021-02-15 11:17

    A quick Google indicates that it's not really supported. There's more than a few folks out there trying to hack their way to it - but I'd strongly suggest just rendering a server side PDF instead.

    0 讨论(0)
提交回复
热议问题