From: Kevin Marsh Date: 2008-12-19T08:40:12+09:00 Subject: Re: Barby 0.1 - Ruby barcode generator that doesn't suck (that much) ------=_Part_2670_26796252.1229644090873 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hate to resurrect an old thread, but I got this to work with Prawn, and it's pretty slick. (This is in a prawnto/Rails view) require 'barby' require 'barby/outputter/prawn_outputter' pdf.bounding_box [450,700], :width => 100 do barcode = Barby::Code39.new(@order.order_identifier) barcode.annotate_pdf(pdf, :height => 30) end Plops a nice vector barcode right there. Really slick! Kevin On Sat, Jul 12, 2008 at 11:20 AM, Tore Darell wrote: > On Jun 13, 8:15 am, Ramon Cahenzli wrote: > > Foreero Ivan wrote: > > > Please somebody can help me , I'm new with ruby , can anybdy tell me > > > how use barby with PDF's documents ? > > > > It's not the only way, but if you're using Ruby FPDF, I've written a > > small extension that can print Barby codes into FPDF-generated PDFs: > > > Also, if you're using PDF::Writer, there's built-in support for that: > > > require 'barby' > require 'barby/outputter/pdfwriter_outputter' > > pdf = PDF::Writer.new > barcode = Barby::Code128B.new('humbaba') > barcode.annotate_pdf(pdf) > > > The CairoOutputter can generate PDFs from scratch if you for some > reason want that: > > > require 'barby/outputter/cairo_outputter' > > File.open('test.pdf'){|f| f << barcode.to_pdf } > > > In the git repo there's an experimental PrawnOutputter that can both > annotate and generate PDFs using Prawn. > > Tore > > ------=_Part_2670_26796252.1229644090873--