[Koha-cvs] koha/barcodes label-printf-pdf.pl [dev_week]

Mason James szrj1m at yahoo.com
Tue Aug 28 13:25:53 CEST 2007


CVSROOT:	/sources/koha
Module name:	koha
Branch:		dev_week
Changes by:	Mason James <sushi>	07/08/28 11:25:53

Modified files:
	barcodes       : label-printf-pdf.pl 

Log message:
	now has correct A4 'c' dimensions.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/barcodes/label-printf-pdf.pl?cvsroot=koha&only_with_tag=dev_week&r1=1.1.2.5&r2=1.1.2.6

Patches:
Index: label-printf-pdf.pl
===================================================================
RCS file: /sources/koha/koha/barcodes/Attic/label-printf-pdf.pl,v
retrieving revision 1.1.2.5
retrieving revision 1.1.2.6
diff -u -b -r1.1.2.5 -r1.1.2.6
--- label-printf-pdf.pl	28 Aug 2007 02:26:24 -0000	1.1.2.5
+++ label-printf-pdf.pl	28 Aug 2007 11:25:52 -0000	1.1.2.6
@@ -40,22 +40,22 @@
 my $tmpl_code = $template->{'tmpl_code'};
 my $tmpl_desc = $template->{'tmpl_desc'};
 
-my $page_height = 230;
-my $page_width  = 210;
+my $page_height = 792;
+my $page_width  = 612;
 
-my $block_height = 40;
-my $block_width  = 90;
+my $block_height = 144;
+my $block_width  = 272;
 
-my $label_height = 20;
-my $label_width  = 60;
+my $label_height = 72;
+my $label_width  = 196;
 
-my $spine_width  = 20;
-my $spine_height = 30;
-
-my $top_margin  = 10;
-my $left_margin = 10;
-my $colspace    = 10;
-my $rowspace    = 2;
+my $spine_width  = 65;
+my $spine_height = 108;
+
+my $top_margin  = 41;
+my $left_margin = 27;
+my $colspace    = 12;
+my $rowspace    = 0;
 
 my $block_cols = 2;
 my $block_rows = 5;
@@ -131,74 +131,94 @@
 
 foreach $item (@resultsloop) {
     my $barcode = $item->{'barcode'};
-    $item->{callnumber} = 'BT 380.2 W54';
-    my @callnumber = split( / /, $item->{callnumber} );
+    $item->{'callnumber'} = 'BT 380.2 W54';
+    my @callnumber = split( / /, $item->{'callnumber'} );
 
     my @spine_fields = (
-        $item->{ccode}, $callnumber[0], $callnumber[1],
-        $callnumber[2], $item->{copyrightdate}
+        $item->{'ccode'}, $callnumber[0], $callnumber[1], $callnumber[2],
+        $item->{'copyrightdate'}
     );
 
     my @circ_fields = (
-        $item->{ccode}, $callnumber[0], $callnumber[1],
-        $callnumber[2], $item->{copyrightdate}
+        $item->{'ccode'}, $callnumber[0], $callnumber[1], $callnumber[2],
+        $item->{'copyrightdate'}
     );
 
-    my @circ2_fields = ( $item->{author}, $item->{title} );
+    my @circ2_fields = ( $item->{'author'}, $item->{'title'} );
 
     my @circ_barcode = ( $item->{'barcode'} );
 
-    my $fontsize = 3;
+    my $fontsize = 10;
 
     #    warn "$x_pos, $y_pos, $label_width, $label_height";
     my $barcode = $item->{'barcode'};
 
-    #    drawbox( $x_pos, $y_pos, $block_width, $block_height, ) if $guidebox;
-    drawbox( $x_pos, $y_pos + 10, $spine_width, $spine_height, ) if $guidebox;
+    drawbox( $x_pos, $y_pos, $block_width, $block_height, ) if $guidebox;
 
-    draw_text_block_manual2(
-        $x_pos,    $y_pos + 10, $spine_width, $spine_height,
-        $fontsize, '',          $gutter,      'l',
+    #-- spine
+    drawbox( $x_pos, $y_pos + ( $block_height - $spine_height ),
+        $spine_width, $spine_height, )
+      if $guidebox;
+
+    draw_text_block_manual2(    # spine
+        $x_pos, $y_pos + ( $block_height - $spine_height ), $spine_width,
+        $spine_height, $fontsize, '', $gutter, 'l',
         @spine_fields
     );
 
-    drawbox( $x_pos + 30, $y_pos + 20, $label_width, $label_height, )
-      if $guidebox;
-    draw_text_block_manual2(
-        $x_pos + 30, $y_pos + 20, $label_width, $label_height,
-        $fontsize,   '',          $gutter,      'r',
-        @circ_barcode
-    );
+    #-- spine
 
+    #-- top barc
+    drawbox(
+        ( $x_pos + $spine_width + $colspace ),
+        $y_pos + $label_height,
+        $label_width, $label_height,
+    ) if $guidebox;
     draw_text_block_manual2(
-        $x_pos + 30, $y_pos + 20, $label_width, $label_height,
-        $fontsize,   '',          $gutter,,
-        '',          @circ_fields
+        ( $x_pos + $spine_width + $colspace ),
+        ( $y_pos + $label_height ),
+        $label_width, $label_height, $fontsize, '', $gutter, 'r', @circ_barcode
     );
 
     draw_text_block_manual2(
-        $x_pos + $spine_width + 30,
-        $y_pos + 20,
-        $label_width, $label_height, $fontsize, 2, $gutter, 'l', @circ2_fields
+        ( $x_pos + $spine_width + $colspace ),
+        ( $y_pos + $label_height ),
+        $label_width, $label_height, $fontsize, '', $gutter,, '', @circ_fields
     );
 
-    drawbox( $x_pos + 30, $y_pos, $label_width, $label_height, ) if $guidebox;
     draw_text_block_manual2(
-        $x_pos + 30, $y_pos, $label_width, $label_height,
-        $fontsize,   '',     $gutter,      'r',
-        @circ_barcode
+        ( $x_pos + $spine_width + $colspace + $spine_width ),
+        ( $y_pos + $label_height ),
+        $label_width,
+        $label_height,
+        $fontsize,
+        2,
+        $gutter,
+        'l',
+        @circ2_fields
     );
 
-    draw_text_block_manual2(
-        $x_pos + 30, $y_pos, $label_width, $label_height,
-        $fontsize,   '',     $gutter,,
-        '',          @circ_fields
-    );
+    #-- top barc
+
+    #-- bottom barc
+    drawbox( ( $x_pos + $spine_width + $colspace ),
+        $y_pos, $label_width, $label_height, )
+      if $guidebox;
+    draw_text_block_manual2( ( $x_pos + $spine_width + $colspace ),
+        $y_pos, $label_width, $label_height, $fontsize, '', $gutter, 'r',
+        @circ_barcode );
 
-    draw_text_block_manual2( $x_pos + $spine_width + 30,
+    draw_text_block_manual2( ( $x_pos + $spine_width + $colspace ),
+        $y_pos, $label_width, $label_height, $fontsize, '', $gutter,, '',
+        @circ_fields );
+
+    draw_text_block_manual2(
+        ( $x_pos + $spine_width + $colspace + $spine_width ),
         $y_pos, $label_width, $label_height, $fontsize, 2, $gutter, 'l',
         @circ2_fields );
 
+    #-- bottom barc
+
     #calc_next_block_position();
     CalcNextLabelPos();
 





More information about the Koha-cvs mailing list