# Integrating Google Charts into a Prawn PDF(please helpme)

**URL:** <https://www.ruby-forum.com/t/integrating-google-charts-into-a-prawn-pdf-please-helpme/191946>\
**Category:** Deployment\
**Created:** [July 21, 2010, 6:51am UTC](https://www.ruby-forum.com/t/integrating-google-charts-into-a-prawn-pdf-please-helpme/191946 "2010-07-21T06:51:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![murfhy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/d26b3c/32.png) [@murfhy](https://www.ruby-forum.com/u/murfhy)\
**Post date:** [July 21, 2010, 6:51am UTC](https://www.ruby-forum.com/t/integrating-google-charts-into-a-prawn-pdf-please-helpme/191946/1 "2010-07-21T06:51:39Z")

</div>

i just created an application to show the user details and a pie  
chart in one page, also i provided an link on clicking that will  
display the result in a pdf file, i am able to get the result in pdf  
except the pie chart.i will explain the controller and all below.  
there is a variable that gives the pie chart details is defined in  
the controller, its showing value like this @pie\_chart\_url  
i created a page called view\_campaign\_reports.pdf.prawn to show the  
user details pie chart. in that page i had given code like this  
(i inatalled gem prawn and plugin prawnto and did all plugin  
specifications)  
pdf.image open(@pie\_chart\_url)  
but i am getttttttting an error like this in controller

URI::InvalidURIError in Reports#view\_campaign\_reports

Showing app/views/reports/view\_campaign\_reports.pdf.prawn where line #93  
raised:

bad URI(is not URI?):  
[http://chart.apis.google.com/chart?chs=420x150&amp;cht=p3&amp;chl=Opened+28%25|Not+opened+71%25&amp;chd=t:28,71](http://chart.apis.google.com/chart?chs=420x150&amp;cht=p3&amp;chl=Opened+28%25%7CNot+opened+71%25&amp;chd=t:28,71)

Extracted source (around line #93):

90:  
91:  
92:  
93: pdf.image open(@pie\_chart\_url), :at =\> [0, 230], :scale =\> 0.5  
94: thelogo =  
“#{RAILS\_ROOT}/public/images/email\_templates/coupon\_rag.png”  
95: pdf.image thelogo

But when i use the same @pie\_chart\_url in the view its able to  
display pie chart, but unable to show in pdf , can any one please  
help me
