I will like to add page numbers when i export a pdf ... I just cant get it right
I will like to add page numbers when i export a pdf ... I just cant get it right
Salim350
Posts: 7Questions: 3Answers: 0
Can i get an example
var cols = [];
cols[0] = {text: 'Left part', alignment: 'left', margin:[20] };
cols[1] = {text: 'Right part', alignment: 'right', margin:[0,0,20] };
var objFooter = {};
objFooter['columns'] = cols;
doc['footer']=objFooter;
This discussion has been closed.
Answers
Please help and thanks in advance
https://datatables.net//forums/discussion/35979
Put this in customize will work for page numbers:
doc['footer']=(function(page, pages) {
return {
columns: [
'Left part of footer',
{
alignment: 'right',
text: [
{ text: page.toString(), italics: true },
' of ',
{ text: pages.toString(), italics: true }
]
}
],
margin: [10, 0]
}
});