- Create a Web page retrieving content from the various lists.
- Add a button called Export to PDF in an HTML file.
- Set the onclick event for the button, as shown below.
- <div>
- <br>
- <input type="button" id="exporttopdf" value="Export to PDF" onclick="exportSelectedItemsToPdf();" style="display:none;"/>
- <span> </span><input type="button" value="Print" id="print" style="display:none" onclick="PrintElem(this);" />
- </div>
- Here is the function representing linked to that button and gets executed when triggered.
- function exportSelectedItemsToPdf() {
- var documentPDF = new jsPDF();
- var caseid = $("#caseid_lb").text();
- var specialElementHandlers = {
- '#editor': function (element, renderer) {
- return true;
- }
- };
- documentPDF.fromHTML($('#tab-5').html(), 15, 15, {
- 'width': 600,
- 'elementHandlers': specialElementHandlers
- });
- documentPDF.save('Case Id - ' + caseid + '.pdf');
- }
- Click the button for the result.
- Here is the PDF, which gets downloaded.

- Here is the PDF document when opened.

Tejesh BarmaPosted May 8, 2017, 12:59 AM
Kvbharat-thanks for sharing information.i think it's not working in ie browser