|
Lines 58-63
COOP2of5
Link Here
|
| 58 |
|
58 |
|
| 59 |
If ommited,it defaults to Code39. |
59 |
If ommited,it defaults to Code39. |
| 60 |
|
60 |
|
|
|
61 |
=item I<notext> |
| 62 |
|
| 63 |
Unless I<notext=1> is specified in the parameter list, the |
| 64 |
value of the barcode will included as text below the |
| 65 |
scannable barcode. |
| 66 |
|
| 67 |
|
| 61 |
=back |
68 |
=back |
| 62 |
|
69 |
|
| 63 |
=head2 EXAMPLES |
70 |
=head2 EXAMPLES |
|
Lines 72-77
Returns a Code39 barcode image for barcode 123456789
Link Here
|
| 72 |
|
79 |
|
| 73 |
Returns a UPCE barcode image for barcode 123456789 |
80 |
Returns a UPCE barcode image for barcode 123456789 |
| 74 |
|
81 |
|
|
|
82 |
=item /cgi-bin/koha/svc/barcode?barcode=123456789¬ext=1 |
| 83 |
|
| 84 |
Returns a Code39 barcode image for barcode 123456789 |
| 85 |
which does not include the human readable text '123456789' |
| 86 |
below the scannable barcode. |
| 75 |
=cut |
87 |
=cut |
| 76 |
|
88 |
|
| 77 |
my $input = new CGI; |
89 |
my $input = new CGI; |
|
Lines 86-95
binmode(STDOUT);
Link Here
|
| 86 |
|
98 |
|
| 87 |
my $type = $input->param('type') || 'Code39'; |
99 |
my $type = $input->param('type') || 'Code39'; |
| 88 |
my $barcode = $input->param('barcode'); |
100 |
my $barcode = $input->param('barcode'); |
|
|
101 |
my $notext = $input->param('notext') ? 1 : 0; |
| 89 |
my $image; |
102 |
my $image; |
| 90 |
|
103 |
|
|
|
104 |
warn("Barcode type: '$type'"); |
| 105 |
warn("Barcode content: '$barcode'"); |
| 106 |
warn("Barcode notext: '$notext'"); |
| 107 |
warn("Barcode perl: 'GD::Barcode->new( $type, $barcode )->plot( NoText => $notext )->png();'"); |
| 108 |
|
| 91 |
eval { |
109 |
eval { |
| 92 |
$image = GD::Barcode->new( $type, $barcode )->plot()->png(); |
110 |
$image = GD::Barcode->new( $type, $barcode )->plot( NoText => $notext )->png(); |
| 93 |
}; |
111 |
}; |
| 94 |
|
112 |
|
| 95 |
if ( $@ ) { |
113 |
if ( $@ ) { |
| 96 |
- |
|
|