Page numbering in table of contents

2,249 views
Skip to first unread message

Pedro Santos

unread,
Jan 3, 2017, 4:01:09 AM1/3/17
to wkhtmltopdf General
Hi,

I'm using wkhtmltopdf on my Ubuntu machine, everything works fine.

Is there a way to generate ToC (table of contents) with page numbering ? It is very important since reports that I generate are huge (over 300 pages each), and it would be nice to have page numbering so the reader can find the content he needs faster.

For those who are more experienced in web development field: is there a way to create ToC with page numbering using just Javascript ? or even CSS ..
Any suggestion is appreciated.

Thanks. Merci. Obrigado.

Atul Raval

unread,
Jan 5, 2017, 5:51:53 AM1/5/17
to wkhtmltopdf General
Yes you can do page numbering like this way, "paramsBuilder.Append("--footer-center \"Page [page] of [toPage]\"");"
here [page] [toPage] default property of wkhtmltopdf,

Pedro Santos

unread,
Jan 8, 2017, 8:21:38 AM1/8/17
to wkhtmltopdf General
Thank you for replying, but it is not what I asked. =/
You see, the ToC mean Table of Contents. What I need is the Table of Contents which contains the page numbering.
Example:

Chapter I..........1
Chapter II.........12
Chapter III........31
Chapter IV........50
End.

How would I do this ? I dont even know how to start.

rox

unread,
Jan 8, 2017, 2:44:45 PM1/8/17
to wkhtmltopdf General
Try this list. options for table of contents - https://madalgo.au.dk/~jakobt/wkhtmltoxdoc/wkhtmltopdf-0.9.9-doc.html

Pedro Santos

unread,
Jan 8, 2017, 5:52:37 PM1/8/17
to wkhtmltopdf General
Hey rox. Thank you for this link, it is indeed very useful.
But once again, nothing from that page can help me.
I dont need a simple Table of Contents, I need ToC with page numbers.
If the chapter 4 starts on page 45, I would like to have ToC with number 45 next to the chapter 4 line.

Jakob Truelsen

unread,
Jan 9, 2017, 1:26:36 AM1/9/17
to wkhtmltop...@googlegroups.com
If you use the satic compilation from wkhtmltopdf.org it should just work..

./bin/wkhtmltopdf toc https://madalgo.au.dk/~jakobt/wkhtmltoxdoc/wkhtmltopdf-0.9.9-doc.html out.pdf

Gives a pdf with a toc with page numbers for me.

/Jakob

--
===================================================
You received this message because you are subscribed to the "wkhtmltopdf General" group.
To post to this group, send email to wkhtmltopdf-general@googlegroups.com
To unsubscribe from this group, send email to wkhtmltopdf-general+unsub...@googlegroups.com
 
For more options, visit this group at
http://groups.google.com/group/wkhtmltopdf-general?hl=en?hl=en
---
You received this message because you are subscribed to the Google Groups "wkhtmltopdf General" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wkhtmltopdf-general+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Pedro Santos

unread,
Jan 17, 2017, 6:07:42 AM1/17/17
to wkhtmltopdf General
OMG. Thank you, kind stranger!
It worked like magic. I even learned XSLT in order to style my own index page.
I love wkhtmltopdf, what a great tool !!

Only one question remains. Can I render the footer on the cover too ?
At the moment, my cover page has a blank space instead of my custom footer.
But all other pages have footers.

Well. Once again. THANK YOU VERY MUCH !!!!

faisal mehdi saiyed

unread,
Nov 27, 2019, 7:23:21 AM11/27/19
to wkhtmltopdf General
How do i create index page which show page number of perticular page?
I am generating report using rotativa in mvc5
and the link is not opening


On Monday, January 9, 2017 at 11:56:36 AM UTC+5:30, Jakob Truelsen wrote:
If you use the satic compilation from wkhtmltopdf.org it should just work..

./bin/wkhtmltopdf toc https://madalgo.au.dk/~jakobt/wkhtmltoxdoc/wkhtmltopdf-0.9.9-doc.html out.pdf

Gives a pdf with a toc with page numbers for me.

/Jakob
On Sun, Jan 8, 2017 at 11:52 PM, Pedro Santos <colum...@gmail.com> wrote:
Hey rox. Thank you for this link, it is indeed very useful.
But once again, nothing from that page can help me.
I dont need a simple Table of Contents, I need ToC with page numbers.
If the chapter 4 starts on page 45, I would like to have ToC with number 45 next to the chapter 4 line.


On Sunday, January 8, 2017 at 7:44:45 PM UTC, rox wrote:
Try this list. options for table of contents - https://madalgo.au.dk/~jakobt/wkhtmltoxdoc/wkhtmltopdf-0.9.9-doc.html

--
===================================================
You received this message because you are subscribed to the "wkhtmltopdf General" group.
To post to this group, send email to wkhtmltop...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages