[comp.sys.sun] another problem on 386i w/ laserwriter II

bauman@shell.UUCP (Evan Bauman x8937) (01/25/89)

Here's one for the net that's baffling a bunch of us.

I've got a 386i/250  with 4.0 and an Apple Laserwriter II NT.  I do NOT
have Transcript since most of what I use outputs postscript anyway.  When
I bought the system, I thought I'd just be able to dump everything to lpr
without any filters.  After all, it used to work on my old 3/50 with SunOS
3.5!!  (snickering permitted)

The Laserwriter is connected to ttya with an off-the-shelf null-modem
cable.

Here's the entry in /etc/printcap.  We don't use ypprintcap.

lp|postscript|apple:\
	:lp=/dev/ttya:br#9600:\
	:lf=/usr/spool/lpd/lpd-errs:sd=/usr/spool/lpd:\
	:rw:fc#0000374:fs#0000003:xc#0:xs#0040040:mx#0:sf:sb:

You'll notice that this is pretty much what Sun includes with SunOS 4.0 -
I've just stripped out the filter entries.

I had some Framemaker output (actually the manual for Tooltool), so after
I set everything up, I lpr'er the docs.  The printer light blinked for a
while, but nothing ever came out of the printer.  So I RTFM'ed in the
section on installing printers in the sysadmin guide.

(stty 9600; cat <frame doc>) > /dev/ttya

Lo and behold, out came the Tooltool documentation!

A problem with /etc/printcap??  Not necessarily...

I also use Lotus Manuscript in the DOS window on the 386i.  This has a
postscript driver built in.  About 75% of the time, when I print from
Manuscript, it works.  The rest of the time, the printer just blinks.  So
I compared the postscript output from Manuscript with the Frame output.

Framemaker starts with:

%!
%%Pages: (atend)
%%DocumentFonts: (atend)
%%EndComments
%
% Frame Maker PostScript Prolog 1.11, for use with Maker 1.11
% Copyright (c) 1986,87 by Frame Technology, Inc.  All rights reserved.
%

Manuscript starts with:

^D%!PS-Adobe-2.0
%%DocumentFonts: (atend)
%%Title: M:\\MSDATA\\AICHE.DOC
%%Creator: Lotus Manuscript

and ends with:

%%Pages: 1
%%DocumentFonts: 
%%+ Times-Roman
%%+ Times-Italic
%%EOF
^D

I've heard before that the CTRL-D's in postscript files produced by PC
software will cause problems.  Only here, they seem to help!!  I've
contacted Adobe who claimed that the CTRL-D's are just EOF markers and
really shouldn't be there.  They also claimed that the tty driver in 4.0
was buggy and might be choking on the CTRL-D's.  As always - fixed in
4.0.1.  So my question is this - can I/should I modify printcap somehow to
account for this CTRL-D discrepency?  Are these characters confusing my
laserwriter and/or lpr??  Or should I just ante up the $3K to Adobe for a
site license for Transcript (something we'll probably need anyway!)

Thanks in advance.

	Evan Bauman
	Shell Development Co.
	Westhollow Research Center
	bauman@shell.uucp
	bauman%shell.uucp@sun.com
	713-493-8937 (call collect if you have a solution!)

robert%shangri-la@gatech.edu (Robert Viduya) (02/02/89)

This is the wrong newsgroup for this, but I've seen a number of queries on
here about control-D's in PostScript files and how to talk to a PostScript
printer over a serial line.  I'm getting tired of answering each via mail,
so I thought I'd just post the info.  Anyway, here's the scoop on ^D in
PostScript files being sent over serial lines to a PostScript filter.
This information works on an Apple LaserWriter+ and IINTX and I presume it
will work with any true Adobe PostScript printer that has a serial
interface.

Besides the Xon/Xoff flow control protocol, PostScript printers support a
"job" protocol.  Essentially it's this:

	o Each job sent to the printer must be terminated with an ascii EOT
	  (that's a control-D to us peasants).  This character tells the
	  printer to reclaim all memory and any other resources used by the
	  job, as well as flushing any PostScript operators that were defined
	  by that job.  It essentially does a soft-reset in preparation for the
	  next job.
	o The PostScript printer is NOT necessarily ready to process another
	  incoming job after the ^D has been received.  It may still be
	  working on the current job.  It is NOT a good idea to start sending
	  another job down the line until the current job has completely
	  finished printing.  Doing so sometimes messes up the interpreter.
	  At the very least, it takes away memory from the current job so
	  that the incoming one can be bufferred up.  If a job is terminated
	  with a control-D, the printer will echo that control-D back up to
	  the host when it has completely finished processing the current
	  job and is ready to accept the next one.

I've gotten a few unix machines around here to talk reliably with
LaserWriter+'s and NTX's.  I wrote a program that did the following:

	o Open the tty port and set the tty modes to handle Xon/Xoff flow
	  control, with no other control characters recognized (including
	  the ^D); set proper baudrate, 8-bits, no parity, single-character
	  I/O (cbreak for BSD, VMIN=1/VTIME=0 for SysV).
	o Fork off a child that does nothing but read the tty port, putting
	  all output into a file.  I just print the file as text after each
	  job; some PostScript programs generate messages that the user needs
	  to be notified about.  It's also possible to examine these messages
	  looking for "Paper Out" and other such printer error messages.  The
	  important thing is that the child does not exit until it sees a
	  control-D.
	o The parent, in parallel with the child's processing, sends down
	  the PostScript file to the printer, following it with a control-D.
	  It also filters out any imbedded control-D's in the file.  When
	  the file has been completely sent, it then waits on the child before
	  terminating and allowing the spooling system to start sending the
	  next job.

And that's essentially it.

	robert
--
Robert Viduya					   robert@shangri-la.gatech.edu
Office of Computing Services
Georgia Institute of Technology					 (404) 894-6296
Atlanta, Georgia	30332-0275

[[ I hope we've heard the last of it, as well.  You're right:  this really
isn't the right list.  For Usenet people, there is "comp.lang.postscript".
Unfortunately, the Internet mailing list "Info-Postscript" isn't running
anymore.  --wnl ]]