1Barcode(3) User Contributed Perl Documentation Barcode(3)
2
3
4
6 GD::Barcode - Create 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->new('EAN13', '123456789012')->plot->png;
15
16 with Error Check
17
18 my $oGdBar = GD::Barcode->new('EAN13', '12345678901');
19 die $GD::Barcode::errStr unless($oGdBar); #Invalid Length
20 $oGdBar->plot->png;
21
23 GD::Barcode is a subclass of GD and allows you to create barcode image
24 with GD. This module based on "Generate Barcode Ver 1.02 By Shisei
25 Hanai 97/08/22".
26
27 From 1.14, you can use this module even if no GD (except plot method).
28
29 new
30
31 $oGdBar = GD::Barcode::UPCE->new($sType, $sTxt);
32
33 Constructor. Creates a GD::Barcode::$sType object for $sTxt.
34
35 plot()
36
37 $oGd = $oGdBar->plot([Height => $iHeight, NoText => 0 ⎪ 1]);
38
39 creates GD object with barcode image for the $sTxt specified at new
40 method. $iHeight is height of the image. If NoText is 1, the image has
41 no text image of $sTxt.
42
43 ex.
44 my $oGdB = GD::Barcode->new('EAN13', '123456789012');
45 my $oGD = $oGdB->plot(NoText=>1, Height => 20);
46 # $sGD is a GD image with Height=>20 pixels, with no text.
47
48 barcode()
49
50 $sPtn = $oGdBar->barcode();
51
52 returns a barcode pattern in string with '1' and '0'. '1' means black,
53 '0' means white.
54
55 ex.
56 my $oGdB = GD::Barcode->new('UPCE', '123456789012');
57 my $sPtn = $oGdB->barcode();
58 # $sPtn = '';
59
60 $errStr
61
62 $GD::Barcode::errStr
63
64 has error message.
65
66 $text
67
68 $oGdBar->{$text}
69
70 has barcode text based on $sTxt specified in new method.
71
73 Kawai Takanori GCD00051@nifty.ne.jp
74
76 The GD::Barocde module is Copyright (c) 2000 Kawai Takanori. Japan.
77 All rights reserved.
78
79 You may distribute under the terms of either the GNU General Public
80 License or the Artistic License, as specified in the Perl README file.
81
83 GD GD::Barcode subclasses
84
85
86
87perl v5.8.8 2003-05-29 Barcode(3)