Plugins - Barcode Generator

StarAdd to favorites

Barcode 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

Anuj Luthra

http://code.google.com/p/barcode-generator/

http://barcode-generator.googlecode.com/svn/trunk/

GPL

  • Currently 3.9/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

View Extensions

Tags

Comments

Add a comment
angel 10 Oct 2007

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

anuj 29 Sep 2007

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.

John 21 Sep 2007

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?

paul chin 6 Aug 2007

It works, but it hang on second run. you know why?

anuj 21 Jul 2007

its "rake barcode_setup"

mike 18 Jul 2007

i was tring to do rake barcodegenerator and it says do't know how to build barcodegenerator

Search Plugins

Query syntax

Plugins by Category

Sponsors

Rails Kits: Get Code. Get Moving.

Have a comment?