1

在我的应用程序中,我试图通过单击打印按钮来打印页面。它在打印预览中完美显示,但在打印中 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();
        }
4

0 回答 0