Yes, this is really not the expected behavior. However, we can try to solve this problem using JavaScript.
Theory When printing is complete, reload the style sheets. The browser will fill the page again and hopefully use the screen definitions.
Practice . Since we do not have a JavaScript callback after printing, you can try reloading the styles using the window.onfocus event, as follows:
function updateStylesheets(){ var links = document.getElementsByTagName("link"); for (var x in links) { var link = links[x]; if (link.getAttribute("type").indexOf("css") > -1) { link.href = link.href + "?id=" + new Date().getMilliseconds(); } } } window.onfocus = updateStylesheets;
In detail, it captures all the <link> tags and adds a random number after, forcing the style sheets to reload.
Please let me know if this works, I would be happy to help.
source share