pdfjs icon indicating copy to clipboard operation
pdfjs copied to clipboard

Show page number inside text or cell

Open mzdani opened this issue 5 years ago • 1 comments

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 :)

mzdani avatar Jan 08 '19 03:01 mzdani

Hi, this is unfortunately currently not implemented, sorry 😕

rkusa avatar Jan 08 '19 07:01 rkusa