I am using Google visualizatio API Table and Imagechart . I want to render it as pdf . Please suggest me. Here is my code:
First and foremost this is not a salesforce question.
I think that this is not possible to do.
Google API use canvas and similar techniques to draw a chart, and create his own dom elements to draw the table. There are no way to translate that rendering into a PDF in a browser by now.
Google has "image charts" API you could use but it's deprecated and you shouldn't really rely on it for production purposes.
There might be other solutions available to you. Check out AppExchange or maybe decide to use something internal... For example you could set up a PHP-powered server with GD library to serve pictures, fetch them (only during PDF creation or maybe prefetch & save as attachments)? There's http://jpgraph.net/ but probably every language you're familiar with will have some library worth checking out.
To use this API make sure that you've added right "Remote Site Setting" (you might also tick disable protocol security if you suspect HTTP/HTTPs errors).
Sample email with PDF attachment containing an image:
<messaging:emailTemplate subject="test" recipientType="User" relatedToType="Account"> <messaging:plainTextEmailBody > Hi Salesforce StackExchange! </messaging:plainTextEmailBody> <messaging:attachment renderAs="pdf"> <img src="http://chart.googleapis.com/chart?cht=p3&chd=s:Uf9a&chs=250x100&chl=January|February|March|April" /> </messaging:attachment> </messaging:emailTemplate>
The Remote Site I've added is http://chart.googleapis.com