我在用jspdf生成 pdf 文件。一切都运转良好。但生成后如何打开
pdf 在新选项卡或新窗口中。
我在用
doc.output('datauri');
这是在同一选项卡中打开 pdf。
根据来源,您可以将“dataurlnewwindow”参数用于output():
doc.output('dataurlnewwindow');
源码在github:https://github.com/MrRio/jsPDF/blob/master/jspdf.js#L914 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
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)