One of our clients' sites uses a tool called HTML2PDF, which, as you might have guessed from its name, converts HTML to PDF using js. It was very easy to implement and worked fine, until now. It now shoots out a PDF that's completely blank. There are no errors in the console, and the script seems to run through without stopping (the developer added a few console logs here and there). A console log on the HTML element we're feeding the html2pdf function returns normally - (a block of html, as expected).
Here's the HTML2PDF project: https://github.com/eKoopmans/html2pdf.js
The script that calls html2pdf:
jQuery('.js-download-itinerary-file').on('click', function(e){
e.preventDefault();
var element = jQuery('.pdf-container');
var opt = {
filename: 'download.pdf',
};
html2pdf().set(opt).from(element[0]).save();
});
I'm looking for a way to troubleshoot, or maybe an alternative... If anyone knows what might be going on, even better!
Any advice helps :)