in reply to Re^2: Need some help with GD::Barcode::UPCE module
in thread Need some help with GD::Barcode::UPCE module

Even after changing my $oGdBar = GD::Barcode::Code39->new() to my $oGdBar = GD::Barcode->new() I still get the same error. I checked to make sure my GD::Barcode module is current and CPAN says I have version 1.15 installed

Replies are listed 'Best First'.
Re^4: Need some help with GD::Barcode::UPCE module
by Khen1950fx (Canon) on Oct 11, 2010 at 19:36 UTC
    You still get the same error because you're still making the same mistake:). You'll need to change more than just new(). Post what you have now, then we can figure out what's wrong.

      Ok well there is what I have currently

      #!/usr/bin/perl use strict; use warnings; use GD::Barcode::Code39; my $oGdBar = GD::Barcode->new('Code39', "*$customer{id}*"); #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"; #FIXME prints out error "Can't locate object method "Small" via packag +e "GD::Font" (perhaps you forgot #to load "GD::Font"?) at /usr/local/share/perl5/GD/Barcode/Code39.pm l +ine 111, <> line 19." 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";

      Not sure what mistake it is I am making here, I thought I followed the documentation to the letter. Ether way the barcode is being generated I can tell this because of the output from $oGdBar->barcode(), but the /tmp/Code39.png file is empty.

        Try adding use GD; at the top of your script? Won't fix the problem.