user1606135
user1606135

Reputation: 21

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

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.

Upvotes: 2

Views: 1472

Answers (1)

malonso
malonso

Reputation: 2295

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"

Upvotes: 5

Related Questions