1Barcode::UPCE(3) User Contributed Perl Documentation Barcode::UPCE(3)
2
3
4
6 GD::Barcode::UPCE - Create UPC-E barcode image with GD
7
9 ex. CGI
10
11 use GD::Barcode::UPCE;
12 binmode(STDOUT);
13 print "Content-Type: image/png\n\n";
14 print GD::Barcode::UPCE->new('123456')->plot->png;
15
16 with Error Check
17
18 my $oGdBar = GD::Barcode::UPCE->new('123456789');
19 die $GD::Barcode::UPCE::errStr unless($oGdBar); #Invalid Length
20
22 GD::Barcode::UPCE is a subclass of GD::Barcode and allows you to create
23 UPC-E barcode image with GD. This module based on "Generate Barcode
24 Ver 1.02 By Shisei Hanai 97/08/22".
25
26 new
27 $oGdBar = GD::Barcode::UPCE->new($sTxt);
28
29 Constructor. Creates a GD::Barcode::UPCE object for $sTxt. $sTxt has
30 6 or 7 or 8 numeric characters([0-9]). If $sTxt has 6 characters, this
31 module adds '0' at the front of $sTxt. and calculates CD for you. If
32 $sTxt has 7 characters, this module calaculates CD for you.
33
34 plot()
35 $oGd = $oGdBar->plot([Height => $iHeight, NoText => 0 | 1]);
36
37 creates GD object with barcode image for the $sTxt specified at new
38 method. $iHeight is height of the image. If NoText is 1, the image has
39 no text image of $sTxt.
40
41 ex.
42 my $oGdB = GD::Barcode::UPCE->new('123456');
43 my $oGD = $oGdB->plot(NoText=>1, Height => 20);
44 # $sGD is a GD image with Height=>20 pixels, with no text.
45
46 barcode()
47 $sPtn = $oGdBar->barcode();
48
49 returns a barcode pattern in string with '1', 'G' and '0'. '1' means
50 black, 'G' also means black but little bit long, '0' means white.
51
52 ex.
53 my $oGdB = GD::Barcode::UPCE->new('123456');
54 my $sPtn = $oGdB->barcode();
55 # $sPtn = '';
56
57 $errStr
58 $GD::Barcode::UPCE::errStr
59
60 has error message.
61
62 $text
63 $oGdBar->{$text}
64
65 has barcode text based on $sTxt specified in new method.
66
68 Kawai Takanori GCD00051@nifty.ne.jp
69
71 The GD::Barocde::UPCE module is Copyright (c) 2000 Kawai Takanori.
72 Japan. All rights reserved.
73
74 You may distribute under the terms of either the GNU General Public
75 License or the Artistic License, as specified in the Perl README file.
76
78 GD::Barcode
79
80
81
82perl v5.28.0 2003-05-29 Barcode::UPCE(3)