Please check the link https://jsfiddle.net/dhaileytaha/1wmk9gsq/14/
<script>
/*Download option*/
var doc = new jsPDF();
var specialElementHandlers = {
'#editor': function (element, renderer) {
return true;
}
};
doc.fromHTML($('#example').html(), 55, 55, {
'width': 170,
'elementHandlers': specialElementHandlers
});
document.getElementById("cmd").onclick = function () {
var pass1= "cool" ;
password=prompt('Please enter your password to Print this page!',' ');
if (password==pass1)
{
doc.save('target-file.pdf');
} else {
window.alert('Sorry! You are not Authorsised');
}
}
</script>
it is a datatable. I am able to print it in proper format but not able to download in the same FORMAT as the datatable is. Please help I want the same format as of the DATATABLE in pdf form.