How to open generated pdf using jspdf in new window

后端 未结 14 2493
遇见更好的自我
遇见更好的自我 2020-12-04 15:50

I am using jspdf to generate a pdf file. Every thing is working fine. But how to open generated pdf in new tab or new window.

I am using



        
14条回答
  •  半阙折子戏
    2020-12-04 16:15

    I have to use this to load the PDF directly. Using doc.output('dataurlnewwindow'); produces an ugly iframe for me. Mac/Chrome.

      var string = doc.output('datauristring');
      var x = window.open();
      x.document.open();
      x.document.location=string;
    

提交回复
热议问题