pdfjs
pdfjs copied to clipboard
Pagenumbers not working with external documents
Hi,
I am trying to merge multiple pdfs into one and add pagenumbers after.
See implementation:
let doc = new pdf.Document()
let ext = new pdf.ExternalDocument(src)
doc.addPagesOf(ext)
let footer = doc.footer()
footer.pageNumber((curr, total) => `Page ${curr} / ${total}`)
let result = await doc.asBuffer()
Merging works fine but i cannot se any pagenumbers.
What am I doing wrong?
The same problem bothers me.
Thanks for the report. You aren't doing anything wrong. Page numbers are just not added to external pages right now. They are mostly copy and pasted in your new documented but not modified in any kind.
The problem seems to still exist for us. We recently started using this package and works fine on merging multiple PDFs but doesn't add the footer for page numbers.
@rkusa do we have a workaround or is that something in your roadmap to implement?
@vivekkeswaran This is not on my roadmap. The only workaround I can think of is to add the external page as an image that spans the whole page. It's quite an ugly workaround and doesn't work well with multiple pages though.