I've a page with css applied. To customize the print, in the same css file I have some @media print styles. These work perfectly fine when performing the print but, testing with IE11, I've realized that the preview works as if the media print styles weren't considered. If, on the other hand, I define a brand new css style and I link it as a print stylesheet, then also the preview works fine (however this impose me to duplicate in this css lots of styles defined in the normal css stylesheet, that I don't want to change in the print).
I don't know if it can be of any help but the way I print the page is by calling a javascript function which selects just the content of a div in my html page (#content) and it prints it (also adding a copyright notice and a logo to the bottom of the printed page)
function printit() {
var body = document.getElementById('content').innerHTML;
var tmpWin = window.open('', '', 'width=640,height=480');
tmpWin.document.open("text/html");
tmpWin.document
.write("<html><head><link rel='stylesheet' href='css/stylesheet.css'></head><body>");
tmpWin.document.write(body);
//we add the copyright notice
tmpWin.document.write("<div id='footer'><p>© <script>document.write(new Date().getFullYear())</script> - All rights reserved</p><img id='logo_vertical' alt='DCL' src='img/logo_vertical.png'></div>")
tmpWin.document.write("</body></html>");
tmpWin.document.close();
tmpWin.print();
tmpWin.close();
}
Any idea why I'm having this problem?
Thanks