pdf.image directly from database

44 views
Skip to first unread message

sk

unread,
Jul 2, 2009, 3:01:38 AM7/2/09
to Prawn
Hi
I want to place a logo in the pdf page I am using postgres That
image is in a table stored as bytea Could anybody please suggest how
can I access that
I tried like

pdf.image c.data But this gives me an error

sk

Andrew France

unread,
Jul 2, 2009, 5:24:20 AM7/2/09
to prawn...@googlegroups.com

Usually it's important to specify the error received. In this case
though you can probably do it by passing a StringIO object that contains
the data as this will behave like you are passing a file (which image()
accepts as an alternative to a path).

E.g: pdf.image StringIO.new(c.data)

Regards,
Andrew

Reply all
Reply to author
Forward
0 new messages