Plugins - Barcode Generator
Add to favoritesBarcode Generator - ReDux
Barcode generator makes generating/displaying bar-codes for certain alphanumeric ids a piece of cake.
It uses Gbarcode for encoding barcode data and then Rmagick to generate images out of it for displaying in views.
This way we can generate any barcode type which Gbarcode -> Gnome Barcode project supports.
USAGE
its as simple as saying
<%= barcode ‘FJJ4JD’%>
This will generate a barcode for FJJ4JD in BARCODE_39 format with default width and height and include it in the view. the images are stored in /public/images/barcodes subdir.
Options Options Options ..
to customize your barcodes, you can optionally pass following information in your views
* encoding_format (Gbarcode constants for eg. Gbarcode::BARCODE_128 etc..) * width * height * scaling_factor * xoff * yoff * margin
in this case your view will look like :
<%= barcode ‘ANUJ’, :height => 100,
:width => 400,
:margin => 100,
:xoff => 20,
:yoff => 40
%>
Installation
install from svn :
script/plugin install http://barcode-generator.googlecode.com/svn/trunk/barcode_generator
make sure that you install gems for rmagick and gbarcode first!!!
and then run the rake task : rake barcode_setup
http://code.google.com/p/barcode-generator/
http://barcode-generator.googlecode.com/svn/trunk/
GPL
View Extensions

Hi Anju, Thanks for taking the time to make this plugin. I know that for some folks, RMagick is not a nice option, so I developed a small wrapper that uses Cairo instead. Please see my blog post here for details:
http://defsci.blogspot.com/2007/10/easy-gbarcode.html
there is more information on the project website.
For eg. if you want to use base 128 encoding, you would write something like this in your view:
<%= barcode "test123", :encodingformat => Gbarcode::BARCODE128 %>
You can choose which ever encoding format you like (and is supported by GBarcode), and pass it to the helper as a GBarcode constant.
it works fine when using the default encoding, but I can't seem to change it.. and I don't seem to get any clues in the logs as to why. Can I get an example of what a tamplate tag would look like that selects the encoding?
It works, but it hang on second run. you know why?
its "rake barcode_setup"
i was tring to do rake barcodegenerator and it says do't know how to build barcodegenerator