简体   繁体   English

使用此javascript函数无法在firefox中将文件打印为pdf

[英]could not print the file to pdf in firefox using this javascript function

This function works fine in chrome but not in Firefox or internet Explorer 此功能在chrome中可以正常使用,但在Firefox或Internet Explorer中不能正常使用

function setPrint(tableId) {  
        var page = '<html><table border="1" style="border-spacing:0">' +   $j('#' + tableId).html() + '</table></html>';  
        w = window.open();  
        w.document.write(page);  
        w.print();  
    w.close();  

}

I figured out this problem. 我发现了这个问题。 Here when it comes to internet Explorer JavaScript is not working properly. 谈到Internet Explorer时,JavaScript无法正常工作。 In Firefox there is no printing option as PDF but as a solution we can use XPS format. 在Firefox中,没有作为PDF的打印选项,但是作为解决方案,我们可以使用XPS格式。 XPS is also like a PDF format but not the best option may be though. XPS也像PDF格式,但不是最好的选择。 if it is for personal usage we can use some thing like cute PDF writer. 如果是供个人使用,我们可以使用诸如可爱的PDF writer之类的东西。 but this cannot be used as a professional solution. 但这不能用作专业解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM