GD::Ba...e::EAN8(3pm)

πŸ’– NAME πŸ’–

okay bestie, welcome to GD::Barcode::EAN8(3pm)</p> from the User Contributed Perl Documentation β€” yes, the header calls it GD::Ba...e::EAN8(3pm)</p> because the title got squished, but it's fr fr the same page. It's giving:

GD::Barcode::EAN8 β€” Create EAN8(JAN8) barcode image with GD 🌈


✨ SYNOPSIS ✨

ex. CGI

use GD::Barcode::EAN8;
binmode(STDOUT);
print "Content-Type: image/png\n\n";
print GD::Barcode::EAN8->new('1234567')->plot->png;

with Error Check

my $oGdBar = GD::Barcode::EAN8->new('123456789');
die $GD::Barcode::EAN8::errStr unless($oGdBar);       #Invalid Length
bestie notice how that error-checking one is tryna build from '123456789'… bestie that is 9 characters and that is literally why the #Invalid Length comment is sitting right there πŸ’€ the die is doing its job.

πŸ¦‹ DESCRIPTION πŸ¦‹

GD::Barcode::EAN8</p> is a subclass of GD::Barcode</p> and it lets you create EAN8(JAN8) barcode images with GD. No cap, it does the whole thing for you. πŸŽ€

This module is based on "Generate Barcode Ver 1.02 By Shisei Hanai 97/08/22" β€” shoutout to the origin, periodt. πŸ‘‘


🌟 new 🌟

$oGdBar = GD::Barcode::EAN8->new($sTxt);

Constructor energy. ✨ This creates a GD::Barcode::EAN8 object for $sTxt.

$sTxt has 7 or 8 numeric characters ([0-9]). And if $sTxt has 12 characters, this module calacurates CD for you. πŸ’…


🌸 plot() 🌸

$oGd = $oGdBar->plot([Height => $iHeight, NoText => 0 | 1]);

This one creates a GD object with the barcode image for the $sTxt you specified in the new method. πŸ–ΌοΈ

  • $iHeight is the height of the image.
  • If NoText is 1, the image has no text image of $sTxt.

ex.

my $oGdB = GD::Barcode::EAN8->new('1234567');
my $oGD = $oGdB->plot(NoText=>1, Height => 20);
# $sGD is a GD image with Height=>20 pixels, with no text.
bestie the comment says $sGD but the variable up top is $oGD β€” not me noticing, iykyk, i'm just saying it out loud and staying out of it πŸ™ˆ

πŸŽ€ barcode() πŸŽ€

$sPtn = $oGdBar->barcode();

Returns a barcode pattern in a string made of '1', 'G' and '0'. Here's the tea: πŸ“

  • '1' means black
  • 'G' also means black but a little bit long πŸ‘€
  • '0' means white

ex.

my $oGdB = GD::Barcode::EAN8->new('1234567');
my $sPtn = $oGdB->barcode();
# $sPtn = '';

🧚 $errStr 🧚

$GD::Barcode::EAN8::errStr

This one has the error message. Yes, it's a package variable, yes you check it when new fails, no we don't make the rules. πŸ’œ


⭐ $text ⭐

$oGdBar->{$text}

This one has the barcode text based on the $sTxt you specified in the new method. ✨


πŸ‘‘ AUTHOR πŸ‘‘

Kawai Takanori GCD00051@nifty.ne.jp β€” iconic, we thank them for their service 🫢


The GD::Barocde::EAN8</p> module is Copyright (c) 2000 Kawai Takanori. Japan. All rights reserved.

You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file. πŸ“œ


πŸ”₯ SEE ALSO πŸ”₯

  • GD::Barcode</p>

aaaaand that's the whole thing bestie, you ate it, no crumbs. πŸ“βœ¨ This page ships with perl v5.40.1 and is dated 2025-10-27 β€” so go make some barcodes, you absolute main character. πŸ’…πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from