且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

当用户选择“打印”时,如何在横向打印HTML页面?

更新时间:2023-12-01 23:03:40

表示它不是真的支持。有不止一些人试图破解 的方式它 - 但我强烈建议只渲染服务器端PDF。


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 landscape. It's minor, but would be nice for the user if we can remove this unnecessary step.

Thanks in advance to all respondents.

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.