How do I change TOC location in wkhtmltopdf output?

I need the TOC to be on the 3rd page. Apparently, if there is a way to control this, it has to be through the XSL stylesheet. All my search attempts didn't give me a clue though. Is it possible at all?

I can't use cover option since I need the header to show on both first and second pages.

Answers


OK I've found a way to do it using wkhtmltopdf 0.11. I've extracted the first two pages into a separate HTML document and then run it like this

wkhtmltopdf [options] page cover.html toc --xsl-style-sheet ... input_file.html out.pdf

Unfortunately it took a lot more effort than I expected, since I'm using it in a Rails application through wicked_pdf, and it doesn't play nice with the new options format, so I had to fork it and make the necessary changes as well.

The command line generated by wicked_pdf looks like this (long paths omitted):

"c:/program files (x86)/wkhtmltopdf/wkhtmltopdf.exe"  
   --header-html "file:///path/to/header" --footer-html "file:///path/to/footer" 
   --margin-top 20 --margin-bottom 15 --margin-left 5 --margin-right 40    page "file:///path/to/cover/page" --disable-javascript  toc --xsl-style-sheet "path/to/style/sheet"  - -

Need Your Help

How to generate a pie chart from 2 string values in asp.net c#

c# asp.net .net sql-server webchartcontrol

I have 2 columns ID and Severity, both of datatype string in my database table with the Severity column having High, Medium and Low values. I added a Chart control and specified its data using a sq...

htaaccess password protection

.htaccess cloud cache-control .htpasswd

i have a development version of a site and so am using password protection. The problem is i am using cloud for managing static contents like images. css, js etc