我使用jspdf生成一个pdf文件。每件事都很正常。但是如何在新选项卡或新窗口中打开生成的pdf。
我在用
doc.output('datauri');
在同一个选项卡中打开pdf。
发布于 2014-09-28 21:50:49
发布于 2013-08-07 08:49:47
根据源,您可以使用'dataurlnewwindow‘参数进行输出():
doc.output('dataurlnewwindow');
资料来源于github:https://github.com/MrRio/jsPDF/blob/master/jspdf.js#L914
所有可能的案件:
doc.output('save', 'filename.pdf'); //Try to save PDF as a file (not works on ie before 10, and some mobile devices)
doc.output('datauristring'); //returns the data uri string
doc.output('datauri'); //opens the data uri in current window
doc.output('dataurlnewwindow'); //opens the data uri in new window
发布于 2017-11-15 17:39:26
这个解决方案对我有用
window.open(doc.output('bloburl'))
https://stackoverflow.com/questions/17739816
复制相似问题