How to convert HTML data from widget in pdf

Community Alums
Not applicable

I have created the table user data with tr and th tags in html of widget how to convert the html data in to pdf on click of one button on portal

1 REPLY 1

Community Alums
Not applicable

You can do so by calling a print function at the click of a button.

 

Then define a function in the client script as below : 

//get html content of required div into a variable

c.data.myHTML = document.getElementById('<your div tag>').innerHTML;

var printWindow = window.open('', '', 'width=800,height=600');
printWindow.document.open();
printWindow.document.write(c.data.myHTML);
printWindow.document.close();

window.print();

 

Please mark my answer as helpful if it works for you.