Skip to content

Commit eede716

Browse files
3.8.1
1 parent cb13942 commit eede716

File tree

5 files changed

+38
-22
lines changed

5 files changed

+38
-22
lines changed

dist/jspdf.plugin.autotable.js

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*!
22
*
3-
* jsPDF AutoTable plugin v3.8.0
3+
* jsPDF AutoTable plugin v3.8.1
44
*
55
* Copyright (c) 2023 Simon Bengtsson, https://github.com/simonbengtsson/jsPDF-AutoTable
66
* Licensed under the MIT License.
@@ -1686,7 +1686,9 @@ function printTableWithHorizontalPageBreak(doc, table, startPos, cursor) {
16861686
doc.applyStyles(doc.userStyles);
16871687
// add page to print next columns in new page
16881688
if (index > 0) {
1689-
addPage(doc, table, startPos, cursor, colsAndIndexes.columns);
1689+
// When adding a page here, make sure not to print the footers
1690+
// because they were already printed before on this same loop
1691+
addPage(doc, table, startPos, cursor, colsAndIndexes.columns, true);
16901692
}
16911693
else {
16921694
// print head for selected columns
@@ -1705,21 +1707,26 @@ function printTableWithHorizontalPageBreak(doc, table, startPos, cursor) {
17051707
var lastPrintedRowIndex = lastRowIndexOfLastPage_1;
17061708
if (firstColumnsToFitResult) {
17071709
doc.applyStyles(doc.userStyles);
1710+
var firstColumnsToFit = firstColumnsToFitResult.columns;
17081711
if (lastRowIndexOfLastPage_1 >= 0) {
1709-
addPage(doc, table, startPos, cursor, firstColumnsToFitResult.columns);
1712+
// When adding a page here, make sure not to print the footers
1713+
// because they were already printed before on this same loop
1714+
addPage(doc, table, startPos, cursor, firstColumnsToFit, true);
17101715
}
17111716
else {
1712-
printHead(doc, table, cursor, firstColumnsToFitResult.columns);
1717+
printHead(doc, table, cursor, firstColumnsToFit);
17131718
}
1714-
lastPrintedRowIndex = printBodyWithoutPageBreaks(doc, table, lastRowIndexOfLastPage_1 + 1, cursor, firstColumnsToFitResult.columns);
1715-
printFoot(doc, table, cursor, firstColumnsToFitResult.columns);
1719+
lastPrintedRowIndex = printBodyWithoutPageBreaks(doc, table, lastRowIndexOfLastPage_1 + 1, cursor, firstColumnsToFit);
1720+
printFoot(doc, table, cursor, firstColumnsToFit);
17161721
}
17171722
// Check how many rows were printed, so that the next columns would not print more rows than that
17181723
var maxNumberOfRows = lastPrintedRowIndex - lastRowIndexOfLastPage_1;
17191724
// Print the next columns, never exceding maxNumberOfRows
17201725
allColumnsCanFitResult.slice(1).forEach(function (colsAndIndexes) {
17211726
doc.applyStyles(doc.userStyles);
1722-
addPage(doc, table, startPos, cursor, colsAndIndexes.columns);
1727+
// When adding a page here, make sure not to print the footers
1728+
// because they were already printed before on this same loop
1729+
addPage(doc, table, startPos, cursor, colsAndIndexes.columns, true);
17231730
printBodyWithoutPageBreaks(doc, table, lastRowIndexOfLastPage_1 + 1, cursor, colsAndIndexes.columns, maxNumberOfRows);
17241731
printFoot(doc, table, cursor, colsAndIndexes.columns);
17251732
});
@@ -2006,10 +2013,11 @@ function getRemainingPageSpace(doc, table, isLastRow, cursor) {
20062013
}
20072014
return doc.pageSize().height - cursor.y - bottomContentHeight;
20082015
}
2009-
function addPage(doc, table, startPos, cursor, columns) {
2016+
function addPage(doc, table, startPos, cursor, columns, suppressFooter) {
20102017
if (columns === void 0) { columns = []; }
2018+
if (suppressFooter === void 0) { suppressFooter = false; }
20112019
doc.applyStyles(doc.userStyles);
2012-
if (table.settings.showFoot === 'everyPage') {
2020+
if (table.settings.showFoot === 'everyPage' && !suppressFooter) {
20132021
table.foot.forEach(function (row) { return printRow(doc, table, row, cursor, columns); });
20142022
}
20152023
// Add user content just before adding new page ensure it will

dist/jspdf.plugin.autotable.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/jspdf.plugin.autotable.mjs

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1334,7 +1334,9 @@ function printTableWithHorizontalPageBreak(doc, table, startPos, cursor) {
13341334
doc.applyStyles(doc.userStyles);
13351335
// add page to print next columns in new page
13361336
if (index > 0) {
1337-
addPage(doc, table, startPos, cursor, colsAndIndexes.columns);
1337+
// When adding a page here, make sure not to print the footers
1338+
// because they were already printed before on this same loop
1339+
addPage(doc, table, startPos, cursor, colsAndIndexes.columns, true);
13381340
}
13391341
else {
13401342
// print head for selected columns
@@ -1353,21 +1355,26 @@ function printTableWithHorizontalPageBreak(doc, table, startPos, cursor) {
13531355
var lastPrintedRowIndex = lastRowIndexOfLastPage_1;
13541356
if (firstColumnsToFitResult) {
13551357
doc.applyStyles(doc.userStyles);
1358+
var firstColumnsToFit = firstColumnsToFitResult.columns;
13561359
if (lastRowIndexOfLastPage_1 >= 0) {
1357-
addPage(doc, table, startPos, cursor, firstColumnsToFitResult.columns);
1360+
// When adding a page here, make sure not to print the footers
1361+
// because they were already printed before on this same loop
1362+
addPage(doc, table, startPos, cursor, firstColumnsToFit, true);
13581363
}
13591364
else {
1360-
printHead(doc, table, cursor, firstColumnsToFitResult.columns);
1365+
printHead(doc, table, cursor, firstColumnsToFit);
13611366
}
1362-
lastPrintedRowIndex = printBodyWithoutPageBreaks(doc, table, lastRowIndexOfLastPage_1 + 1, cursor, firstColumnsToFitResult.columns);
1363-
printFoot(doc, table, cursor, firstColumnsToFitResult.columns);
1367+
lastPrintedRowIndex = printBodyWithoutPageBreaks(doc, table, lastRowIndexOfLastPage_1 + 1, cursor, firstColumnsToFit);
1368+
printFoot(doc, table, cursor, firstColumnsToFit);
13641369
}
13651370
// Check how many rows were printed, so that the next columns would not print more rows than that
13661371
var maxNumberOfRows = lastPrintedRowIndex - lastRowIndexOfLastPage_1;
13671372
// Print the next columns, never exceding maxNumberOfRows
13681373
allColumnsCanFitResult.slice(1).forEach(function (colsAndIndexes) {
13691374
doc.applyStyles(doc.userStyles);
1370-
addPage(doc, table, startPos, cursor, colsAndIndexes.columns);
1375+
// When adding a page here, make sure not to print the footers
1376+
// because they were already printed before on this same loop
1377+
addPage(doc, table, startPos, cursor, colsAndIndexes.columns, true);
13711378
printBodyWithoutPageBreaks(doc, table, lastRowIndexOfLastPage_1 + 1, cursor, colsAndIndexes.columns, maxNumberOfRows);
13721379
printFoot(doc, table, cursor, colsAndIndexes.columns);
13731380
});
@@ -1654,10 +1661,11 @@ function getRemainingPageSpace(doc, table, isLastRow, cursor) {
16541661
}
16551662
return doc.pageSize().height - cursor.y - bottomContentHeight;
16561663
}
1657-
function addPage(doc, table, startPos, cursor, columns) {
1664+
function addPage(doc, table, startPos, cursor, columns, suppressFooter) {
16581665
if (columns === void 0) { columns = []; }
1666+
if (suppressFooter === void 0) { suppressFooter = false; }
16591667
doc.applyStyles(doc.userStyles);
1660-
if (table.settings.showFoot === 'everyPage') {
1668+
if (table.settings.showFoot === 'everyPage' && !suppressFooter) {
16611669
table.foot.forEach(function (row) { return printRow(doc, table, row, cursor, columns); });
16621670
}
16631671
// Add user content just before adding new page ensure it will

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jspdf-autotable",
3-
"version": "3.8.0",
3+
"version": "3.8.1",
44
"description": "Generate pdf tables with javascript (jsPDF plugin)",
55
"main": "dist/jspdf.plugin.autotable.js",
66
"exports": {

0 commit comments

Comments
 (0)