TheBackBencher TheBackBencher - 1 year ago 1625
Javascript Question

How to open generated pdf using jspdf in new window

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


Which is opening the pdf in same tab.

Answer Source
  1. Search in jspd.js this:

    if(type == 'datauri') {
        document.location.href ='data:application/pdf;base64,' + Base64.encode(buffer);
  2. Add :

    if(type == 'datauriNew') {  'data:application/pdf;base64,' + Base64.encode(buffer));
  3. call this option 'datauriNew' Saludos ;)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download