-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Closed
Description
I am using JSPDF to generate PDF. I am passing html div reference to jspdf. My html contains text and tables. The text is coming fine but the table header is splitting to the second page if the table heading starts from the end of the page. Any help would be appreciated. Below is my code
`
function btnDownload_click()
{
var doc = new jsPDF('p', 'mm', [340, 340]);
var output="";
var elementHandler = {
'#tobeIgnored1': function (element, renderer) {
return true;
},
'#tobeIgnored2': function (element, renderer) {
return true;
}
};
var source = document.querySelectorAll("#SecondaryStatements");
for(var i=0 ; i<source.length;i++)
{
output = output + source[i].innerHTML;
}
var disclaimerText = document.getElementById("Disclaimer").innerHTML;
output= output + disclaimerText;
var margins = { top: 30, bottom: 30, left: 40, width: 522 };
doc.fromHTML(output,15,15,{'pagesplit': false,'width': 300,'elementHandlers': elementHandler},function (dispose) {
doc.save("SearchResults.pdf");},margins);
}`