Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generating table of content #12

Closed
kriwil opened this issue Aug 7, 2012 · 5 comments
Closed

Generating table of content #12

kriwil opened this issue Aug 7, 2012 · 5 comments

Comments

@kriwil
Copy link

kriwil commented Aug 7, 2012

How to generate ToC using django-wkhtmltopdf? I checked the code but didn't see a way to do that. I might miss something.

@jturnbull
Copy link
Contributor

It's not supported directly in django-wkhtmltopdf, but you could add this.

You can set an HTML file to use as the TOC with wkhtmltopdf, as described in this stackoverflow question.

@mlen108
Copy link
Contributor

mlen108 commented Mar 19, 2014

Suggested solution should resolve the ToC issue.

@mlen108 mlen108 closed this as completed Mar 19, 2014
@gkpo
Copy link

gkpo commented Mar 24, 2016

Can someone please provide a code example? by default django-wkhtmltopdf calls the command:

wkhtmltopdf [URL]

But i need to call:

wkhtmltopdf toc [URL]

and "toc" can't be passed as an argument... So how am I supposed to call it?
Thanks for your help

@tclancy
Copy link
Contributor

tclancy commented Mar 9, 2017

This doesn't look possible as-is: the ToC file needs to be rendered to HTML and then passed as a page. I have need for this and was thinking of creating a new option like WKHTMLTOPDF_TOC_OPTIONS that would accept a path to an XSL file and a position to indicate which page it should appear on. The cover argument could be handled in a similar fashion (aside from not needing to indicate which page that should be on), but I don't see anything specific to a cover that you can't simply do in your HTML template already.

@mittalrahul
Copy link

mittalrahul commented May 24, 2017

@tclancy #136 is working fine. But it is also including Header & Footer in the Cover page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants