Is there a way to apply margin-bottom and margin-top to multiple pages in a PDF?
I have installed the plugins jsPDF and html2canvas.
var pdf = new jsPDF('p', 'mm', [400, 455]);
var specialElementHandlers = {
'#exportthis': function(element, renderer) {
return true;
}
};
margins = {
bottom: 10,
top: 10,
left: 10,
right: 10
};
pdf.addHTML(document.getElementById('exportthis'), 10, 10, {
pagesplit: true
},
function(dispose) {
var pageCount = pdf.internal.getNumberOfPages();
for (i = 0; i < pageCount; i++) {
pdf.setPage(i);
pdf.text(195, 450, pdf.internal.getCurrentPageInfo().pageNumber + "/" + pageCount + "\n");
}
pdf.save("Report.pdf");
}, margins);
Final Result: