0
0 Comments

Hello Everyone,

Hope doing well,

Whilr working on JsPDF I stuck to update the width of table.

I quite thought this would be simple but am not able to find an answer anywhere, How on do we set the table width in jsPDF? I simply want my table to stretch to 100% of the page width. Here is the code I am using:

function demoFromHTML() {
var pdf = new jsPDF(‘p’, ‘pt’, ‘letter’);
source = $(‘.Table1’)[0];
specialElementHandlers = {
‘#bypassme’: function (element, renderer) {
return true
}
};
margins = {
top: 50,
bottom: 50,
left: 40,
width: 922,
right:40
};
pdf.fromHTML(
source, // HTML string or DOM elem ref.
margins.left, // x coord
margins.top, { // y coord
‘width’: margins.width, // max width of content on PDF
‘elementHandlers’: specialElementHandlers
},
function (dispose) {
pdf.save(‘RFI.pdf’);
}, margins);
}

Help Really appreciate.

Many Thanks,

Sumit Deshmukh 

(Visited 444 times, 1 visits today)
Add a Comment