How to put footer text on the same line as page number
Opened this issue · 0 comments
KariNabor commented
I am trying to generate a footer, I want to put the page number on the same line as the rest of the footer content, but it makes a line break, that is, it puts the number and in the next line the rest. Someone could help me?
`var headerHTMLString = event.header;
var footerHTMLString = '';
var footerContent = event.footer;
var showFooter = false;
var num_page = false;
if(event.number_page == 1){
num_page = true;
showFooter = true;
}
if(footerContent !==""){
footerHTMLString = '<div style="font-size: 7px; display: flex; justify-content: space-between;">';
if (event.number_page == 1) {
var no_page = '<span style="text-align: right; flex: 1;display: inline-block;"></span>';
footerHTMLString = footerHTMLString + no_page + footerContent;
}
else{
footerHTMLString = footerHTMLString + footerContent;
}
footerHTMLString = footerHTMLString + '</div>';
showFooter = true;
}
const fileBuffer = await HTMLtoDOCX(htmlString, headerHTMLString, {
table: { row: { cantSplit: true } },
footer: showFooter,
header: true,
pageNumber: num_page}, footerHTMLString );`
It is my code.
I understand that to display the page number, the library recognizes the space for it, which is the "no_page" string.
Thank you!