Bugfix: Enabling guide box configuration parameter
[koha.git] / patroncards / create-pdf.pl
index 830334d..02ba793 100755 (executable)
@@ -29,11 +29,8 @@ use autouse 'Data::Dumper' => qw(Dumper);
 use C4::Debug;
 use C4::Context;
 use autouse 'C4::Members' => qw(GetPatronImage GetMember);
-use C4::Creators::PDF 1.000000;
-use C4::Patroncards::Batch 1.000000;
-use C4::Patroncards::Template 1.000000;
-use C4::Patroncards::Layout 1.000000;
-use C4::Patroncards::Patroncard 1.000000;
+use C4::Creators 1.000000;
+use C4::Patroncards 1.000000;
 
 my $cgi = new CGI;
 
@@ -65,7 +62,7 @@ my $lower_left_y  = 0;
 my $upper_right_x = $template->get_attr('page_width');
 my $upper_right_y = $template->get_attr('page_height');
 
-$pdf->Compress(1);
+$pdf->Compress(1); # comment this out to debug pdf files, but be sure to uncomment it in production or you may be very sorry...
 $pdf->Mbox($lower_left_x, $lower_left_y, $upper_right_x, $upper_right_y);
 
 my ($llx, $lly) = 0,0;
@@ -123,7 +120,7 @@ foreach my $item (@{$items}) {
                 layout                  => $layout_xml,
                 text_wrap_cols          => 30, #FIXME: hardcoded
         );
-        $patron_card->draw_guide_box($pdf);
+        $patron_card->draw_guide_box($pdf) if $layout_xml->{'guide_box'};
         $patron_card->draw_barcode($pdf) if $layout_xml->{'barcode'};
 
 #       Do image foo and place binary image data into layout hash