highcharts display in my render html page which i want to convert into PDF using wkhtmltopdf in rails

大城市里の小女人 提交于 2019-12-08 01:39:23

问题


I have an html page with some text data and graph. I am using wkhtmltopdf gem to generate pdf from html page. Using highcharts, i am generating graph.

I am able to generate PDF successfully but PDF only contains text data and doesn't have graph in it.

I already tried with some options as below

 - plotOptions: { series: { enableMouseTracking: false, shadow: false, animation: false } }, in Hightcharts jquery coding..

Please assist me to resolve this issue.


回答1:


I am not familiar w/wkhtmltopdf but I do use wkhtmltoimage to create images of pages that contain graphs from highcharts. One thing I noticed is that I had to set --javascript-delay to be several seconds long to make sure the chart had enough time to load. It seems as though wkhtmltopdf does support this option (wkhtmltopdf v0.10.0_rc2 docs). Can you see if that helps?

Here is how we call it w/a javascript delay of 3 seconds:

/bin/wkhtmltoimage --javascript-delay 3000 "http://example.com/chartPage" "/path/to/image.png"


来源:https://stackoverflow.com/questions/12621327/highcharts-display-in-my-render-html-page-which-i-want-to-convert-into-pdf-using

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!