From f4958a2b79ab78d5b04257f7340c786fef526de7 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Tue, 18 Feb 2014 11:55:28 +0100 Subject: [PATCH] =?utf8?q?CreatePDF-Helfer:=20create=5Fpdf:=20Extension=20?= =?utf8?q?muss=20bereits=20=C3=BCbergeben=20werden?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Helper/CreatePDF.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/SL/Helper/CreatePDF.pm b/SL/Helper/CreatePDF.pm index 6cffc2925..10618b214 100644 --- a/SL/Helper/CreatePDF.pm +++ b/SL/Helper/CreatePDF.pm @@ -33,8 +33,9 @@ sub create_pdf { $form->{format} = 'pdf'; $form->{cwd} = getcwd(); $form->{templates} = $::instance_conf->get_templates; - $form->{IN} = $params{template} . '.tex'; + $form->{IN} = $params{template}; $form->{tmpdir} = $form->{cwd} . '/' . $userspath; + my ($suffix) = $params{template} =~ m{\.(.+)}; my $vars = $params{variables} || {}; $form->{$_} = $vars->{$_} for keys %{ $vars }; @@ -42,7 +43,7 @@ sub create_pdf { my $temp_fh; ($temp_fh, $form->{tmpfile}) = File::Temp::tempfile( 'kivitendo-printXXXXXX', - SUFFIX => '.tex', + SUFFIX => ".${suffix}", DIR => $userspath, UNLINK => ($::lx_office_conf{debug} && $::lx_office_conf{debug}->{keep_temp_files})? 0 : 1, ); -- 2.20.1