How to print webpages with iframe and css
<p>I have to print the contents of a dialog. I'm adding a empty iframe then i add contents to it in javascript.</p>

<p>this is my js code where i add html and css as children of iframe</p>

<pre><code>    var layoutCSS = new String('&lt;link href="css/ReportPageOne.css" rel="stylesheet" type="text/css"&gt;');
    var pageOneCSS = new String('&lt;link href="css/ReportLayout.css" rel="stylesheet" type="text/css"&gt;');
    var pageTwoCSS = new String('&lt;link href="css/ReportPageTwo.css" rel="stylesheet" type="text/css"&gt;');
    var materialityCSS = new String('&lt;link href="css/MaterialityMatrix.css" rel="stylesheet" type="text/css"&gt;');
    window.frames.print_frame.document.head.innerHTML = layoutCSS + pageOneCSS + pageTwoCSS + materialityCSS;
    window.frames.print_frame.document.body.innerHTML = $('#__dialog1-cont').html();
    window.frames.print_frame.window.focus();
    window.frames.print_frame.window.print();
</code></pre>

<p>opens the print dialog properly but css is not applied quite well.</p>

<p>On print page in options i checked in 'Background graphichs' and i am using google chrome.</p>