jsPDF Encode PDF as BLOB Using Base64 Code & Download it

jsPDF tutorial to encode PDF document as BLOB using Base64 code and download it in a web browser using JavaScript.

var blobPDF =  new Blob([ doc.output() ], { type : 'application/pdf'});
var blobUrl = URL.createObjectURL(blobPDF);  //<--- THE ERROR APPEARS HERE

window.open(blobUrl);  // will open a new tab

//window.open(blobUrl,'_system','location=yes'); will open a new window

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.