-1

Has anyone had any success using Highcharts with Prawn? Is there a way to include the generated jpg or png to insert into the Prawn code? Any help would be greatly appreciated.

DollarChills
  • 1,076
  • 1
  • 15
  • 33
  • http://stackoverflow.com/questions/8896182/can-i-use-highcharts-in-a-pdf-generate-with-prawn-in-rails – gberger Mar 20 '14 at 00:38

1 Answers1

0

Yes you can insert images in prawn code by using image tag

require File.expand_path(File.join(File.dirname(__FILE__),
                               %w[.. example_helper]))

filename = File.basename(__FILE__).gsub('.rb', '.pdf')
Prawn::Example.generate(filename) do
  text "The image will go right below this line"
  image "#{Prawn::DATADIR}/images/pigs.jpg"
end
cvibha
  • 693
  • 5
  • 9
  • Thanks vibha, I guess my next question is, how can I grab the image from high charts as it creates it dynamically? – DollarChills Mar 20 '14 at 01:08
  • Hi @DollarChills - Did you find the answer of your question that 'how can I grab the image from high charts as it creates it dynamically?'.If yes, then please let me know because i have the similar kind of problem. Thanks – Shoaib Malik Jul 25 '16 at 06:39
  • Yes i did @ShoaibMalik – DollarChills Aug 11 '16 at 02:12