I read landscape printing from HTML , but my problem is more specific. And before I concede defeat and consider another career, I thought I would send it here.
This is my situation:
I am writing a program to display and print schedules in HTML format. The user clicks on various parameters, such as number, dates, etc. Then an AJAX call is made to retrieve the data, and schedule blocks using Javascript. The width of the schedule is greater than the height of the schedule. So I need to print in landscape to maximize the size of the page.
Firstly, it @media print{@page {size: landscape}}just doesnβt work under any circumstances, I tried.
It does kind of work:
filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);.
I tried applying CSS ImageTransform to any of the HTML or BODY elements with different results.
When applied to an HTML element, it seems that the page appears as a portrait (which is the default setting for users in my organization) and then rotates 90 degrees. Clearly this does not help me.
When applied to a BODY element, everything works, except for elements that are either relative or absolute positions (which still appear in the portrait). I cannot refuse absolute positioning without rewriting from scratch that I have no luxury.
What should I do?
source
share