i can able to print the modal popup data i dont want this when i click on export button directly downld to either pdf or doc format how to do it

this is my code for print written in js
JavaScript
function CallPrint(strid) {
var conTent = document.getElementById(strid);
var winprint = (window.open(",", 'left=0,top=0,width=1,height=1,toolbar=0,scrollbar=0,starts=0'));
winprint.document.write(conTent.innerHTML);
winprint.document.close();
winprint.focus();
winprint.print();
conTent.innerHTML = stroldone;
}Code

Naimish MakwanaRank #324 · 7.7K reputationPosted Mar 21, 2023, 5:07 AM EDT
Hello Jaya,
To export modal popup data directly into a PDF or DOC format, you will need to use a library or tool that can generate PDF or DOC files from HTML content. One popular library for this purpose is jsPDF.
Use below link:
https://stackoverflow.com/a/19290964/3054222
Working example : http://jsfiddle.net/xzZ7n/4861/
Thanks
Naimish Makwna