Landscape Printing from IE8
I have read Landscape printing from HTML, but my problem is more specific. And before I concede defeat and consider a different career, I thought I would post here.
This is my situation:
I am writing a timetabling display and printing program in HTML. The user clicks various options such as room, dates etc. An AJA开发者_StackOverflow中文版X call is then made, to fetch the data and the timetable blocks are absolute positioned using Javascript. The width of the timetable is more than the height of the timetable. So, I need to print in landscape, in order to maximise the size on the page.
Firstly, @media print{@page {size: landscape}}
just plain doesn't work under any circumstance, I've tried.
This does sort of work:
filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);
.
I've tried applying the CSS ImageTransform to either of the HTML or BODY elements, with differing results.
When applied to the HTML element, it seems as though the page is rendered as portrait (which is the default setting for users in my organisation), and then rotated by 90 degrees. Clearly this doesn't help me.
When applied to the BODY element, everything works, except for elements that are either relative or absolute positioned (which still appear portrait). I can't abandon absolute positioning, without re-writing from scratch, which I don't have the luxury of.
What should I do?
Due to the quirks in IE8 you need to reapply the filter (filter: progid:DXImageTransform.Microsoft.BasicImage(Rotation=3);) to any element that is positioned absolute.
精彩评论