-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Closed
Labels
Description
I am looking for a way to insert page numbers to the footers of PDF pages generated using fromHTML.
Here is a solution I came up with:
pdf.fromHTML($editableContent.get(0), 15, 0, {
width: 575
}, function() {
$.each(pdf.internal.pages, function (index, value) {
if (value) {
$.each(value, function (innerIndex, innerValue) {
var continueAfterThis = true;
if (innerValue.indexOf('$page$') > -1) {
value[innerIndex] = innerValue.replace('$page$', index);
continueAfterThis = false;
}
return continueAfterThis;
});
}
});
});
I just wonder maybe there's a better way of doing this? Can I somehow override addition of footers or headers during fromHTML processing?