TheBackBencher TheBackBencher - 7 months ago 701
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.

  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 ;)