pdf download button

Solutions on MaxInterview for pdf download button by the best coders in the world

showing results for - "pdf download button"
Roberta
09 Mar 2017
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
Felipe
06 Mar 2020
1var doc = new jsPDF();
2var specialElementHandlers = {
3    '#editor': function (element, renderer) {
4        return true;
5    }
6};
7
8$('#cmd').click(function () {
9    doc.fromHTML($('#content').html(), 15, 15, {
10        'width': 170,
11            'elementHandlers': specialElementHandlers
12    });
13    doc.save('sample-file.pdf');
14});
15