开发者

Is @Page { size:landscape} obsolete?

开发者 https://www.devze.com 2023-01-26 04:02 出处:网络
The CSS rule @page {size: landscape;} is supposed to force browsers to print pages in landscape mode. This rule is mentioned in many questions on stackoverflow, on many other programming sites, and

The CSS rule

@page {size: landscape;}

is supposed to force browsers to print pages in landscape mode. This rule is mentioned in many questions on stackoverflow, on many other programming sites, and in reference works such as O'Reilly's HTML/XTHML The Definitive Guide, Fifth Edition.

I've tried to using this CSS rule with many different format tweaks with both inline styles and linked style sheets, specifying media and not specifying media, with IE8, Chrome 7.0, and Firefox 3.6. I've tried printing to a Xerox Phaser 8560 and to the Adobe PDF print driver. All of my testing has been done on Windows Vista Ultimate 64 bit.

I have never see this CSS rule actually work, i.e. I've never seen a page print landscape on any attempt. Admittedly I haven't done really thorough QA on this, since I've only tried 2 printer drivers and one OS.

Have you actually seen this rule work for a browser, OS, and printer configuration? There is some mention in other questions on this topic that the rule is not broadly supported. Since I can't get it to work on my development machine at all开发者_开发百科 I am wondering when, if ever, does it work? It would help to get specifics on browser, OS, and printer combinations that are known to work, or to confirm that this is a waste of time.


CSS 2.1 no longer specifies the size attribute. The current working draft for CSS3 Paged Media module does specify it (but this is not standard or accepted). I have not been able to find a report of specific browser/version support, but I get the sense that it is poorly supported (perhaps only by Opera?).

0

精彩评论

暂无评论...
验证码 换一张
取 消