Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Printing landscape or portrait in FireFox and IE 8

Currently I am using FireFox latest version and IE8

To change the orientation of printing , I used

@page {
  size: portrait;
}

in my css file. @page reference

Although it claims that the @page is supported in both browsers , after my testing it is not working at all besides Chrome. I would like to know how to print the page in different orientation in FireFox / IE8.

like image 625
user1871516 Avatar asked May 29 '13 06:05

user1871516


2 Answers

As the MDN reference says:

You can only change the margins, orphans, widows, and page breaks of the document. Attempts to change any other CSS properties will be ignored.

As far as supplying you with markup that achieves what you want, that would be outside the bounds of what's allowed on SO. In addition, it could be a bit of work since you are wanting a two generation back version of IE to attempt to perform as well as a current generation Firefox.

like image 159
Rob Avatar answered Oct 27 '22 01:10

Rob


No application should depend on this feature to work cross browser right now because the CSS3 standard on page orientation for printing is still under implementation in most browsers.

For Google Chrome it works just fine: http://dev.activisual.net/test.html

Ultimately the decision of changing the orientation relays on the user during the printing process (even if it works), so you could simply let the users know that they should print the page in landscape or portrait, but in general there won´t ever by a way to prevent the users from changing the orientation while printing on desktop browsers.

Here is a bug report for FF reported very recently: https://bugzilla.mozilla.org/show_bug.cgi?id=851441

You can read the accepted answer on this question for reference: Landscape printing from HTML

like image 45
jacmkno Avatar answered Oct 26 '22 23:10

jacmkno