GD::Ba...e::UPCA(3pm)
π NAME π
GD::Barcode::UPCA β Create UPC-A barcode image with GD.
(Also, hi, this is the GD::Ba...e::UPCA(3pm) page β the header truncates the name like that, but it's the GD::Barcode::UPCA module, section 3pm, from User Contributed Perl Documentation. π)
β¨ SYNOPSIS β¨
okay so, CGI vibes first:
use GD::Barcode::UPCA;
binmode(STDOUT);
print "Content-Type: image/png\n\n";
print GD::Barcode::UPCA->new('12345678901')->plot->png;
and now with Error Check, because we are responsible girlies:
my $oGdBar = GD::Barcode::UPCA->new('123456789');
die $GD::Barcode::UPCA::errStr unless($oGdBar); #Invalid Length
π¦ DESCRIPTION π¦
GD::Barcode::UPCA is a subclass of GD::Barcode, and it allows you to create UPC-A barcode image with GD. This module is based on "Generate Barcode Ver 1.02 By Shisei Hanai 97/08/22". π«
π new π
$oGdBar = GD::Barcode::UPCA->new($sTxt);
Constructor, bestie. Creates a GD::Barcode::UPCA object for $sTxt. $sTxt has 11 or 12 numeric characters ([0-9]). If $sTxt has 11 characters, this module calculates CD for you. the way it just does that for u π₯Ή
π plot() π
$oGd = $oGdBar->plot([Height => $iHeight, NoText => 0 | 1]);
Creates a GD object with barcode image for the $sTxt specified at new method.
Height => $iHeightβ$iHeightis height of the image.NoText => 0 | 1β ifNoTextis1, the image has no text image of$sTxt.
ex. π
my $oGdB = GD::Barcode::UPCA->new('12345678901');
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 string with '1', 'G' and '0'. '1' means black, 'G' also means black but little bit long, '0' means white. periodt π
ex.
my $oGdB = GD::Barcode::UPCA->new('12345678901');
my $sPtn = $oGdB->barcode();
# $sPtn = '';
π $errStr π
$GD::Barcode::UPCA::errStr
has error message. that's it, that's her job. when stuff goes wrong she will tell u π
π $text π
$oGdBar->{$text}
has barcode text based on $sTxt specified in new method. iconic π₯
π AUTHOR π
Kawai Takanori GCD00051@nifty.ne.jp
πΈ COPYRIGHT πΈ
The GD::Barocde::UPCA 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
okay that's the whole page, no notes π this was perl v5.40.1, dated 2025-10-27, and it lives in the GD::Ba...e::UPCA(3pm) manual. go make some barcodes, bestie π«Άβ¨
π¦ 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