Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

error message from GD::Barcode::Code39 module

by giobis (Acolyte)
on Oct 23, 2006 at 13:21 UTC ( [id://580024]=perlquestion: print w/replies, xml ) Need Help??

giobis has asked for the wisdom of the Perl Monks concerning the following question:

Hi you all, I've one question aboute to Generation of Barcode 39 with GD::Barcode::Code39 module. I used this script but it doesn't work :
#!/bin/perl -w use GD::Barcode::Code39; binmode(STDOUT); print "Content-Type: image/png\n\n"; print GD::Barcode::Code39->new('*CODE39IMG*')->plot->png; my $oGdBar = GD::Barcode::Code39->new('*123456789;*'); die $GD::Barcode::Code39::errStr unless($oGdBar); #Invalid Chara +cters

And I received this error Msg :

Can't locate object method "Small" via package "GD::Font" (perhaps you forgot to load "GD::Font"?) at /opt/perl/lib/site_perl/5.8.0/GD/Barcode/Code39.pm line 111.

My PERL version is v5.8.0 built for PA-RISC1.1-thread-multi I try to find GD::Font but I don't founded it. Any suggestion? Thanks giobis

2006-10-25 Retitled by Corion, as per Monastery guidelines
Original title: 'GD-Barcode 39'

Replies are listed 'Best First'.
Re: error message from GD::Barcode::Code39 module
by ww (Archbishop) on Oct 23, 2006 at 13:35 UTC

    I think you'll find that the error message means just what it says...
    and that you'll need to make-install GD::Font.

    You may find essentially this answer, phrased as a description of a dependancy, in the GD::Barcode::Code39 pos

    Generally, I think you'll find perl's error messages fairly straight forward... despite the fact that some are a ...er ...ah... um, a tad arcane.

      I see the 111 row and this is the code
      else { my($fW,$fH) = (GD::Font->Small->width, GD::Font->Small->height +); my $iWidth = length($sPtn); #Bar Image ($oGd, $cBlack) = GD::Barcode::plot($sPtn, $iWidth, $iHeight, +$fH, 0); #String $oGd->string(GD::Font->Small, (length($sPtn)-$fW*(length($sTxt +Wk)))/2, $iHeight - $fH, $sTxtWk, $cBlack); }
      As you see on code there is a GD::Font setting. Is for this question wich I search GD::Font module, but I doesn't exist on CPAN site. :(
        At that point, Google is your friend:
        Module Gd.Font ( http://gushee.net/matt/software/gd4o/doc/Gd.Font.html )

        and -- as alternates -- read "GD::Text" (UWinnipeg) and "GD::Simple" (CPAN, Lincoln Stein) UpdateThanks, monarch, for noting bad link...
              but :-( after chasing the "gushee.net" links, I'm not so sure it's useful!
Re: error message from GD::Barcode::Code39 module
by ChemBoy (Priest) on Oct 23, 2006 at 14:31 UTC

    This is an odd error message, since GD::Font is in fact almost certainly already installed on your system. From the GD documentation:

    GD defines the following four classes:

    GD::Image
    An image class, which holds the image data and accepts graphic primitive method calls.
    GD::Font
    A font class, which holds static font information and used for text rendering.
    GD::Polygon
    A simple polygon object, used for storing lists of vertices prior to rendering a polygon into an image.
    GD::Simple
    A "simple" class that simplifies the GD::Image API and then adds a set of object-oriented drawing methods using turtle graphics, simplified font handling, ability to work in polar coordinates, HSV color spaces, and human-readable color names like "lightblue". Please see GD::Simple for a description of these methods.

    This implies that either GD is not being loaded correctly (or not in time), or you have a severely broken and/or ancient installation of it. Since the first of those is much easier to correct than the second, you should probably try fixing it first: simply add use GD; to the beginning of your program, and see if your troubles continue (or change to the unpleasant Can't locate GD.pm in @INC). If they do, consider upgrading your GD install.



    If God had meant us to fly, he would *never* have given us the railroads.
        --Michael Flanders

      Thank you ALL,
      
        I've resolved my problem. 
      
      I've installed the GD module and now it Work very well.
      
      Many Thanks
      Joe
      
        Oops...
        
        The solution :
        
        URL : http://www.giobis.it/cgi-bin/ean1.pl?codice=520366500186
        

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://580024]
Approved by ww
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2024-04-19 01:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found