Heading:
<head> <script src="jquery.min.js"></script> <script src="jspdf.min.js"></script> <script src="html2canvas.min.js"></script> <script src="jspdf.plugin.addhtml.js"></script> </head> HTML:
<div id="wrapper"> <div class="red b"></div> <div class="yellow b"></div> <div class="blue b"></div> <div class="green b"></div> </div> JavaScript:
$(".button").click(function() { var pdf = new jsPDF('p', 'pt', 'a4'); pdf.addHTML($("#wrapper"), function () { pdf.save(); }); }); I want to add the div #wrapper into the pdf file when I press the button to generate it. But then when I press the button and inspect element in Chrome, it always show an unloaded events in sources.
Any help would be appreciated. Thanks!