Ruby Ghostscript Barcode

Now on Github!
Now(after rghost version 0.8), you can easily create 32 kinds of barcode in Ruby using RGhost and Barcode Writer in Pure PostScript together in the same project rghost_barcode.

require 'rghost'
require 'rghost_barcode'
include RGhost
doc.barcode_code39('1234567', :x => 5, :y=> 10)        

After that you can convert the barcode to pdf, png, jpeg, tif and other formats or use it inside the document.


# gem install rghost
# gem install rghost_barcode      
 # gem install rghost_barcode -y      

Generate barcode catalog

 RGhost::Config.barcode_examples.render :pdf, :filename => '/tmp/barcodes.pdf'  


All barcodes will be available as the factory method of the class Document prefixed by barcode_. The following grammar is used
Document_instance.barcode_name_of_barcode(code(String), options(Hash) )

Example for PDF147 
doc.barcode_pdf147('^453^178^121^239',:columns => 2,  :rows=> 10, :text => {:size => 10})      

Supported codes

auspost, azteccode, code11, code128, code2of5, code39, code93, datamatrix, ean13, ean2, ean5, ean8, interleaved2of5, isbn, kix, maxicode, msi, onecode, pdf417, pharmacode, plessey, postnet, qrcode, rationalizedcodabar, raw, royalmail, rss14, rssexpanded, rsslimited, symbol, upca and upce.

For more details see Terry Burton page. Option details in RDOC


Terry Burton, I must admit, you are my Postscript programmer idol :)


I'm Shairon Toledo [blog, email, Brazilian community]” an organizer of symbols.