node-html-pdf icon indicating copy to clipboard operation
node-html-pdf copied to clipboard

Table Of Contents

Open sibinjoy100 opened this issue 8 years ago • 4 comments

Hi ,

I am new to html-pdf package. Can someone please tell how to create TOC (table of contents) for a pdf file.

Thanks in advance.

sibinjoy100 avatar May 11 '17 11:05 sibinjoy100

I am interested too. At the moment I have a toc like the one shown to build here: https://css-tricks.com/automatic-table-of-contents/

However I would like to be able to add support for displaying of page numbers, if anyone has ideas would be great thanks

sanchez avatar Nov 19 '17 11:11 sanchez

maybe we can do this if we can also print {{page}} inside the body.

<span style="display:none;" id="section-id" page="{{page}}">Section title</span>

then we can add js script on table of contents to get the page of that section.

but the problem is I cant use {{page}} inside pdf body. 😢

joshuadiezmo avatar Feb 14 '20 06:02 joshuadiezmo

Hi, Is there a solution to make Table of Contents work in pdf using html-pdf?

sireeshapatibandla avatar Feb 28 '20 18:02 sireeshapatibandla

Hi, Is there a solution to make Table of Contents work in pdf using html-pdf?

@sireeshapatibandla hey did you find solution to this ? Can you share working repo or any other library ?

Siddharth-Tiwari1712 avatar Sep 11 '23 14:09 Siddharth-Tiwari1712