How to open generated pdf using jspdf in new window

后端 未结 14 2498
遇见更好的自我
遇见更好的自我 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:02

    Or... You can use Blob to achive this.

    Like:

    pdf.addHTML($('#content'), y, x, options, function () {
        var blob = pdf.output("blob");
        window.open(URL.createObjectURL(blob));
    });
    

    That code let you create a Blob object inside the browser and show it in the new tab.

提交回复
热议问题