Guardian Programmer's Guide

Table Of Contents
Guardian Programmer’s Guide 421922-014
11 - 1
11
Communicating With Printers
This section describes how your program gains access to a printer and writes data to a
printer. Specifically, this section covers the following topics:
How to open a printer, write text to it, and pass control information to it using
CONTROL operations and SETMODE functions. Accessing a Printer provides
details.
How to control laser printers and matrix line printers by sending escape sequences
to them. Using the Printer Control Language provides an overview. Programming
for Tandem Laser Printers and Programming for Tandem Matrix Line Printers
provide details.
How to recover from errors incurred while printing. See Recovering From Errors.
At the end of this section is a complete sample program that accesses a printer and
responds to printer errors.
Most programs that send output to a printer do so indirectly by writing to a spooler
collector. Some applications, however, need to write directly to the printer, especially if
the user will need immediate notification of printer errors; for example, following a
positioning error when printing paychecks.
Usually, you should write your programs to be able to write either to the spooler or
directly to the printer. The purpose of writing to the spooler is to store for later printing
the exact sequence of operations the program sent to the spooler. The only function
lost by using the spooler is the ability to take special action if errors occur during
printing.
For complete information about a specific printer, refer to the appropriate printer
reference manual. For additional information about accessing printers, such as how to
access a printer over a telephone line, refer to the appropriate data communications
manual.
For complete programming details related to the spooler, see the spooler manuals.