So if I wanted to include the PNG file into a PDF using TCPDF, my guess is that I would need to do a 2-step process.
Step 1 - generate all my charts Step 2 - call my PDF generator code The chart generation is all JavaScript so its done on the browser. The PDF generation is pure PHP and is all backend, no frontend processing whatsoever. Basically the best thing to do for me is to generate the images, save them either in a MySQL database or as image files. Then my PDF generator can recall the images. I have about 3 charts per page, 2 page report. Thanks Mike On Wednesday, November 2, 2011 1:23:42 PM UTC-4, Riccardo Govoni wrote: > > This is a topic that pops up frequently here in the forum. Many users have > the need to convert/serialize the interactive charts they generate using > the Google Charts Tools API into static images (PNGs or equivalent) for the > user to download or further process. > > Currently the interactive charts API do not offer this feature (unless you > are in specific domains, such as within a Google Apps > Script<http://code.google.com/googleapps/appsscript/>script), unless you are > willing to regenerate your chart using the static > image APIs <http://code.google.com/apis/chart/image/> --- which however > have different semantics, making it difficult to support both. > > A quick workaround for this is to convert the SVG chart to <canvas /> and > then extract the image data from there. This allows for full client-side > pure javascript image serialization, at the cost of cross-browser support. > The solution works on Chrome,Safari,Firefox,IE9 and Opera, but IE8 and > lower does not support the necessary features for this to work (server-side > image serialization is also possible, although I won't discuss it here). > > I have written a brief tutorial and example page to show how this work. > Depending on the browsers your users use, and how flexible you can be, the > solution might be good enough for your case. > > Tutorial : > http://www.battlehorse.net/page/topics/charts/save_google_charts_as_image.html > Example page: > http://www.battlehorse.net/attach/topics/charts/google_charts_to_image.html > Source code : https://gist.github.com/1333906 > > Please note that this is somewhat an hack that I put together in the spare > time based on the popularity of topic and lack of support in the current > official API, so use at your own risk. Have a look at the tutorial for the > limitations. If I were to support image serialization for a production > service, I'd still recommend using the static image APIs mentioned above. > > Please discuss / comment / improve. > - R. > -- You received this message because you are subscribed to the Google Groups "Google Visualization API" group. To view this discussion on the web visit https://groups.google.com/d/msg/google-visualization-api/-/8p6TkZ0EcBcJ. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.
