[ANN] Barby 0.2.0

T

Tore Darell

Barby 0.2.0 has been released.

http://tore.darell.no/posts/barby_0_2
http://barby.rubyforge.org/

Below is a copy of the announcement from my blog.



Barby 0.2 has support for two-dimensional barcodes, and all existing
outputters have been updated to work with 2D. The first supported 2D
symbology is "QR Code":http://en.wikipedia.org/wiki/QR_Code which is
quite popular for mobile phone implementations and big in Japan. It
uses the excellent "RQRCode":http://rqrcode.rubyforge.org/ library by
"Duncan Robertson":http://whomwah.com/2008/02/24/rqrcode-a-ruby-
library-for-encoding-qr-codes.


require 'barby'
require 'barby/outputter/png_outputter'

qrcode = Barby::QrCode.new('2D power')

File.open('qrcode.png', 'w') do |f|
f << qrcode.to_png
end


To update or install:


sudo gem install barby


The implementation of 2D support is pretty simple: 2D barcodes are
considered to be 1D barcodes on top of each other. So if you're
writing a class for a 2D symbology, the difference is that your
@encoding@ method must return an array of strings instead if a single
string:


class My2DBarcode < Barby::Barcode2D

def endoding
['010011', '011001', '110001']
end

end


If you're writing an outputter that is capable of handling 2D
barcodes, you just have to keep this in mind. You can use the
@two_dimensional?@ method to check if a barcode is 2D:


class MyOutputter < Barby::Outputter

def to_something
if barcode.two_dimensional?
encoding.inject(""){|s,line| s + do_something_with(line) }
else
do_something_with(encoding)
end
end

end
 
T

Tore Darell

hi,
are you planning to support pdf417[1]? if so, maybe I can give you a  
hand, since I'm already needing something like that.

Hi Rolando,

Yes, the plan is to support as many symbologies as possible, but it's
proven much more difficult to find decent specs for any of the 2D
barcodes than I thought it would be.. If you want to help with PDF417,
that'd be great.

Tore
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,739
Latest member
Clint8040

Latest Threads

Top