include jquery charts into pdf

风流意气都作罢 提交于 2019-12-08 08:17:51

问题


i use tcpdf for pdf generation in php. http://www.tcpdf.org/examples.php

i use a javascript / jquery framwork / plugin to display some charts. (f.e. http://filamentgroup.com/lab/update_to_jquery_visualize_accessible_charts_with_html5_from_designing_with/ )

the tcpdf intern way for charts is no opportunity for me. there is a method transforming canvas to png like described here ( Capture HTML Canvas as gif/jpg/png/pdf? ) which unfortunately does only convert, in all tested plugins/frameworks, fragments of the needed chart.

tcpdf supports javascript but imo only for form interactions, like seen in one of the samples.

which way, even which library (different than tcpdf) allows me to include js-charts into a pdf in php without server access?


回答1:


wkhtmltopdf sits on top of a QT port of WebKit (thus the "wk" in the name). Its JavaScript support is EXCELLENT.

I've used it to successfully render a page containing a google map. It doesn't get much more script-intense than that. I did have to play with the command line a bit (allowed the page's JS longer than the default time to complete, 100ms, 200?).




回答2:


My work-arround for this goes along by using google charts api. google helps you to get interactive charts on the webpage and for converting to pdf google creates static png's with the whole data displayed. so far i can live with that pretty good.



来源:https://stackoverflow.com/questions/5767426/include-jquery-charts-into-pdf

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