psfilter - lpr filter support for PostScript printers

    Patrick Powell <papowell@sdsu.edu>
      Sun Oct 29 08:49:44 PST 1995

README                 - this file
README.connection      - how to check out your printer
README.printcap        - printcap files for this software
README.organization    - how the psfilter software works
INSTALL                - installation instructions
configure              - configure script
Makefile               - Makefile generated by configure
psfilter.1             - man page for the filter

Programs:
  psfilter [-Tdevice] [-sstatusfile] [-Xvalue -X value]
    Acts as an IF or OF filter for the LPR software.
    X is lpd filter parameter.
  psbanner [-Xvalue -X value]
    X is lpd filter parameter.
    Generates a postscript banner file
  textps [-options] [files]
    Converts text to postscript file
  nscript [-options] [files]
    Converts text to fancy postscript file

This software supports serial line or network connected printers.  It
is a replacement for the Adobe Transcript software.  It does
accounting,  and provides verbose and diagnostic output.

There are three types of printers spools that can use this software:

VINTAGE - Sun Microsystems and others:

The vintage LPR berkeley software invokes filters with no arguments.
The name used to invoke the filter will indicate the desired filter
actions, i.e.-
'psif' selects if (IF) filter action;
'psof' selects of (OF) filter action.

If the OF filter is sent a line with non-whitespace content,  it can
optionally fork a BANNER program and send the line to the banner
program.  The pathname of the banner program is hardwired by the BANNER
variable.

The psfilter can also set serial line configuration values.  You can
use the 'testif' program in this directory to see how this is done. For
example:

   printcap:\
     :of=/usr/local/lib/psfilter/dummypsof:

   #!/bin/sh
   # ** dummypsof file **
   # printcap entry should be:
   # of=/usr/local/lib/psfilter/dummypsof
   #
   exec /usr/local/lib/psfilter/psof \
     '-Tstty=9600 -lcase -echo -crmod -raw -oddp -evenp pass8 cbreak ixon' \
     "$@"

To use the banner printing option, set sb (short banner) in the
printcap entry and remove sh (suppress header).  Banner printing is
done by the banner.sh shell script - edit it as you like.  See
README.banner for details.

PLP 4.0+

The PLP software uses the printcap 'ty' flags to set the
various serial line characteristics.  You can use the
various flags in the printcap enties.
For example, we can specify a status file for the filter
as follows:

   :of=/usr/local/lib/psof -sstatus:\
   :if=/usr/local/lib/psif -sstatus:\
   :ps=status:\
   :ty=-9600 -lcase -echo -crmod -raw -oddp -evenp pass8 cbreak ixon:\

You can follow the same method as above, only you do not need to
recompile; you can use flags on the command line as shown above.

LPRng

The LPRng software has separated the filters and banner
printers. You can now use:

    :sb
    :if=/usr/local/lib/psif
    :of=/usr/local/lib/psof
    :bl=Seq\: $-'j  Class\: $-'C User\: $-'n Job\: $-'J Date\: $-'t

If you want to use a banner printing program, do:

    :sb
    :if=/usr/local/lib/psif
    :of=/usr/local/lib/psof -Tbanner=off
    :bp=/usr/local/lib/psbanner            <- banner printing program
    :bl=Seq\: $-'j  Class\: $-'C User\: $-'n Job\: $-'J Date\: $-'t

When invoked as psfilter, the of filter will intercept the short banner lines
and use the banner shell script to generate a banner.
Note that the 'bl' line printcap file allows you to specify the format
of the 'sb' (short banner) banner line.
The $-'X syntax substitutes entries with no -X key and puts quotes around
the value.  The psbanner program will accept this as input and generate
a banner page.

See the README.printcap and README.banner for more information.

TESTING

Several test scripts are provided for your assistance.

testif - general front end
    #/bin/sh
    psfilter -T/dev/ttyb \
     '-T9600 -lcase -echo -crmod -raw -oddp -evenp pass8 cbreak ixon' "$@"

  Simply takes stdin and sends it to the device.  Try running it as follows:

   Debug levels: 0 - no debugging, fairly silent; if no status file
    (-s option) logs to stderr
   Debug levels: 1-4 - increased debugging, becomes unspeakable verbose
    and informative.
   Debug levels: 11+ - turns off serial control, and dumps to stdout

   Use:
      testif -D12  <file    - see what happens when you give it a text file
        - it should invoke TEXTPS to convert it
      testif -D4  <file    - 
        - will attempt to sync the printer, extemely verbose

      touch status
      testif -D4 -sstatus <file      - look at status file

      touch accnt
      testif -D4 accnt <file      - look at accounting file output

   See the directions in the other README files for details.

testof - psof testing
   When you use psfilter as a VINTAGE of filter, you need to check
   that it handles banner lines correctly.  This script allows you
   to run the banner stuff repeatedly, once you capture the banner line.

    #!/bin/sh
    psof -T/dev/ttyb \
         '-T9600 -lcase -echo -crmod -raw -oddp -evenp pass8 cbreak ixon' "$@"
    <<'EOF'
    Seq: 831  Class: A User: papowell Job: ellipse.ps Date: Aug 20 19:09:41
    EOF

testbanner
    Allows you to see the output of the banner program and to tune it
    to the banner format supplied by your LPD printer.  See the README.banner
    for more information.

    psbanner <<'EOF'
    Job: (std\\in) \\test User: papowell Seq: 123 Host: taco Class: Z
    EOF

monitor
   Monitor is a simple program that opens a UDP port and reads from it.
   This can be used to check the operation of the -Tsummary=host%port
   option.
   1. generate the monitor program 
         make monitor
   2. start the program- you need to select the port
         monitor 2000
   3. use the testif program to test that information is
         being written to the port
        testif -Tsummary=host%2000
   4. Note - the sendtest program can be used to test that
       monitor is working
          make sendtest
          sendtest host%2000
