jquery html to pdf

Solutions on MaxInterview for jquery html to pdf by the best coders in the world

showing results for - "jquery html to pdf"
Aron
27 Jan 2016
1<div id="content">
2     <h3>Hello, this is a H3 tag</h3>
3
4    <p>A paragraph</p>
5</div>
6<div id="editor"></div>
7<button id="cmd">generate PDF</button>
8<script>
9var doc = new jsPDF();
10var specialElementHandlers = {
11    '#editor': function (element, renderer) {
12        return true;
13    }
14};
15
16$('#cmd').click(function () {
17    doc.fromHTML($('#content').html(), 15, 15, {
18        'width': 170,
19            'elementHandlers': specialElementHandlers
20    });
21    doc.save('sample-file.pdf');
22});
23</script>