在我的应用程序中,我试图在单击打印按钮时打印页面。
它在打印预览中完美显示,但在打印中,CSS不在Mozilla Firefox
中维护。但是,它会按Chrome
和Internet explorer
。
我无法附加快照,因为此处的数据是保密的。
以下是我用于打印的代码..
function PrintWithServices() {
// for print
var printCRMDetails = new $("#DivToPrint");
var printServiceDetails = new $("#DivServicesToPrint");
var mywindow = window.open("", "popup", "width=1000,height=600,scrollbars=yes,resizable=yes," +
"toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0");
mywindow.document.write('<html><head><title></title>');
mywindow.document.write('<link href="../../Content/CSSForPrint.css" rel="stylesheet" type="text/css" />');
mywindow.document.write('</head><body><div id="#main">');
mywindow.document.write('<center><span class="header-title-without-margin">CRM Doctor Request Details </span></center>');
mywindow.document.write($(printCRMDetails).html());
mywindow.document.write($(printServiceDetails).html());
mywindow.document.write('</div></body></html>');
mywindow.print();
}