I have a div containing four images, all of which are graphs created in a separate file. I am trying to allow the user to click a download PDF button that will create a PDF file with all four graphs via jsPDF.
As of right now all I am getting is a blank PDF page to download, none of the images show. If I add a header or paragraph tag in the div, that will show up, but non of the images will.
How can I show the images mentioned in the PDF?
I have tried the solutions posted here and here as well , but to no avail.
Here is my JS
$(function () { var specialElementHandlers = { '#editor': function (element, renderer) { return true; } }; $('#downloadPDF').click(function () { var doc = new jsPDF(); doc.fromHTML($('#tables').html(), 15, 15, { 'width': 170, 'elementHandlers': specialElementHandlers }); doc.save('sample-file.pdf'); }); }); And the html
<div class="tab-pane fade" id="profile"> <div id="tables"> <img src='vendors.png' alt='vendors'> <img src='positives.png' alt='positives'> <img src='total_submissions.png' alt='total submissions'> <img src='unique_submissions.png' alt='unique submissions'> </div> <div id="editor"></div> </div>