Ok so I have switched to Code39 barcodes and made the suggested changes to the code, which changes the error that now gets produced. I now get this:
PTN:000-000000:1010001110111010101000111011101010100011101110101000101 +011101110101000111011101010100011101110101010001110111010101000111011 +101010100011101110101010001110111010 Can't locate object method "Small" via package "GD::Font" (perhaps you + forgot to load "GD::Font"?) at /usr/local/share/perl5/GD/Barcode/Cod +e39.pm line 111, <> line 19.
Here is my new code:
my $oGdBar = GD::Barcode::Code39->new("$customer{id}"); if ( !$oGdBar ) { display_menu_error("ERROR: $GD::Barcode::Code39::errStr \n"); } print "PTN:", $oGdBar->{text}, ":", $oGdBar->barcode(), "\n"; my $output = '/tmp/Code39.png'; open my $OUTFILE, '>', $output; binmode $OUTFILE; print {$OUTFILE} $oGdBar->plot->png; close {$OUTFILE}; undef $oGdBar; undef $OUTFILE; undef $output; system "lpr -r $output";
As for the suggestions of changing $oGdBar->{text} to $oGdBar->{$text} does not seem to work. Does the error mean I should use GD::Font in my code or is it reffering to the module?
In reply to Re: Need some help with GD::Barcode::UPCE module
by vendion
in thread Need some help with GD::Barcode::UPCE module
by vendion
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |