GD::Ba...rix2of5(3pm)

πŸ’– GD::Barcode::Matrix2of5(3pm) β€” User Contributed Perl Documentation πŸ’–

okay bestie, sit down, hydrate, and let me tell you about GD::Barcode::Matrix2of5 β€” she's a Perl module from the User Contributed Perl Documentation collection and she makes Matrix2of5 barcodes like it's nothing. no cap. πŸ¦‹


✨ NAME ✨

GD::Barcode::Matrix2of5 β€” Create Matrix2of5 barcode image with GD

like, that's the whole assignment. make the barcode. serve the image. periodt. πŸ’…


🌸 SYNOPSIS 🌸

ex. CGI

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

you can literally do it in a one-liner-ish chain and she delivers a PNG. iconic behavior. 🫢

with Error Check

my $oGdBar = GD::Barcode::Matrix2of5->new('A12345678');
die $GD::Barcode::Matrix2of5::errStr unless($oGdBar); #Invalid Characters
$oGdBar->plot->png;

okay so notice the A in there β€” that's not it, bestie 😭 she only takes digits, and the die is your safety net for when the input is giving invalid characters energy.


✨ DESCRIPTION ✨

GD::Barcode::Matrix2of5 is a subclass of GD::Barcode and she lets you create Matrix2of5 barcode images with GD. that's her whole thing and she eats every time. πŸ”₯

πŸŽ€ new πŸŽ€

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

Constructor energy. Creates a GD::Barcode::Matrix2of5 object for $sTxt. and $sTxt? numeric characters only, like [0-9]. no letters, no vibes-based input, just numbers please and thank you. πŸ’œ

πŸ¦‹ plot() πŸ¦‹

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

creates a GD object with the barcode image for the $sTxt you specified back in the new method. $iHeight is the height of the image β€” you're literally picking how tall she stands. If NoText is 1, the image has no text image of $sTxt. so like, bars only, no caption. minimalist. πŸ’…

ex.

my $oGdB = GD::Barcode::Matrix2of5->new('12345678');
my $oGD = $oGdB->plot(NoText=>1, Height => 20);
# $sGD is a GD image with Height=>20 pixels, with no text.

so $sGD there is a GD image with Height=>20 pixels, with no text. that's it, that's the vibe check. βœ…

🌈 barcode() 🌈

$sPtn = $oGdBar->barcode();

returns a barcode pattern in a string made of '1' and '0'. '1' means black, '0' means white. raw pattern reveal, no filter. ⭐

ex.

my $oGdB = GD::Barcode::Matrix2of5->new('12345678');
my $sPtn = $oGdB->barcode();

πŸ’€ $errStr πŸ’€

$GD::Barcode::Matrix2of5::errStr

has the error message. when things go wrong she will tell you why, and honestly the communication skills? unmatched. πŸ™ˆ

πŸ“ $text πŸ“

$oGdBar->{$text}

has barcode text based on the $sTxt you specified in the new method. so if you fed her '12345678', that's what lives in there. main character data storage. πŸ‘‘


πŸ’– AUTHOR πŸ’–

Kawai Takanori GCD00051@nifty.ne.jp


The GD::Barocde::Matrix2of5 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.

(yes, the module name is spelled exactly like that up there β€” GD::Barocde::Matrix2of5 β€” we are not touching it, we respect the original. πŸ™)

🌟 SEE ALSO 🌟

  • GD::Barcode β€” the parent class, go say hi to her too 🫢

and that's the whole page bestie, no notes. this doc was served up by perl v5.40.1, dated 2025-10-27 β€” so yeah, she's recent, she's cute, she's maintained. go forth and print barcodes. slay. πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from