Forum: Rails deployment Integrating Google Charts into a Prawn PDF

Posted by Tony Augustine (tonya99)
on 2010-07-20 13:34
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...

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
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.