I recently spent some hours trying to find out why my SVG graph wasn’t rendering properly with wkhtmltopdf. Since the same problem might occur to others I wanted to share it here. So this is the issue: It seems like wkhtmltopdf has a problem with rendering when you use “stroke-dasharray” inside a SVG with a value of “0″, which may be used to set a path to a continuous line. Whenever this is used, wkhtmltopdf will fail to render the SVG properly (see bug report for further info).
If this happened to you while using Raphael.js you can fix this by updating a value inside the library. Raphael.js is using a “0″ for “stroke-dasharray” whenever you either leave the value empty or use “none” as the value. Inside the library you will find this where an object “dasharray” is initialized (right above the initialization of the function “addDashes”). You can replace both zeros by a very high value, i.E. 99999. It only needs to be higher than the pixel length of your path, because then it will still be shown as a continuous line.
- How to clear and disable DOM Storage in Firefox, IE and Chrome 19,134 view(s)
- Simple PHP crawler example 17,965 view(s)
- Detecting Firefox add-ons 9,713 view(s)
- How to install, automate and secure AWStats including GeoIP-Plugin on Debian 8,551 view(s)
- HAProxy Load Balancer setup including logging on Debian
- Configuring a permanent SSH tunnel for MySQL connections on Debian
- How to install, automate and secure AWStats including GeoIP-Plugin on Debian
- How to animate a rectangle bottom up with Raphaël.js
- Fix for wkhtmltopdf rendering issue when using SVG