     The  program  PF  (short for PRINTFILES) is an utility written to
print  text  files on an Hewlett-Packard DeskJet 500 printer connected
to  the  parallel port of an Amiga personal computer, selecting in the
same time the font and the printing style between the internal options
of this printer.

     PF  comes  in  two  versions,  PF1 and PF2, written for the SAS C
Compiler  v5.10:   the  printing  routines  are  the same.  But PF1 is
callable  only  from  the CLI, and is structured to be easily modified
for  different  computers (e.g.  IBM (argh!) PC's); I did not try, but
as  I  avoided  all  the  Intuition  facilities and computer dependent
statements,  it  should  compile  and work with the only change of the
output  port  name  (from  PAR:   to e.g.  LPT1:  or maybe PRN:).  For
maximum  portability PF1 writes to the printer fopening a file to PAR:
and  fwriting there; this can be not strictly kosher but works (on the
Amiga).

     PF2  instead opens the printer.device for output, and supports in
addition  both  CTRL-C  handling and a Workbench interface:  to select
the files to print, PF uses the standard AmigaDos 2.0 asl.library file
requester;  and,  to  remain  compatible  with  older  releases of the
operating  system,  if  versions  of  the  graphics.library older than
Revision  37 are found, PF uses the file requester of the req.library,
from  Colin Fox and Bruce Dawson---that can be found e.g.  in the Fred
Fish  collection on disk 419, and that must be previously installed in
order  to  run PF2 (from the Workbench; you can still run PF2 from the
CLI  without having the req.library installed, and under every release
of the operating system from 1.2).  Versions that open the req.library
or  the  asl.library without checking for the system version (and thus
being  smaller) can be easily linked; see the comments in the included
file Source/makefile.

     The  purpose  of  PF  is to send the correct escape sequence that
directs  the printer to use an internal font, then to optionally print
one  or  more  files;  the printer is reset to the default at the end,
UNLESS  when  no  file  names are given:  invoking PF this way you can
manually  initialise  your  DeskJet  as  you  like.  To initialise the
printer  from  the  Workbench  interface, exit from the file requester
without  selections.   Be  careful:   the first time that something is
written  to  PRT:,  Amiga sends the initialisation sequence looking at
the  existing preferences; to use an internal font not selectable from
Preferences,  you  should first print something; then use PF; the copy
to PRT:  the wanted file(s).

     In  PF  I  have foreseen also a "special" printing mode:  2 pages
(55  lines  and  80  columns  each)  on  the  same  sheet of paper, in
landscape  mode  with  a  small  font  and a nice border around.  This
printing mode is ssllloooowwwwww...  so slow that you could see system
requesters  asking  to  check  your  printer, because a page cannot be
printed  before  the  printer timeout (just ignore these messages, and
click  RESUME;  or  use  PF1  that,  writing  directly on the parallel
port,  does  not  have  timeouts).   Several (american :-) people sent
comments  complaining about this special format being correct ONLY FOR
A4 PAPER; but the "letter" paper (i.e.  the "american" paper) is about
11/16  of  an  inch  shorter  than A4 paper, and using Courier font at
16.67  cpi  this means that I need to print 12 character less in every
row in order to fit the page width---and asking for 80 character lines
this  is  impossible.   Please, american users, excuse me:  but I have
constraints from the finite number of character sizes available on the
DeskJet;  in order to print two reduced pages side to side on the same
sheet you need something more.  A GENERAL solution exists, that can be
used  on  the DeskJet in graphics mode.  If you want to know what this
solution  is,  please  have  a look to the content of the subdirectory
TwoUp.

     Not  all  internal modes are selectable; e.g., I cannot imagine a
reason to print a whole document in boldface...  but if you think that
could be useful to have this option too, let me know...


-----


Usage from the CLI:

Command:     PF   [switches]   [file [file [file ... ] ] ]

Switches:    -l : Landscape (default is portrait);                  
             -i : Italic (default is roman);                        
            -bN : insert N Blanks at the beginning of every line;   
            -aN : expand tAbs every N-th column (default: N=8);
             -g : Letter-Gothic font (default is Courier);          
             -t : Times font (default is Courier);                  
             -s : Small pitch (Courier: 16.67 cpi; Let.Got.: 24cpi);
             -x : eXtra-small pitch (20 cpi - for Courier only);    
             -8 : 8 lpi (default is 6 lpi);                         
             -6 : 6 points high fonts (default is 12 points fonts); 
             -d : Draft quality (default is letter quality);        
             -2 : special mode (2 pages every side).                

     The  switches can be specified one by one:  e.g.  -g -8 -s if you
need  Letter-Gothic  font,  spaced  at  8  lines  per inch and with 24
characters per inch horizontally; or together, e.g.  -g8s for the same
layout.  Only the -bN and the -aN switches must be specified alone, or
specified as the last ones in a group of switches (e.g.  you can write
-g8s -b10; OR -g8sb10; but NOT -b10g8s).

     The  switches  can  be either lower or uppercase; the default for
tab  expansion  is  every 8th column (i.e.  at columns 9, 17, ...) and
can be changed using the -aN option.

     If  the  input stream contains a non-printable character, it will
not  be  sent to the printer:  for "non-printable", here I essentially
mean  the  "control"  characters,  having  ASCII  codes from 00 to 037
(octal),  plus DEL (0177 octal); the characters corresponding to codes
above   0177   are   strictly  implementation-dependent  (and  usually
printables),  and what I needed was to avoid escape sequences embedded
in the text to interfere with the printer setting.

     The  -s,  -x,  -l and -i switches are ignored when the request is
not  compatible  with  the selected font; the "normal" pitch is 10 cpi
for  Courier,  and  12  cpi for Letter-Gothic (Times is a proportional
font).   All the switches different from -d and -aN will be ignored if
the option -2 is selected.

     The program (PF2 only) can be interrupted with a CTRL-C; however,
to flush the DeskJet internal buffer, you should switch it off then on
again.   Please  - take care to switch on your printer before invoking
PF;  I  check  the  parallel  device  properly,  but if the printer is
connected to the serial port I cannot detect its status.
             
     Giving  PF  with  invalid switches (or PF without any argument) a
short help screen will be printed on stdout.

     This  program  can  be  freely distributed and modified, provided
that  no money is charged for it; and that the original header is left
at  the  beginning  with my name and address.  If someone will improve
PF, I would like to hear about his/her modifications:  please, send me
your  changes!   The  source  files  are  in  the  subdirectory  named
"Source".

     In  this  same  directory you will find a "quick & dirty" program
named  MAX; invoking MAX from the CLI with "MAX file [file [ ...  ] ]"
will  print  on  stdout  some information about the quoted files:  the
number  of  lines,  the  length  of  the  longest  line, non-printable
characters  in  the  file (if any); and this in turn could help you in
choosing the right parameters for PF.


-----


Author:  Maurizio Loreti, aka MLO or I3NOO.            
Address: University of Padova - Department of Physics   
         Via F. Marzolo, 8 - 35131 PADOVA - Italy      
Phone:   (39)(49) 844-313         FAX: (39)(49) 844-245
E-Mail:  LORETI at IPDINFN (BITNET),  or VAXFPD::LORETI
         (DECnet). VAXFPD is DECnet node 38.257 or 39169;
         INTERNET: LORETI@PADOVA.INFN.IT . All these
         addresses refer to the same computer, a VAX
         8600 owned from the Italian Agency for Research
         in High Energy Physics (I.N.F.N.).
Home: Via G. Donizetti 6 - 35010 CADONEGHE (PD) - Italy


Home setup: Amiga 500, A501, A590 20MB Hard Disk, 3 MB total memory;
            of course an Hewlett-Packard Deskjet 500.
Work setup: Amiga 3000 16 MHz, 50 MB Hard Disk, 6 MB total memory;
            and another Hewlett-Packard Deskjet 500.
Software: CygnusEd Professional, SAS-C 5.10, FlexeLint for the Amiga.


                                            Have Fun!

                                                         MLO
