I’m using RGhost-Rails to generate bar codes on a pdf file (with wicked-pdf).
I’ve the following code (in Ruby on Rails 3)
<% doc=RGhost::Document.new :paper => [7,2]%>
<% doc.barcode_code39('1234567', :text => {:size => 10, :offset => [0,-10], :enable => [:text, :check, :checkintext] }) %>
<% r= doc.render :png, :resolution => 100, :debug => true, :filename => "./public/pdf/rghost_barcode.png" %>
This code works fine but i want to generate my image inline (without worrying with the filename and filepath). Something like (i guess):
<% doc=RGhost::Document.new :paper => [7,2]%>
<% doc.barcode_code39('1234567', :text => {:size => 10, :offset => [0,-10], :enable => [:text, :check, :checkintext] }) %>
<% r= doc.render_stream :png, :filename => "./public/pdf/test.png" %>
<img src="<%= RGhost inline functionality/ r.stream_Object_String? %>" width="16" height="335" alt="asd">
In this way, i wouldn’t have to worry about deleting the (generated) code bar files after showing the pdf.
There is any way to do this? If not, there’s other gems with these functionality (please note that i also need to show the code bar text – some gems doesn’t have this).
Apparently the only solution (not the one i’m looking for) is this