The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Catalyst::View::GD::Barcode - make it easy to use GD::Barcode in Catalyst's View

SYNOPSIS

Set string to be converted to barcode.

 $c->stash->{'barcode_string'} = '123456';

Set barcode type. The default is 'NW7'.

 $c->stash->{'barcode_type'} = 'NW7';

 COOP2of5 | Code39 | EAN13 | EAN8 | IATA2of5 | ITF | Industrial2of5 | Matrix2of5 | NW7 | QRcode 

Set barcode size option.

 $c->stash->{'barcode_size'} = 10;

 When the number of digit is insufficient, it buries by 0.

Set content type option. The default is 'png'.

 $c->stash->{'content_type'} = 'png';

 png | gif | jpeg 

Set any other GD::Barcode options.

 $c->stash->{'barcode_option'} = {NoText => 1}

Print the barcode.

 $c->forward('Catalyst::View::GD::Barcode');

METHODS

gen_barcoed

Generate barcode using GD::Barcode. You only need to set string and barcode type and no need to bother anything else. If it fails, it returns the string in plain text.

process

Set code in $c->res->body().

calc_checkdigit

Returns the calculated check digit.

SEE ALSO

Catalyst

AUTHOR

Toshimitu Yanagisawa, yanagisawa@shanon.co.jp

COPYRIGHT AND LICENSE

This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.