Bugzilla – Attachment 131026 Details for
Bug 30156
asterisk is needed before and after barcode for Code39
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Asterisk added before and after barcode
file_30156.txt (text/plain), 2.83 KB, created by
bugzilla
on 2022-02-22 19:53:23 UTC
(
hide
)
Description:
Asterisk added before and after barcode
Filename:
MIME Type:
Creator:
bugzilla
Created:
2022-02-22 19:53:23 UTC
Size:
2.83 KB
patch
obsolete
>#!/usr/bin/perl > ># Copyright 2014 ByWater Solutions ># ># This file is part of Koha. ># ># Koha is free software; you can redistribute it and/or modify it ># under the terms of the GNU General Public License as published by ># the Free Software Foundation; either version 3 of the License, or ># (at your option) any later version. ># ># Koha is distributed in the hope that it will be useful, but ># WITHOUT ANY WARRANTY; without even the implied warranty of ># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ># GNU General Public License for more details. ># ># You should have received a copy of the GNU General Public License ># along with Koha; if not, see <http://www.gnu.org/licenses>. > >use Modern::Perl; > >use CGI qw(header); >use GD::Barcode; > >use C4::Auth qw(check_cookie_auth); > >=head1 NAME > >/cgi-bin/koha/svc/barcode > >=head1 SYNOPSIS > >This service generates a PNG barcode image for the requested barcode. > >=head2 PARAMETERS > >=over > >=item I<barcode> > >I<barcode> is the desired barcode. It should be called like: > >=item I<type> > >I<type> is the desired barcode type. Possible values are >Code39 >UPCE >UPCA >QRcode >NW7 >Matrix2of5 >ITF >Industrial2of5 >IATA2of5 >EAN8 >EAN13 >COOP2of5 > >If ommited,it defaults to Code39. > >=item I<notext> > >Unless I<notext=1> is specified in the parameter list, the >value of the barcode will included as text below the >scannable barcode. > > >=back > >=head2 EXAMPLES > >=over > >=item /cgi-bin/koha/svc/barcode?barcode=123456789 > >Returns a Code39 barcode image for barcode 123456789 > >=item /cgi-bin/koha/svc/barcode?barcode=123456789&type=UPCE > >Returns a UPCE barcode image for barcode 123456789 > >=item /cgi-bin/koha/svc/barcode?barcode=123456789¬ext=1 > >Returns a Code39 barcode image for barcode 123456789 >which does not include the human readable text '123456789' >below the scannable barcode. > >=back > >=cut > >my $input = CGI->new; > >my ( $auth_status ) = check_cookie_auth( $input->cookie('CGISESSID'), { catalogue => '*' } ); > >if ( $auth_status ne "ok" ) { > exit 0; >} > >binmode(STDOUT); > >my $type = $input->param('type') || 'Code39'; >my $barcode = $input->param('barcode'); >my $notext = $input->param('notext') ? 1 : 0; >my $height = $input->param('height') || 50; >my $qrcode_modulesize = $input->param('modulesize') || "5"; # 1+ >my $image; > >eval { > if( $type eq "QRcode" ){ > $image = GD::Barcode->new('QRcode', $barcode, { Ecc => "M", ModuleSize => $qrcode_modulesize } )->plot->png(); > } else { > $image = GD::Barcode->new( $type, '*' . $barcode . '*' )->plot( NoText => $notext, Height => $height )->png(); > } >}; > >if ( $@ ) { > # problem creating image > print header( -status => 500 ); >} else { > print header('image/png'); > print $image; >} > >exit 0; > >=head1 AUTHOR > >Kyle M Hall <kyle@bywatersolutions.com> > >=cut
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 30156
: 131026