Guardian Programmer's Guide

Table Of Contents
Communicating With Printers
Guardian Programmer’s Guide 421922-014
11 - 5
Using the Printer Control Language
!Move to the top of the form:
CALL CONTROL(PRINTER^NUM,
POSITION,
TOP^OF^FORM);
IF <> THEN CALL DEBUG;
.
.
!Close the printer:
CALL FILE_CLOSE_(PRINTER^NUM);
.
.
Using the Printer Control Language
All HP printers support the printer control language (PCL). New printers introduced
over the next few years will also support PCL.
PCL allows you to control the printer by sending escape sequences to it. The
procedure-call interface to the file system also allows you to perform some of these
escape sequences simply by calling the SETMODE or CONTROL procedure. The
mapping of these calls to PCL escape sequences is done internally.
The functions provided by PCL vary depending on the type of printer you are using; for
example, printers such as the 5577 and 5574 laser printers support a different subset
of PCL than a matrix line printer such as the 5515. With a goal of printer compatibility,
PCL has five levels of definition. Each printer type supports one of these levels:
Level 1: the print and space set is a subset of commands for inexpensive printers
that provides a simple way to produce hard copy.
Level 2: the EDP transaction feature set supports multiple-user printers suitable
for use in an EDP or transaction-oriented environment.
Level 3: the office word processing feature set provides additional data-
formatting capabilities.
Level 4: the page-formatting feature set provides comprehensive formatting
capabilities for the support of sophisticated printers such as laser printers.
Level 5: the enhanced page formatting feature set provides additional formatting
capabilities such as scalable outline fonts, reverse printing (white on black), and
finer rotation increments.
For example, the 5577 and 5574 laser printers support PCL level 5; the 5573 and
5573D laser printers support level 4; the 5515/5516/5518 matrix line printers support
level 2. Use care when writing programs that access printers to ensure that the feature
set used is available on all the printers that you might want your program to work with.