Can NodeJS Puppeteer printed PDF have feature like HTML's <a> or Adobe's Hyperlink to jump to other part on PDF?

725 views Asked by At

I would like to use NodeJS Puppeteer to prepare PDF that support page jumping from Summary Page. How can I do that?

2

There are 2 answers

0
Dima On

there is no adequate way to do that, but if you know the list format (a4/a3/a2) and letter height in the table of contents, you can calculate the pixel position of any hyperlink you want and click it with page.mouse.click(x, y[, options])

0
DaiKeung On

It is support by using <a> with adding below css:

@media print {
    a::after{
      content: " (" attr(href) ") ";
    }
  }