Mahnungen: PDF an Drucker schicken: Druckbefehl erst prüfen, dann verwenden
authorBernd Bleßmann <bernd@kivitendo-premium.de>
Mon, 22 Mar 2021 11:45:59 +0000 (12:45 +0100)
committerBernd Bleßmann <bernd@kivitendo-premium.de>
Thu, 25 Mar 2021 10:22:24 +0000 (11:22 +0100)
SL/DN.pm

index e9aa1ec..a4eb127 100644 (file)
--- a/SL/DN.pm
+++ b/SL/DN.pm
@@ -849,10 +849,10 @@ sub melt_pdfs {
       $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;
 
+    $::locale->with_raw_io($out, sub { $out->print($_) while <$in> });
+
   } else {
     my $dunning_filename = $form->get_formname_translation('dunning');
     print qq|Content-Type: Application/PDF\n| .