-sub print_pdfs {
- my ($self) = @_;
-
- my $job_obj = $self->{job_obj};
- my $data = $job_obj->data_as_hash;
- my $printer_id = $data->{printer_id};
-
- return if !$printer_id;
-
- my $printer = SL::DB::Printer->new(id => $printer_id)->load;
- my $command = SL::Template::create(type => 'ShellCommand', form => Form->new(''))->parse($printer->printer_command);
- my $out;
-
- if (!open $out, '|-', $command) {
- push @{ $data->{print_errors} }, { message => $::locale->text('Could not execute printer command: #1', $!) };
- $job_obj->update_attributes(data_as_hash => $data);
- return;
- }
-
- binmode $out;
- print $out $self->{merged_pdf};
- close $out;