<script src="jquery-1.7.1.min.js"></script> <script src="jspdf.js"></script> <script src="jspdf.plugin.standard_fonts_metrics.js"></script> <script src="jspdf.plugin.split_text_to_size.js"></script> <script src="jspdf.plugin.from_html.js"></script> <title></title> <script> $(document).ready(function () { $(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>
<body> <form id="form1" runat="server"> <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> </form> </body>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)