[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

[ANN] Barby 0.2.0

Tore Darell

7/16/2008 7:18:00 PM

Barby 0.2.0 has been released.

http://tore.darell.no/posts...
http://barby.ruby...

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/wi... which is
quite popular for mobile phone implementations and big in Japan. It
uses the excellent "RQRCode":http://rqrcode.ruby... library by
"Duncan Robertson":http://whomwah.com/2008/02/24/rqrco...
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
2 Answers

Rolando Abarca

7/16/2008 8:14:00 PM

0

On 16-07-2008, at 15:15, Tore Darell wrote:

> Barby 0.2.0 has been released.
>
> http://tore.darell.no/posts...
> http://barby.ruby...
>
> Below is a copy of the announcement from my blog.


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.

[1] http://en.wikipedia.org/w...

regards,
--
Rolando Abarca M.





Tore Darell

7/17/2008 3:58:00 PM

0

On Jul 16, 10:14 pm, Rolando Abarca <funkas...@gmail.com> wrote:
> 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