The css ...">

CSS landscape printing

I added the CSS file this way:

<link rel="stylesheet" href="style.css" type="text/css" media="screen, print"> 

The css contains the following:

 .landscape { width: 100%; height: 100%; margin: 0% 0% 0% 0%; filter: progid : DXImageTransform.Microsoft.BasicImage ( Rotation = 3 ); } 

The body tag of my html page is set with the class = landscape.

Then the question. When viewing a page in IE9, it rotates 90 degrees (landscape), but when I print the page, is it still in portrait? Everything else is fine with the page, so it loads CSS for printing, but it looks like IE9 is ignoring the landscape for printing. Does anyone know why and how I can print it in the landscape?

I also tried the following, it looks like it only works in Chrome

 @media print { @page{ size: A4 portrait; margin-left:0.0cm; margin-right:0.0cm; } } 

I found several “answers” ​​on google, but most of them summarize two alternatives that I presented, which actually does not work for me.

EDIT: as below:

 -ms-transform: rotate(90deg); 

.. doesn't work either. I have a large table that I just want to print in the landscape due to the large number of columns. How hard can it be?

+7
source share
3 answers

It seems that the only way to get the perfect landscape print is to go through the print dialog and select the landscape from there. Its really hard to do this automatically with success in every browser.

+3
source

In addition to your answer, Kim, I would say that you need to intervene or use the “standard browser functionality” to avoid the “hajj”. People know their browser and rely on it, working in a standard way. Especially people with insecurity may not be able to understand the “convenient feature” given to them in good faith. To give another example, people used page scaling methods using the “convenient” zoom button. As a result, the user was scaled using this button, and then used his own function or vice versa, which led to strange behavior.

0
source

to try:

 @media print{@page {size: landscape}} 
0
source

All Articles