Sneaky Abstractions

Subscribe to my Feed, follow me on , recommend me on Working With Rails or see my code on GitHub

Barby 0.3: Ruby 1.9 compatible and pure-ruby SVG outputter

Posted on May 25, 2009 15:31, 6 comments. Tagged with barby, ruby, barcodes.

I just tagged and released version 0.3.0 of Barby, the simple, extensible and generally awesome Ruby library for generating barcodes. Besides a number of minor additions, 0.3.0 features Ruby 1.9 compatibility (mostly by Chris Mowforth) and a brand new SVG outputter by Peter H. Li. You could create SVGs with Barby in previous versions too, but only by using the rather heavy Cairo graphics rendering library (which makes up for its heaviness with its versatility). Peter’s outputter is pure Ruby without any dependencies at all, making it easier to get going if all you need is SVG.

As soon as the gems hit Rubyforge, you can install the new version using the gem command:

[sudo] gem install barby

As always, if there’s something you would like to see added to or fixed in Barby, it’s open source ;) Especially if you have knowledge of barcode symbologies or formats to which barcodes can be exported, that’d be great. Barby is designed to be very extensible to make it easy to add these things.

Comments

Atom feed

By John Bascoe at

Hi, thank you for Barby. I tried the previous version, but I wasn’t able to find out if there is a method to write the actual numbers of the Barcode into the image as well? Like in this example:

http://i.d.com.com/i/dl/media/dlimage/14/18/92/141892_large.jpeg

That is definitely something I would like to request in order to use Barby. It’s necessary to later identify the code just by looking at the image.

Thank you! John

By tore.darell.no at

John: To keep things simple Barby’s outputters only focus on generating the barcode itself without any extra data, and I don’t think this is something that should be included by default in the future. But you can access all the relevant data on the barcode object and add those to the barcode image after it’s been generated. With the RMagick outputter you can use to_image to get an editable image which you can superimpose the numbers on. When it comes to the EAN-13 barcodes they’re a little weird (which is one of the reasons I don’t think there should be a general solution for this), but I guess you can use a white background to hide the bars behind the numbers.

Another reason Barby does not include this data in the image is that sometimes you work with a medium (e.g. HTML, PDF) which is ideally suited to contain that data in text form.

By John Bascoe at

Hi Tore,

thank you for your reply. I don’t agree though, I think outputting just the bars is non-standard. I will try to branch it when I have a minute and report back.

Thank you John

By Promotional gifts at

Its wonderful idea to be discussed.

By خطة عمل at

That is definitely something I would like to request in order to use Barby. It’s necessary to later identify the code just by looking at the image.

By CRM at

version 0.3.0 of Barby looks to be very interesting to watch its development

Leave a comment

OpenID

Or..

Old school

Search out the door of Namtara. Bring a baked loaf into his presence.