How to open generated pdf using jspdf in new window
javascript, jspdf
Solution
Search in jspdf.js this:
if(type == 'datauri') {
document.location.href ='data:application/pdf;base64,' + Base64.encode(buffer);
}
Add :
if(type == 'datauriNew') {
window.open('data:application/pdf;base64,' + Base64.encode(buffer));
}
- call this option 'datauriNew' Saludos ;)
Problem
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 ``` doc.output('datauri'); ``` Which is opening the pdf in same tab.