

printer               Technical Information               printer




The printer  is the device that  transfers human-readable data to
paper.   It can  be plugged  into either a  parallel or  a serial
port, depending upon how your printer is designed.  The former is
faster, whereas  the latter permits the  printer to be positioned
farther  away  from  the  computer.  The  following  descriptions
assume that you have your printer plugged into a parallel port.

COHERENT permits  you to have up to three  parallel ports on your
computer.  Devices  /ddeevv/llpptt11, /ddeevv/llpptt22, and  /ddeevv/llpptt33 control,
respectively, parallel  ports 1,  2, and  3 in cooked  mode.  The
device /ddeevv/llpp  is normally linked  to the above  device that you
wish to  use by  default as your  line printer.  See  the Lexicon
article llpp for more details on these devices.

COHERENT can  print text  on all  ``dumb'' printers that  have no
special   text-formatting  features.    It  also   supports  text
formatting on three  varieties of printers: Epson-compatible dot-
matrix  printers;  laser printers  compatible  with the  Hewlett-
Packard LaserJet  family of printers that  implement the Hewlett-
Packard Page  Control Language (PCL); and  all printers that have
implemented the PostScript language.

***** Dumb Printers *****

To print  on a ``dumb''  printer plugged into  the parallel port,
use the command llpprr.   This command performs some formatting on a
file, and  invokes the line-printer daemon llppdd  to spool the file
for printing.   Using the line-printer  daemon is necessary  in a
multi-user  environment  to   ensure  that  print  requests  from
different users  do not arrive  at the printer at  the same time,
causing  the  printer to  output  a jumbled  mess  (if it  prints
anything at all).

For example, if FFOOOO is a text file, the command


        lpr FOO


prints it  on your dumb printer.  You should  use the llpprr command
to  print  ``simple''  text (such  as  program  listings) on  any
variety of dot-matrix printer.  To print listings or other simple
text on a laser printer, see below.

The  output of  the  text-formatting command  nnrrooffff  can also  be
printed, with  some success, on  dumb printers.  To  represent an
italicized  character, it  prints  the character,  followed by  a
backspace, followed  by an  underscore character; to  represent a
bold-face  character,  it output  the  character,  followed by  a
backspace, followed by  the character again (in the hope, perhaps
naive, that  presenting the same  text twice will  make it appear
bolder).




COHERENT Lexicon                                           Page 1




printer               Technical Information               printer



***** Epson-Compatible Printers *****

The command eeppssoonn massages text into a form that uses some of the
text-formatting features  of the  Epson MX-80 printer  and clones
thereof.  It  is especially  to be used  with text that  has been
formatted  with nnrrooffff,  as described above;  there, it  turns the
``character/backspace/character'' sequence  into the Epson escape
sequences for  emphasized text and italics.   It then directs its
output to  the line-printer device /ddeevv/llpp,  which it assumes has
an Epson-style printer plugged into it.

The following  example uses nnrrooffff  to format file  FFOOOO and prints
the output on an Epson-style printer:


        nroff -ms FOO | epson


***** LaserJet-style Printers *****

COHERENT  includes  a  large suite  of  commands  to support  the
Hewlett-Packard LaserJet  family of  printers, as well  as clones
that run Hewlett-Packard's PCL.

To begin, these commands use the HP devices /ddeevv/hhpp and /ddeevv/rrhhpp.
When you installed COHERENT  on your system, you may have created
these devices; if you did not, however, you should create them by
simply using  the command  llnn to link  /ddeevv/llpp to /ddeevv/hhpp  and to
link /ddeevv/rrllpp to /ddeevv/rrhhpp, as follows:


        ln /dev/lp  /dev/hp
        ln /dev/rlp /dev/rhp


You must log in as the superuser rroooott to execute these commands.

The daemon hhppdd spools files  to be printed on your laser printer.
It works like the line-printer daemon llppdd, as described above.

The command  hhpp prepares files to be printed  on a laser printer.
You should  use it  to prepare  ``simple'' text, such  as program
listings, for  printing on your laser  printer.  Like the command
eeppssoonn, hhpp also massages the output of nnrrooffff into PCL-style escape
sequences; unlike eeppssoonn, however, it does not automatically spool
the file for printing.

The command  hhpprr spools files  to be printed on  a laser printer.
It works  like the command llpprr, except that  it includes a number
of  special features;  for example,  you can  use it  to download
LaserJet ``soft fonts'' into your printer.

The following command uses  nnrrooffff to format file FFOOOO, then prints
on a Hewlett-Packard style laser printer:



COHERENT Lexicon                                           Page 2




printer               Technical Information               printer




        nroff -ms FOO | hp | hpr -B


Note  that the  -BB option  to  hhpprr suppresses  the printing  of a
banner page.

The  text-formatting  command  ttrrooffff  can  create  proportionally
spaced text to be printed  on either a PCL or PostScript printer.
In PCL mode,  ttrrooffff can make full use of  all ``soft fonts'' that
you have loaded onto  your printer.  For example, this manual was
printed by  COHERENT ttrrooffff in PCL  mode driving a Hewlett-Packard
LaserJet III with soft fonts.  See the Lexicon for details on how
to use ttrrooffff with laser printers.

***** PostScript Printers *****

COHERENT includes  two commands  that can drive  PostScript style
printers, such as the Apple LaserWriter.

The command pprrppss is  a PostScript version of the COHERENT command
pprr.  It paginates  text,  and supplies  each page  with a  simple
header.  See its Lexicon entry for details.

As noted  above, ttrrooffff, the  COHERENT text formatter,  can create
proportionally space text  for either PCL or PostScript printers.
In PostScript mode, ttrrooffff  can handle all 35 fonts available with
most  PostScript cartridges;  it supports  full font  scaling and
features such as outlining and shadowing.  It also permits you to
embed ``raw'' PostScript  within your file, to create effects not
already available  with the ttrrooffff  text-formatting language.  For
details on using ttrrooffff with PostScript printers, see its entry in
the Lexicon.

***** Printer Problems *****

The  following paragraphs  describes the  problems  most commonly
encountered with printers, and suggests some solutions.

If you  are trying to access your  parallel interface printer via
special files  /ddeevv/llpp or /ddeevv/llpptt11 and  receive an error message
of the form


        cannot open device /dev/lp


this means  that your printer is not attached  to the device that
COHERENT  associates with  /ddeevv/llpptt11. Your  printer is  at either
attached to /ddeevv/llpptt22 or to /ddeevv/llpptt33. To discover which one, log
in as the superuser rroooott and use ccdd to enter directory /ddeevv. Make
sure that  your printer  is plugged  in, turned on,  and on-line;
then enter the command:




COHERENT Lexicon                                           Page 3




printer               Technical Information               printer




        cat _f_i_l_e > lpt2


_f_i_l_e  can   be  any  readable   file  that  you   specify  (e.g.,
/eettcc/ppaasssswwdd). If  your printer does  not print _f_i_l_e,  then repeat
the command for device /ddeevv/llpptt33:


        cat _f_i_l_e > lpt3


The  command that  works  indicates the  device  into which  your
printer is plugged.

The final step is to  ``link'' the actual location of the printer
to devices  /ddeevv/llpp and /ddeevv/rrllpp, so  that the COHERENT utilities
know how to print a file.  Enter the appropriate commands:


        ln -f lpt2  lp
        ln -f rlpt2 rlp


if your printer is attached to /ddeevv/llpptt22, or


        ln -f lpt3  lp
        ln -f rlpt3 rlp


if your printer was attached to /ddeevv/llpptt33.

If you  have an  Hewlett-Packard LaserJet or  compatible printer,
perform the above  ``link'' operation again but substitute hhpp for
llpp and  rrhhpp for  rrllpp. This  allows the command  hhpprr to  find your
printer.

If you are using a serial printer, note that flow control via CTS
(clear-to-send) is not  supported in the ccoomm11 through ccoomm44 family
of devices, but is  available in devices hhss0000rr through hhss0077rr. See
Lexicon articles ccoomm, hhss, and tteerrmmiinnaall for details.

***** See Also *****

eeppssoonn, hhpp,  hhppdd, hhpprr, llpp, llppdd,  llpprr, pprrppss, tteecchhnniiccaall iinnffoorrmmaattiioonn,
ttrrooffff










COHERENT Lexicon                                           Page 4


