LedgerSMB Documentation

Description manuals and libraries
LedgerSMB Documentation > Perl Modules > LedgerSMB::Template::Sink::Printer
Source

NAME

LedgerSMB::Template::Sink::Printer - Consume templates for printing

SYNOPSIS

   use LedgerSMB::Template;
   use LedgerSMB::Template::Sink::Printer;

   sub collect {
      my $sink = LedgerSMB::Template::Sink::Print->new( printer => 'Print1' );
      for my $item (@list) {
         my $template = LedgerSMB::Template->new( ... );
         $template->render( ... );
         $sink->append( $template );
      }

      return $sink->render; # return a PSGI response
   }

DESCRIPTION

This sink collects rendered templates and sends them to the indicated printer. The render method returns a page indicating the job submission statusses.

ATTRIBUTES

command

Command to execute and send the output to.

_results

(Internal) Collects the submission results.

METHODS

append( $template )

Implements the super class's append

render()

Returns a PSGI triplet containing the state of the sink.

LICENSE AND COPYRIGHT

Copyright (C) 2022 The LedgerSMB Core Team

This file is licensed under the GNU General Public License version 2, or at your option any later version. A copy of the license should have been included with your software.