I’m looking for a way to re-use my prawn code in other views (HAML). It can also be an image, but I don’t need the whole PDF (with the layout and other pages), just a small graphic (chart) that I render in Prawn using a method.
EDIT:
because I’m using Heroku and I’m not saving the file (it’s a response to a web request), I’m don’t really want to open a pdf file with ImageMagick for example and process it into an image, unless it is my last option (besides coding the graphic again in HTML+CSS).
I don’t know about a gem that might do the trick but you can always use RMagick or MiniMagick to covert the generated pdf to an image and scale it down:
Hopefully you’ll find this useful.