pdfjs
pdfjs copied to clipboard
Show page number inside text or cell
Hello,
I'm using latest version (2.1.0) and want to know how to get current page number to show on cell
or text
. I read previous issues #42, but when I try to get current page number with doc.text.pageNumber
or doc.text().pageNumber
, its always return pageNumber is not a function
.
The example scenario is I want to make a table on footer with 3 cell (left, center, right) and show page number inside one of the cell. If using footer.pageNumber()
, this will show up after
or before
another element.
var footer = doc.footer();
var fTbl = footer.table({widths: [null, null, null]}).row();
fTbl.cell('onLeft', {textAlign: 'left'});
fTbl.cell('onCenter', {textAlign: 'center'});
footer.pageNumber({textAlign: 'center'});
fTbl.cell('onRight', {textAlign: 'right'});
This will show (ex) :
onLeft onCenter onRight
1
Thanks for your explanation :)
Hi, this is unfortunately currently not implemented, sorry 😕