Merge pull request #5443 from tsiegleauq/pdf-left-footer
Render left pdf footer image and page number
This commit is contained in:
commit
fab51091b1
@ -77,10 +77,14 @@ function addPageNumbers(data: any): void {
|
|||||||
|
|
||||||
data.doc.footer = (currentPage, pageCount) => {
|
data.doc.footer = (currentPage, pageCount) => {
|
||||||
const footer = data.doc.tmpfooter;
|
const footer = data.doc.tmpfooter;
|
||||||
|
|
||||||
|
// if the tmpfooter starts with an image, the pagenumber will be found in column 1
|
||||||
|
const pageNumberColIndex = !!footer.columns[0].image ? 1 : 0;
|
||||||
|
|
||||||
// "%PAGENR% needs to be found once. After that, the same position should always update page numbers"
|
// "%PAGENR% needs to be found once. After that, the same position should always update page numbers"
|
||||||
if (footer.columns[0].stack[0] === '%PAGENR%' || countPageNumbers) {
|
if (footer.columns[pageNumberColIndex]?.stack[0] === '%PAGENR%' || countPageNumbers) {
|
||||||
countPageNumbers = true;
|
countPageNumbers = true;
|
||||||
footer.columns[0].stack[0] = `${currentPage} / ${pageCount}`;
|
footer.columns[pageNumberColIndex].stack[0] = `${currentPage} / ${pageCount}`;
|
||||||
}
|
}
|
||||||
return footer;
|
return footer;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user