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.pl [rel_2_2]


From: Mason James
Subject: [Koha-cvs] koha/barcodes label-print-pdf.pl [rel_2_2]
Date: Wed, 26 Jul 2006 12:16:21 +0000

CVSROOT:        /sources/koha
Module name:    koha
Branch:         rel_2_2
Changes by:     Mason James <sushi>     06/07/26 12:16:18

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

Log message:
        added comments.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/barcodes/label-print-pdf.pl?cvsroot=koha&only_with_tag=rel_2_2&r1=1.1.2.7&r2=1.1.2.8

Patches:
Index: label-print-pdf.pl
===================================================================
RCS file: /sources/koha/koha/barcodes/label-print-pdf.pl,v
retrieving revision 1.1.2.7
retrieving revision 1.1.2.8
diff -u -b -r1.1.2.7 -r1.1.2.8
--- label-print-pdf.pl  26 Jul 2006 12:06:23 -0000      1.1.2.7
+++ label-print-pdf.pl  26 Jul 2006 12:16:18 -0000      1.1.2.8
@@ -188,31 +188,34 @@
         my $hPos = 36;
         foreach my $field (@fields) {
 
-            #warn "START Y_POS=$y_pos, vPos:$vPos";
+            # if the display option for this field is selected in the DB,
+            # and the item record has some values for this field, display it.
             if ( $conf_data->{"$field"} && $item->{"$field"} ) {
+
+                # chop the string up into 12 char's per line
                 $str = $item->{"$field"};
                 my $strlen    = length($str);
                 my $num_lines = ceil( $strlen / 12 );
                 my $start_pos = 0;
                 my $len       = 12;
+
+                # then loop for each string line
                 for ( 1 .. $num_lines ) {
                     $pdf->setAddTextPos( $hPos, $vPos - 10 );
                     my $chop_str = substr( $str, $start_pos, $len );
                     my ( $h, $v ) = $pdf->getAddTextPos();
 
-                    #warn "$field 1 x=$h, up=$v $chop_str\n";
+                    # using '1000' width, so that addText wont use it's
+                    # own internal wordwrap, (as it doesnt work so well)
                     $pdf->addText( $chop_str, 10, 1000, 90 );
-                    my ( $h, $v ) = $pdf->getAddTextPos();
+
                     $start_pos = $start_pos + $len;
                     $vPos      = $vPos - 10;
-                    warn "$field 2 x=$h, up=$v $chop_str\n";
                 }
             }    # if field is valid
         }    #foreach feild
         $y_pos = ( $y_pos - $label_height );
 
-        #warn "END LOOP Y_POS =$y_pos";
-        #warn "PAGECOUNT END LOOP=$page_break_count";
         if ( $page_break_count == 8 ) {
             $pagenumber++;
             $pdf->openpage($pagenumber);




reply via email to

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