eKoopmans/html2pdf.js

How to generate a pdf with a table of contents?

wml107 opened this issue · 2 comments

wml107 commented

I would like to generate a pdf with a table of contents. The title of the table of contents is dynamically extracted from my content and also needs to correspond to the page number. The current API doesn't seem to be sufficient for me to achieve this, is there any solution?

Hello @wml107 did you found a solution? I am seeking the same goal

Hello @wml107 did you found a solution? I am seeking the same goal

I realized this demand through the paged.js, it can not only automatically generate the toc, also can add the header and footer with the page number; He is based on the processing of html, completely independent of the canvas, so it can also support a variety of complex styles; And it works well with the lifecycle of libraries like Vue and React.