我正在使用以下函数来打印div文档,它有一些动态生成的css,它在预览中显示但是在打印之后,它显示内容但不显示css。 请帮帮我。
功能PrintPDF(elem) { Popupnew($(ELEM)的.html()); }
function Popupnew(data)
{
var mywindow = window.open("", "mydiv", "height=400,width=600");
mywindow.document.write("<html><head><title>Annotated Document</title>");
mywindow.document.write("<link href='{{asset('bundles/acmeregister/css/style.css') }}' media='print,screen' rel='stylesheet' type='text/css'>\n");
//mywindow.document.write('<script type="text/javascript" media="print,screen" src="bundles/acmeregister/importance/rangy-cssclassapplier.js">');
//mywindow.document.write('<script type="text/javascript" media="print,screen" src="bundles/acmeregister/importance/rangy-highlighter.js">');
mywindow.document.write('</head><body >');
mywindow.document.write(data);
mywindow.document.write('</body></html>');
mywindow.print();
mywindow.close();
return true;
}