bug 4188: move PDF templates for printed purchase orders
[koha_gimpoz] / acqui / pdfformat / layout2pages.pm
index c7c1985..768fdec 100755 (executable)
@@ -236,11 +236,8 @@ sub printfooters {
 sub printpdf {
     my ($basketgroup, $bookseller, $baskets, $orders, $GST) = @_;
     # open the default PDF that will be used for base (1st page already filled)
-    use FindBin qw( $Bin );
-    open(my $fh, "$Bin/pdfformat/layout2pages.pdf") or die "$@";
-    my @pdf = <$fh>;
-    close($fh);
-    my $pdf = PDF::API2->openScalar(join('', @pdf));
+    my $pdf_template = C4::Context->config('intrahtdocs') . '/' . C4::Context->preference('template') . '/pdf/layout2pages.pdf';
+    my $pdf = PDF::API2->open($pdf_template);
     $pdf->pageLabel( 0, {
         -style => 'roman',
     } ); # start with roman numbering