GD::Ba...OOP2of5(3pm)
β¨ GD::Barcode::COOP2of5 β¨
okay bestie, so this page is literally GD::Barcode::COOP2of5(3pm) β a Perl module page, user-contributed docs vibe, and it's about making COOP2of5 barcode pics with GD. no cap, it's shorter than my patience for group projects, so let's get into it π
πΈ NAME πΈ
GD::Barcode::COOP2of5 β create a COOP2of5 barcode image with GD π
π¦ SYNOPSIS π¦
example: CGI, the classic
use GD::Barcode::COOP2of5;
binmode(STDOUT);
print "Content-Type: image/png\n\n";
print GD::Barcode::COOP2of5->new('1234567890')->plot->png;
and the version with error checking, because we're responsible girlies:
my $oGdBar = GD::Barcode::COOP2of5->new('A12345678');
die $GD::Barcode::COOP2of5::errStr unless($oGdBar); #Invalid Characters
$oGdBar->plot->png;
π DESCRIPTION π
GD::Barcode::COOP2of5 is a subclass of GD::Barcode, and what it does is let you create a COOP2of5 barcode image with GD. that's the whole assignment and it ate. π
π new π
$oGdBar = GD::Barcode::COOP2of5->new($sTxt);
this is the constructor, the main character moment where the object gets made π« it creates a GD::Barcode::COOP2of5 object for $sTxt. and heads up: $sTxt has numeric characters ([0-9]). that's the only kind of character it's accepting, no exceptions, periodt.
π«Ά plot() π«Ά
$oGd = $oGdBar->plot([Height => $iHeight, NoText => 0 | 1]);
this one creates a GD object that has the barcode image for the $sTxt you specified back at the new method. $iHeight is the height of the image. and if NoText is 1, then the image has no text image of $sTxt β like, the barcode is there, the words are not, iconic honestly.
ex.
my $oGdB = GD::Barcode::COOP2of5->new('12345678');
my $oGD = $oGdB->plot(NoText=>1, Height => 20);
# $sGD is a GD image with Height=>20 pixels, with no text.
π barcode() π
$sPtn = $oGdBar->barcode();
returns a barcode pattern in a string, made of '1' and '0'. '1' means black, '0' means white. that's it, that's the lore π€π€
ex.
my $oGdB = GD::Barcode::COOP2of5->new('12345678');
my $sPtn = $oGdB->barcode();
π $errStr π
$GD::Barcode::COOP2of5::errStr
this one has the error message. so if something goes sideways, this is who tells you the tea π
β $text β
$oGdBar->{$text}
this has the barcode text, based on the $sTxt you specified in the new method. lowkey handy.
π AUTHOR π
Kawai Takanori GCD00051@nifty.ne.jp
π COPYRIGHT π
The GD::Barocde::COOP2of5 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
k that's the whole page bestie, go make some barcodes π§β¨ and for the record this was perl v5.40.1, dated 2025-10-27 β mwah, bye π π
π¦ where this page comes from
- ubuntu resolute: libgd-barcode-perl 2.02-1 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- ubuntu stonking: libgd-barcode-perl 2.02-1 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms