page numbering
See original GitHub issuehi,
when producing a pdf with multiple tables and the footer as specified in the example, it seems as if the footer was added again with every table thats drawn. also the page numbering is incorrect.
var footer = function (data) {
doc.setFontSize(10);
doc.setFontStyle('normal');
var str = "Page " + data.pageCount;
str = str + " of " + totalPagesExp;
doc.text(str, data.settings.margin.left, doc.internal.pageSize.height - 30);
var today = new moment().format("YYYY-MM-DD");
doc.text(today, right, doc.internal.pageSize.height - 30, 'right');
};
doc.autoTable(columns, [], {
startY: doc.autoTableEndPosY(),
afterPageContent: footer,
headerStyles: {
fillColor: 255,
textColor: 0,
fontStyle: 'bold',
rowHeight: 20
}
});
page 1
other pages
last page (6)
Issue Analytics
- State:
- Created 7 years ago
- Comments:11 (3 by maintainers)
Top Results From Across the Web
Insert page numbers - Microsoft Support
Select Insert > Page Number, and then choose the location and style you want. · If you don't want a page number to...
Read more >Word: Page Numbers - GCF Global
Page numbers can be used to automatically number each page in your document. They come in a wide range of number formats and...
Read more >Page numbering - Overleaf, Online LaTeX Editor
Page numbering. Document page numbers can be typeset using a particular style, such as using Arabic or Roman numerals, and typeset at a...
Read more >Add page numbering to your pages in Adobe InDesign
Page number markers are commonly added to parent pages. When parent pages are applied to document pages, the page numbering is updated ...
Read more >How to Add Page Numbers in Word - CustomGuide
1. Click the Insert tab. 2. Click the Page Number button. Next, choose where you want the page number to appear. You can...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
ok i found a permanent fix. just call the footer function at every table generation and use the jspdf.numberofpages() function to print the actual page nr. no need to change the autotables api:
Also for reference, you don’t really need a page counter variable. This is my barebones version for anyone else’s future reference.