I'm trying to render some SVG and it doesn't show up at all in the PDF. It's SVG that's been generated by a HighStock chart. I've successfully rendered other Highcharts output so I'm a bit mystified by this.
This appears to be a width/height/viewBox issue scaling the SVG too small, which we have corrected for the next release of Prince; see the attached PDF files below. A quick workaround is to add viewBox="0 0 600 400" to the root SVG element.
btw, does anyone know why enabling javascript on eg a highcharts page still doesn't result in the chart being rendered? prince doesn't log any JS errors etc, it just doesn't produce anything. animation etc are turned off.
HighCharts uses some JavaScript DOM features that we haven't supported in Prince yet, and I think it catches any exceptions internally, which is why no errors show up in the log. We're working on this, but it's a big job. In the meantime, the SVG export is the easiest workaround.
yes, it seems so. possibly a dumb question, is there any neat way to convert pdf mm/cm sizes into pixels, which seems to be all that highcharts understands?
Pixels in SVG are generally 96dpi, the same as in CSS, but Prince has treated SVG pixels slightly inconsistently, so they might be 72dpi in the version you are using. The next release of Prince will treat SVG and CSS pixel units more consistently.