Using lpr for plot spooling - we use it exclusively

Ray E Saddler III ray3rd at ssc-vax.UUCP
Thu Mar 30 12:13:19 AEST 1989



In article SunSpots Digest, v6n136 William LeFebvre @ The Internet
asks:

> Has anyone used lpr as a means of spooling files to a plotter? 
> ...
> What I would like to do is to use lpr to spool the files to the
> plotter.  Does anyone know if this is possible and if it is - how
> difficult would it be [do I have to write an output filter?]?

First of all, the answer is YES you can spool to a plotter with the
Berkely spooler,  and it can done quite easily.  

I administer a network that includes:

o	56 Cimlinc CAD workstations (4.2 & 4.3 BSD UNIX)
o	2 Calcomp 5744 36" 400 DPI electrostatic plotters
o	3 Apollo domain-ix rings bridged to the ethernetwork
o	2 Imagen laser printers
o	various other boxes and peripherals



We strap each of the plotters to a Cimlinc file manager due to lots
of disk space for spooling losts of huge plot files.  Each plotter
is used by all the Cimlincs and soon the Apollos.

One plotter supports BOND, the other supports VELLUM.  Our BOND
plotter generates he average of 1200 engineering drawings a month,
while the VELLUM plotter averages 700 a month.  

The laser printers are hosted by Apollo systems. 


Each workstation on the net has the queues:

o	calcomp_bond 
o	calcomp_vellum



These queues are defined in the workstations' /etc/printcap:

calcomp_bond|lp:lp=:rm=calcomphost:rp=calcomp_bond:sd=/usr/spool/calcomp_bond:

calcomp_vellum|lp:lp=:rm=cadsahost:rp=calcomp_vellum:sd=/usr/spool/calcomp_vellum:



Each workstation on the net has a script called 'calcomp'.  It does
a few error checking things, then sends the file thru the lpr pike
like this:

       lpr -P$QUEUE $MAIL -g -s -a"$ARG" $FILE

Note the -a option.  Our Sun Cimlincs do not support this option so
things like scale, rotate, automap cannot be passed as options to
the plotter.  Older Cimlinc workstations (in non-Sun boxes) have
this option and is heavily used (are you listening SUN?)



On the file manager end, the lpr spooler stacks up the files in the
directories: 

o	/spool/calcomp_bond 
o	/spool/calcomp_vellum



The printcap entries look like this:

calcomp_bond:lp=/dev/ca907:rw:rm=calcomphost:sh:sd=/spool/calcomp_bond:\
gf=/usr/local/bin/ca907.sh:lf=/spool/calcomp_bond/errors:

calcomp_vellum:lp=/dev/ca907:rw:rm=cadsahost:sh:sd=/spool/calcomp_vellum:\
gf=/usr/local/bin/ca907.sh:lf=/spool/calcomp_vellum/errors:



As for plotting to Imagen laser printers, each workstation has a
printcap entry that looks like this:

impress2imagen|lp:lp=:rm=bsdgate:rp=impress2imagen:sd=/usr/spool/impress2imagen:



On the Apollo end, the lpr spooler stacks up the files in the
directory: 

o	/usr/spool/impress2imagen



The printcap entry on the Apollo is:

impress2imagen|lp:rw:rm=bsdgate:sh:sd=/usr/spool/impress2imagen:\
pc=/usr/bin/impress2imagen.sh:lf=/usr/spool/impress2imagen/errors:

(The 'gf' entry didn't work for me on the Apollo, so I used 'pc'.)

I'm not sure what the Sun entry is, anybody know?  (I havn't used a
Sun as printer host)



Now for the drivers.  The Cimlinc file managers have a plotter
driver called ca907, and is pre-driven by a script called
/usr/local/bin/ca907.sh, as noted in the printcap file.

The ca907.sh script does some logging, and puts a plot label before
and after each plot, to indicate who generated the plot, when it
started and when it finished.

The Apollo systems are equiped with a script we call
/usr/bin/impress2imagen.sh.  This script acts as a lateral transfer
to a different print queue spooler where the files end up in the
/sys/print/impress directory.


I realize this is a rather vague answer to your question, but the
implementation of spooling queues for the Berkely lpr system is
almost too easy!


I use the lpr system to manage data transfer for drawing dataset
release and database management, as well as plot to several devices.


I've often thought of writing a paper about the lpr system and call
it:  

		Big fun with the Berkely Spooler


Until then, anybody else who has in-depth experience with the lpr
system, share your knowledge, I could use some more tips and
tricks
-- 
| Ray E. Saddler III       |    __  __ __       __ |   Path: ..!ssc-vax!ray3rd |
| Boeing Aerospace         |   / / / //   //| //   | From: ray3rd at ssc-vax.UUCP |
| P.O. Box 3999 m.s. 3R-05 |  /-< / //-  // |// _  |---------------------------|
| Seattle, Wa.  98124  USA | /__//_//__ //  //__/  |  VoiceNet: (206) 657-2824 |



More information about the Comp.unix mailing list