I am trying to download a div value into PDF using jsPDF here are the code which I have written:
<html> <head> <script src="//code.jquery.com/jquery-1.11.0.min.js"></script> <script src="//code.jquery.com/jquery-migrate-1.2.1.min.js"></script> <script src="jsPDF.js"></script> <script> $(function () { var doc = new jsPDF(); var specialElementHandlers = { '#editor': function (element, renderer) { return true; } }; $('#cmd').click(function () { doc.fromHTML($('#content').html(), 15, 15, { 'width': 170, 'elementHandlers': specialElementHandlers }); doc.save('sample-file.pdf'); }); }); </script> </head> <body> <div id="content"> <h3>Hello, this is a H3 tag</h3> <p>a pararaph</p> </div> <div id="editor"></div> <button id="cmd">generate PDF</button> </body> </html> But while clicking on the button nothing is happening...I have downloaded the jsPDF from this link.
I am clueless of thing can anyone please help me.