Closed jmarquesCC closed 11 years ago
You can do this using the url to your controller and invoking the code from your controller(without ERB), something like:
private
def barcodes doc=RGhost::Document.new :paper => [7,2] doc.barcode_code39('1234567', :text => {:size => 10, :offset => [0,-10], :enable => [:text, :check, :checkintext] }) send_data(doc.render_stream(:png), :type => "image/png", :disposition => 'inline') end
Hi,
I already had tried that solution... the problem is: the send_data function will sends the given binary data to the browser (so the browser will rendered the page as PNG (in this case)). :/
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)
This code works fine but i want to generate my image inline (without worrying with the filename and filepath). Something like (i guess):
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?