SVGs in wkhtmltopdf
I have a question regarding SVGs appearance in PDF produced by wkhtmltopdf recipe. In short, here's the playground
If you run this with 'html' recipe or 'chrome-pdf' recipe, the images look as expected. However, using wkhtmltopdf recipe, we need to specify incorrect height and width to get the image showing (and not squashed). Specifying the correct height and width display the image in squashed dimension, and not specifying height and width does not show the image at all.
How do you use SVGs in wkhtmltopdf? We have to use wkhtmltopdf as it looks like the only option that can generate Table of Contents, otherwise we would be happy to use chrome-pdf.
Thanks in advance
I usually take a look into the wkhtmltopdf issues on github when I need to troubleshoot something.
But I see you also already filled one.:)
The TOC is supported out of the box really just in the wkhtmltopdf. However, you may be able to reach the same in chrome by hand. Take a look at this demo.
I am afraid you will want there also page numbers in the TOC right? That can be tricky, but perhaps we can find solution for it.
Thanks for the reply and the demo @jan_blaha. Yeah the page numbers is quite important in the TOC. Looking forward to either chrome-pdf supporting TOC (came across the feature request in chromium project) as I think going forward this has the best chance to support modern browser features, or for wkhtmltopdf to play nicer with SVGs.
We will try to support TOC through our pdf-utils extension.
I will try to post here when we have something working.
Or you can subscribe here
The pdf utils now support adding TOC to the chrome-pdf recipe.
Would you find time to give me some feedback?
Here is the demo
and here are also some notes
Thanks @jan_blaha. I'll have a look.
The solution looks good @jan_blaha :). A colleague recently already found this similar method (haven't had a chance to share it with you yet), but this one just confirm it, and it shows linking too (we couldn't figure out the linking bit before).
Thank you very much for your assistance.
Thank you for feedback.
We will probably release it as it is. Maybe only some naming changes in the outline attributes.
I believe we will ship jsreport 2.4.0 with it the next week or the one after.