0

I'm currently working with the Pechkin library for creating pdf-files based on html. It all works great.

But I want to add one thing, a table of contents (TOC). But I can't get this working. With only wkhtmltopdf it's easy to do:

wkhtmltopdf toc --xsl-style-sheet toc.xsl index.html index.pdf

But with Pechkin it won't work. I have already a bookmark (which works in Adobe Reader), but it's not a real TOC what I want. I've tried to add

ObjectConfig().SetTocXsl("tocXslStyleSheetUri")

But it seems to have no effect.

I also tried to work with:

ObjectConfig().SetCreateToc(true);

This will create an empty pdf because this function is obsolete.

So I get a nice pdf-result, but only without a Table of Content. Does anyone of you know how I get the TOC appear in my pdf-file?

I also asked this question as an issue on github, but because they're not always that quick with reacting, or doesn't react at all, I also asked the question here.

Vincent Hogendoorn
  • 700
  • 1
  • 7
  • 23
  • I use wkhtmltopdf from c# and I personally think not using a wrapper for it is much simpler than using a wrapper. How about them apples; call it using your own written Process etc - should be simple enough. – Joel Peltonen Jan 08 '14 at 14:48
  • yes, but without a wrapper it's need to be installed on the computer right? And because it's for a web application that's on different servers this would make such installation difficult I guess? – Vincent Hogendoorn Jan 08 '14 at 14:50
  • Yeah, that is true - good point! I have it installed in my webserver but it might be difficult for some service providers. – Joel Peltonen Jan 08 '14 at 14:52

1 Answers1

0

What if you create the table of contents on a seperate page and give its url to the ObjectConfig object . I can show you the code if required.

Irfan TahirKheli
  • 3,652
  • 1
  • 22
  • 36
  • It's possible, but with wkhtmltopdf it's possible to generate the table of content (it looks at the

    tags in the html) and also adds numbering automatically. If I create a seperate page with the table of contents this won't work

    – Vincent Hogendoorn Dec 20 '13 at 13:08
  • Ya thats true. In seperate page case you will have to create whole html manually. – Irfan TahirKheli Dec 20 '13 at 13:10