README document for CAPinterface
(6/7/94 rks)

CAPinterface is an lp PostScript printer interface intended for use with CAP
6.0 on Silicon Graphics computers running IRIX 4.x.  We have used it 
successfully on a number of different PostScript printers on our local
Appletalk network, and it has proven remarkably robust.  We have been using
it and its immediate predecessor for the last six months with good results.
The interface can print files in PostScript, text, and SGI image library
( RGB, TIFF, and FIT ) formats using filters included with IRIX.  Text and
image files can be printed in either portrait or landscape orientation,
specified on the command line.  The command line can be used to control a
number of different aspects of text printing, including font, margins, page
numbering, and line wrap.  The IRIX Print Manager can be used to cancel
print requests.  Files can be printed directly from the IRIX WorkSpace.  The
interface can be adapted for use with color poscript printers with minimal
modification.


Requirements for Installation:

1) CAP 6.0 must be installed and functional.  The interface prints the files
using papif.  In addition, the installation script uses atlooklws and
getzones.
2) The printer interface uses a number of IRIX programs, including lptops,
tops, imginfo, and imgcopy. You should make sure that these are installed on 
your system.


Setting the Defaults:

Before you install the interface, you should take a look at the defaults
section at the beginning of CAPinterface.  Make sure that the paths are
correct for papif, lptops, tops, and imgcopy.  Change the NAME string to your 
printer model.  If you want, you can modify the other defaults.  The supplied 
values should be fine for most printers.  Most of the values can also be 
specified on the command line.  The following is a list of the relevant 
defaults and their acceptable values:

banner (0,1) Print a banner page (0=off, 1=on)

verbose (0,1) Verbose listings in the print log (0=off, 1=on)

imgland:(0,1 )Print orientation of image files (0=portrait, 1=landscape)

txtland:(0,1) Print orientation of text files (0=portrait, 1=landscape)

wrap: (0,1) Line wrap of text files (0=off, 1= on)

foldoptsp: Line wrap when printing text files in portrait orientation.

foldoptsl: Line wrap when printing text files in landscape orientation.

xmaxsize: Maximum printable width of page, in inches.

ymaxsize: Maximum printable length of page, in inches.

bitsperpixel: (1,2,4,8) Bits per pixel used by tops to filter images.

screendens: Halftone screen density, in lines per inch, used by tops to
filter images.

(The values used for screendens and bitsperpixel were determined empirically 
for our LaserWriter IIg.  You might want to try other values for different
printers if you are going to be printing lots of images).

fltr1opts: (lots) Options for lptops. See the lptops man page.

fltr2fixl: If you are going to print on a different size page (e.g., legal),
replace the "792" in the string with the product (72*new page length).

sendopts: papif options.  If you are using one of the "broken" printers,
append " -k" to the string in quotes.


Color Postscript Printers:

CAPinterface can be easily configured for use with a color PostScript printer.  
Appending either  " -CMYK" or " -RGB" to both fltr2optsl and fltr2optsp will 
cause tops to generate either CMYK or RGB PostScript from image files. Try 
experimenting with the values for screendens and bitsperpixel for the best 
results.


Installing CAPinterface:

Once you are have checked the interface defaults, install the interface with
the command:

./lp_install [file]

You must do this as root.  The [file] part is optional.  Use it if you want
to install a modified version of the interface which you have named something
else.  Otherwise, the script will install the CAPinterface file by default.
The script uses atlookws and getzones to get the printer and zone names.
Obviously, for this to work, the printers you want to install must be
on-line.

Using the installation script is pretty simple.  Basically, all you have to do 
is enter the location of the cap.printers file, pick the printer from a list,
and enter the UNIX name for the printer.  The script should take care of the
rest.  It will not let you overwrite an existing lp printer name.

The script will ask you for the location of the cap.printers file.  If there
is not a cap.printers file in the directory you enter, the script will create
one.  If a cap.printers file exists in the directory you enter, the script
will delete any old entries in the file that use the same UNIX printer name,
then add the new entry.  The old cap.printers file will be saved as 
cap.printers.old.

The script will also ask you if you wish to modify your WorkSpace filetype
rules.  If you answer yes, the script will copy the CAPprint.ftr file to
/usr/lib/filetype/local, then recompile your WorkSpace filetype rules.  This
allows printers of the type "CAP" (e.g., ones using CAPinterface) to print
text, image, and PostScript files directly from the WorkSpace.  The script
will also copy a modified version of the printtest script to /usr/lib/vadmin.
This will allow the "test" button in the IRIX Print Manager to work for
"CAP" printers (The old printtest file will be saved as printtest.old).

After you have answered all the questions to the script's satisfaction, it
will summarize the answers and ask you if they are correct. If you say no,
you can go back and change the setup.  If you say yes it will then ask you
if you want to install the interface. If you answer no at this point, the
script exits with no changes made.  Yes installs everything.  Once the
script finishes, you should see the printer in the Print Manager.  If you
modified the filetype rules, select the printer and click the "test" button.
You should get a test page.


Uninstalling a printer:

Use the Print Manager.  Select the printer.  Click "delete".  This will leave 
an entry in your cap.printers file, which you can safely ignore.  If you 
install a new printer with the old UNIX printer name, the installation script 
will delete the old entry.


Using CAPinterface:

From the WorkSpace:
Use the IRIX Print Manager to make it the default printer.  Select the icon
of the file you want to print (text, RGB, TIFF, FIT, or PostScript). Choose
"print" from the right button menu.

Command Line:
Pretty much like any other lp printer, with a few additions.  See the lp and
lptops man pages. Options for lptops are sent to the printer with the -o
option to lp.

Additional command line options that I have added (also specified using
the -o option to lp):
-port[rait]: Print text or images in portrait orientation.
-land[scape]: Print text or images in landscape orientation.
-nowrap: Turn off line wrapping.
-wrap ##: Set the line wrap to ## columns.



Please send any questions, comments, or improvements to:


Russell Smith                    smith@cbrsgi.med.harvard.edu
Center for Blood Research            phone (617) 278-3275
Harvard Medical School                fax (617) 278-3131
200 Longwood Ave.
Boston, MA 02115
                                                            

