SVGs in wkhtmltopdf
-
Hi,
I have a question regarding SVGs appearance in PDF produced by wkhtmltopdf recipe. In short, here's the playground
https://playground.jsreport.net/w/anon/5lZJwIdI
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
hans
-
-
I usually take a look into the wkhtmltopdf issues on github when I need to troubleshoot something.
https://github.com/wkhtmltopdf/wkhtmltopdf/issues?utf8=✓&q=svg
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.
https://playground.jsreport.net/w/jan_blaha/OVVIdJE~
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
https://github.com/jsreport/jsreport-pdf-utils/issues/15
-
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
https://playground.jsreport.net/w/jan_blaha/fSeLP90eand here are also some notes
https://github.com/jsreport/jsreport-pdf-utils/issues/15
-
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.