[Koha-cvs] koha/barcodes barcodesGenerator.pl pdfViewer.pl [rel_2_2]
MJR
mjr at towers.org.uk
Mon Aug 6 13:13:38 CEST 2007
CVSROOT: /sources/koha
Module name: koha
Branch: rel_2_2
Changes by: MJR <slef> 07/08/06 11:13:38
Modified files:
barcodes : barcodesGenerator.pl pdfViewer.pl
Log message:
Upload barcodefix (use more recent PDF::API2)
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/barcodes/barcodesGenerator.pl?cvsroot=koha&only_with_tag=rel_2_2&r1=1.4.2.1&r2=1.4.2.2
http://cvs.savannah.gnu.org/viewcvs/koha/barcodes/pdfViewer.pl?cvsroot=koha&only_with_tag=rel_2_2&r1=1.2.2.2&r2=1.2.2.3
Patches:
Index: barcodesGenerator.pl
===================================================================
RCS file: /sources/koha/koha/barcodes/barcodesGenerator.pl,v
retrieving revision 1.4.2.1
retrieving revision 1.4.2.2
diff -u -b -r1.4.2.1 -r1.4.2.2
--- barcodesGenerator.pl 16 Jul 2007 21:17:10 -0000 1.4.2.1
+++ barcodesGenerator.pl 6 Aug 2007 11:13:37 -0000 1.4.2.2
@@ -3,7 +3,7 @@
# script to generate items barcodes
# written 07/04
# by Veleda Matias - matias_veleda at hotmail.com - Physics Library UNLP Argentina and
-# Castañeda Sebastian - seba3c at yahoo.com.ar - Physics Library UNLP Argentina and
+# CastaÂeda Sebastian - seba3c at yahoo.com.ar - Physics Library UNLP Argentina and
# This file is part of Koha.
#
@@ -30,7 +30,7 @@
use HTML::Template;
use PDF::API2;
use PDF::API2::Page;
-use PDF::API2::PDF::Utils;
+use PDF::API2::Basic::PDF::Utils;
use C4::Barcodes::PrinterConfig;
use Time::localtime;
@@ -160,7 +160,7 @@
my $tmpFileName = &assingFilename( $from, $to );
if ( $rangeType eq 'continuous2' ) {
- # Set the temp directory for pdf´s files
+ # Set the temp directory for pdfÂs files
if ( !defined( $ENV{'TEMP'} ) ) {
$ENV{'TEMP'} = '/tmp/';
}
@@ -190,9 +190,8 @@
my $codeC = &checksum($code);
# Generate the corresponde barcode to $code
- my $barcode = $pdf->barcode(
+ my $barcode = $pdf->xo_code128(
-font => $tr, # The font object to use
- -type => 'ean128', # Standard of codification
-code => $codeC, # Text to codify
-extn => '012345', # Barcode extension (if it is aplicable)
-umzn => 10, # Top limit of the finished bar
@@ -209,8 +208,7 @@
$page, $gfx, $text, $tr, $pageType );
# Assigns a barcodes to $gfx
- $gfx->barcode( $barcode, $x, $y,
- ( 72 / $labelConfig{'systemDpi'} ) );
+ $gfx->formimage($barcode, $x, $y , (72/$labelConfig{'systemDpi'}));
# Assigns the additional information to the barcode (Legend)
$text->translate( $x - 48, $y - 22 );
@@ -253,7 +251,7 @@
# Executes the query
$sth->execute;
if ( $sth->rows ) { # There are inventary codes
- # Set the temp directory for pdf´s files
+ # Set the temp directory for pdfÂs files
if ( !defined( $ENV{'TEMP'} ) ) {
$ENV{'TEMP'} = '/tmp/';
}
@@ -286,9 +284,8 @@
$code = &checksum($code);
# Generate the corresponde barcode to $code
- my $barcode = $pdf->barcode(
+ my $barcode = $pdf->xo_ean13(
-font => $tr, # The font object to use
- -type => 'ean13', # Standard of codification
-code => $code, # Text to codify
-extn => '012345', # Barcode extension (if it is aplicable)
-umzn => 10, # Top limit of the finished bar
@@ -305,8 +302,7 @@
$page, $gfx, $text, $tr, $pageType );
# Assigns a barcodes to $gfx
- $gfx->barcode( $barcode, $x, $y,
- ( 72 / $labelConfig{'systemDpi'} ) );
+ $gfx->formimage($barcode, $x, $y , (72/$labelConfig{'systemDpi'}));
# Assigns the additional information to the barcode (Legend)
$text->translate( $x - 48, $y - 22 );
Index: pdfViewer.pl
===================================================================
RCS file: /sources/koha/koha/barcodes/pdfViewer.pl,v
retrieving revision 1.2.2.2
retrieving revision 1.2.2.3
diff -u -b -r1.2.2.2 -r1.2.2.3
--- pdfViewer.pl 16 Jul 2007 21:17:11 -0000 1.2.2.2
+++ pdfViewer.pl 6 Aug 2007 11:13:37 -0000 1.2.2.3
@@ -3,7 +3,7 @@
# script to show a PDF file.
# written 07/04
# by Veleda Matias - matias_veleda at hotmail.com - Physics Library UNLP Argentina and
-# Castañeda Sebastian - seba3c at yahoo.com.ar - Physics Library UNLP Argentina and
+# CastaÂeda Sebastian - seba3c at yahoo.com.ar - Physics Library UNLP Argentina and
# This file is part of Koha.
#
@@ -30,9 +30,8 @@
my $cgi = new CGI;
my $filename = "barcodes.pdf";
my $tmpFileName = $cgi->param('tmpFileName');
-print "Content-Disposition: attachment; filename = $filename\n\n";
-print $cgi->header( -type => 'application/pdf' ),
- $cgi->start_html( -title => "Codify to PDF" );
+print "Content-Disposition: attachment; filename = $filename\n";
+print $cgi->header( -type => 'application/pdf' );
open fh, "<$tmpFileName";
while (<fh>) {
print;
More information about the Koha-cvs
mailing list