Revision 00e5ce0d
Von Sven Schöling vor mehr als 14 Jahren hinzugefügt
SL/DN.pm | ||
---|---|---|
663 | 663 |
my $in = IO::File->new("gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=- $inputfiles |"); |
664 | 664 |
$form->error($main::locale->text('Could not spawn ghostscript.')) unless $in; |
665 | 665 |
|
666 |
my $out; |
|
667 |
|
|
668 | 666 |
if ($form->{media} eq 'printer') { |
669 | 667 |
$form->get_printer_code($myconfig); |
668 |
my $out; |
|
670 | 669 |
if ($form->{printer_command}) { |
671 | 670 |
$out = IO::File->new("| $form->{printer_command}"); |
672 | 671 |
} |
673 | 672 |
|
673 |
$::locale->with_raw_io($out, sub { $out->print($_) while <$in> }); |
|
674 |
|
|
674 | 675 |
$form->error($main::locale->text('Could not spawn the printer command.')) unless $out; |
675 | 676 |
|
676 | 677 |
} else { |
677 | 678 |
my $dunning_filename = $form->get_formname_translation('dunning'); |
678 |
$out = IO::File->new('>-'); |
|
679 |
$out->print(qq|Content-Type: Application/PDF\n| . |
|
680 |
qq|Content-Disposition: attachment; filename="${dunning_filename}_${dunning_id}.pdf"\n\n|); |
|
681 |
} |
|
679 |
print qq|Content-Type: Application/PDF\n| . |
|
680 |
qq|Content-Disposition: attachment; filename="${dunning_filename}_${dunning_id}.pdf"\n\n|; |
|
682 | 681 |
|
683 |
while (my $line = <$in>) { |
|
684 |
$out->print($line); |
|
682 |
$::locale->with_raw_io(\*STDOUT, sub { print while <$in> }); |
|
685 | 683 |
} |
686 | 684 |
|
687 | 685 |
$in->close(); |
688 |
$out->close(); |
|
689 | 686 |
|
690 | 687 |
map { unlink("${main::spool}/$_") } @{ $form->{DUNNING_PDFS} }; |
691 | 688 |
|
Auch abrufbar als: Unified diff
STDOUT erneut öffnen und UTF8-Flag und FastCGI gefixt Teil 3
Conflicts: