koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-cvs] koha/barcodes label-print-pdf-demco-142-1685c.pl [dev_week]


From: Mason James
Subject: [Koha-cvs] koha/barcodes label-print-pdf-demco-142-1685c.pl [dev_week]
Date: Tue, 30 Oct 2007 11:24:56 +0000

CVSROOT:        /sources/koha
Module name:    koha
Branch:         dev_week
Changes by:     Mason James <sushi>     07/10/30 11:24:56

Modified files:
        barcodes       : label-print-pdf-demco-142-1685c.pl 

Log message:
        demco-label template now takes starting label value.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/barcodes/label-print-pdf-demco-142-1685c.pl?cvsroot=koha&only_with_tag=dev_week&r1=1.1.2.3&r2=1.1.2.4

Patches:
Index: label-print-pdf-demco-142-1685c.pl
===================================================================
RCS file: /sources/koha/koha/barcodes/Attic/label-print-pdf-demco-142-1685c.pl,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -b -r1.1.2.3 -r1.1.2.4
--- label-print-pdf-demco-142-1685c.pl  22 Oct 2007 03:22:35 -0000      1.1.2.3
+++ label-print-pdf-demco-142-1685c.pl  30 Oct 2007 11:24:56 -0000      1.1.2.4
@@ -12,7 +12,7 @@
 use PDF::Reuse::Barcode;
 use POSIX;
 
-#use Smart::Comments '#####';
+# use Smart::Comments '####';
 
 my $htdocs_path = C4::Context->config('intrahtdocs');
 my $cgi         = new CGI;
@@ -96,8 +96,8 @@
 
 my ( $rowcount, $colcount, $x_pos, $y_pos, $rowtemp, $coltemp );
 
-$start_label = 1;    ## debug...................................
 
+#-- calculate x,y coords of 1st label
 if ( $start_label eq 1 ) {
     $rowcount = 1;
     $colcount = 1;
@@ -115,14 +115,18 @@
 
     $colcount = ( $start_label - ( ( $rowcount - 1 ) * $block_cols ) );
 
-    $x_pos = $left_margin + ( $label_width * ( $colcount - 1 ) ) +
+    $x_pos = $left_margin + ( ($spine_width + $colspace + $label_width) * ( 
$colcount - 1 ) ) +
       ( $colspace * ( $colcount - 1 ) );
 
     $y_pos = $page_height - $top_margin - ( $block_height * $rowcount ) -
       ( $rowspace * ( $rowcount - 1 ) );
 
+    # this fixes a goofy off-by-one-pixel error,
+    # if the labels starts in the 2nd column
+    $x_pos-- if $colcount == 2; 
 }
 
+
 #
 #    main foreach loop
 #
@@ -130,6 +134,7 @@
 # $barcodetype = "CODE39MOD10";
 
 my $gutter = 2;
+my $i;
 
 foreach $item (@resultsloop) {
     my $barcode = $item->{'barcode'};
@@ -152,7 +157,7 @@
 
     my $fontsize = 10;
 
-    #    warn "$x_pos, $y_pos, $label_width, $label_height";
+        warn "$x_pos, $y_pos, $label_width, $label_height";
     my $barcode = $item->{'barcode'};
 
     #    drawbox( $x_pos, $y_pos, $block_width, $block_height, ) if $guidebox;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]