1

I currently have a program that prints a sheet in portrait orientation, but I must have it landscape in Internet Explorer 11. I have seen a few good answers, and yet none of them have worked for me. I have tried the following:

// These are old styles that I tried to use but would still print in 
   portrait mode.
1. filter: progid:DXImageTransform.Microsoft.BasicImage(Rotation=3);
2. Size: landscape
3. <Body class = "landscape"> .landscape{/*Some style*/}

I currently have a set up such as:

<style type="text/css" media="print">
    @page {
        size: auto;
        margin: 25mm 0mm 0mm 0mm;
    }
    body{
        margin: 0px;
    }
</style>

The following code when ran in internet explorer 11 will print the sheet in the default portrait mode. The body of my html is basically just a table that needs to be printed on a sheet of paper in landscape. My question is, is there a way I can add some style or use any work around to print the sheet landscape in Internet explorer. I do not care if it works in any other browser.

lildakota
  • 141
  • 3
  • 15
  • Could you provide screenshots of what you have / what you are trying to achieve? This would aid in understanding what you are asking of us, as a community. – Alex Mulchinock May 08 '18 at 16:44
  • Please see my update. Thank you. – lildakota May 08 '18 at 16:51
  • 1
    Possible duplicate of [Landscape printing from HTML](https://stackoverflow.com/questions/138422/landscape-printing-from-html) – Ken White May 08 '18 at 16:52
  • Are you not able to give a generalised proof of concept that wouldn't interfere with your company policy? If not, I'd suggest looking at the example @KenWhite just gave. – Alex Mulchinock May 08 '18 at 16:55
  • What else would you like to see @AlexMulchinock? I feel as if there is enough information to describe my issue. But I will try if there is something specific you need to see – lildakota May 10 '18 at 12:15
  • You haven't provided information on what you expected to see vs. what you saw with the CSS attributes tried above. It's also difficult to grasp an idea of what isn't working correctly for you, without seeing your HTML and appropriate CSS properties (or even screenshots of the problem). Essentially, you're asking to debug what looks to be valid CSS at this moment in time. – Alex Mulchinock May 10 '18 at 12:21
  • Check my updates and let me know if you need more. Thank you for the help. – lildakota May 10 '18 at 14:24
  • I'm curious about if you were able to make this works? im struggling with the same problem, but this time on EDGE – Nestor Perez Jan 27 '20 at 16:24
  • @NestorPerez Unfortunately I was never able to find an answer to this. I vaguely remember being able to do it if the compatibility settings in IE are modified, but that was not an option in my case. We had to change the requirements of the project for that reason. – lildakota Jan 28 '20 at 18:34

1 Answers1

0

The following CSS will print in landscape mode in IE11 by rotating the content by 90 degrees

<style type="text/css" media="print">
    body {
        writing-mode: tb-rl;
    }

    page {
        size: landscape;
        -webkit-transform: rotate(-90deg);
        filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
    }
</style>