From: Sven Schöling Date: Tue, 20 Jul 2010 09:15:30 +0000 (+0200) Subject: STDOUT erneut öffnen und UTF8-Flag und FastCGI gefixt Teil 3 X-Git-Tag: release-2.6.2beta1~279 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=00e5ce0d02a0d1e5a6f7b8a28744ee7961932a0b;p=kivitendo-erp.git STDOUT erneut öffnen und UTF8-Flag und FastCGI gefixt Teil 3 Conflicts: SL/DN.pm --- diff --git a/SL/DN.pm b/SL/DN.pm index 5cf42b543..f1e132fb7 100644 --- a/SL/DN.pm +++ b/SL/DN.pm @@ -663,29 +663,26 @@ sub melt_pdfs { my $in = IO::File->new("gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=- $inputfiles |"); $form->error($main::locale->text('Could not spawn ghostscript.')) unless $in; - my $out; - if ($form->{media} eq 'printer') { $form->get_printer_code($myconfig); + my $out; if ($form->{printer_command}) { $out = IO::File->new("| $form->{printer_command}"); } + $::locale->with_raw_io($out, sub { $out->print($_) while <$in> }); + $form->error($main::locale->text('Could not spawn the printer command.')) unless $out; } else { my $dunning_filename = $form->get_formname_translation('dunning'); - $out = IO::File->new('>-'); - $out->print(qq|Content-Type: Application/PDF\n| . - qq|Content-Disposition: attachment; filename="${dunning_filename}_${dunning_id}.pdf"\n\n|); - } + print qq|Content-Type: Application/PDF\n| . + qq|Content-Disposition: attachment; filename="${dunning_filename}_${dunning_id}.pdf"\n\n|; - while (my $line = <$in>) { - $out->print($line); + $::locale->with_raw_io(\*STDOUT, sub { print while <$in> }); } $in->close(); - $out->close(); map { unlink("${main::spool}/$_") } @{ $form->{DUNNING_PDFS} };