Subject: Re: Netatalk & Ghostcript
To: Nathanael Lierly <lierly@mauigateway.com>
From: Frederick Bruckman <fb@enteract.com>
List: port-mac68k
Date: 07/06/1999 11:16:04
On Mon, 5 Jul 1999, Nathanael Lierly wrote:

> if you do get any good info on this I would be really glad to hear about
> it. I think ghostscript does this stuff but I just could not for the life
> of me figure out how to make it work.
> 
> On Mon, 5 Jul 1999, Matthew Reilly wrote:
> 
> > I've decided to replace the Personal LaserWriter NTR as it is beginning
> > to show it's age. I've decided to replace the LaserWriter with an Epson
> > 740. I'm interested in using ghostscript as the Postscript RIP and I
> > want to use PAP to have it show up as a LaserWriter in the chooser. I'm
> > pretty sure this is possible but I'm at a little bit of a loss as to how
> > to start out. Where do I specify that the printer is hooked up to the
> > modem port? And where do I invoke Ghostscript? If anyone know of a page
> > with this kind of info, please point me to the URL.

Ghostscript will translate postscript to the Epson's native language.
Assuming you've already installed postscript from the package system,
you can create a filter script and invoke it from /etc/printcap. The
script can be as simple as this:

/usr/pkg/bin/gs -q -sOutputFile=- "@stc.upp" /dev/stdin -c quit

choosing an appropriate driver from /usr/pkg/share/ghostscript/5.5/.
The upp "drivers" are simply commented text files containing
parameters for the universal driver. There are other, non upp drivers,
too. Check out "gs -help".

You might also be able to get some ideas for scripts and printcap
entries from the mailing list archives. There are also binary filter
packages you can get from linux web-sites and such.

My printcap entry for the Stylus Color Pro looks like this:

lp|direct|Epson Stylus Pro:\
        :lp=/dev/tty01:sd=/var/spool/lpd:lf=/var/log/lpd-errs:\
        :br#57600:pc#500:xc#0177777:ms=-parity,ixon,-opost:sh:\
        :if=/usr/local/libexec/lpr/stc-if:

Half of it is just baggage, buy why mess with success? The key entries
are the baud rate, the -opost (so 8 bit data gets passed to the
printer), and the location of the above mentioned input filter. 

Bill Studenmund put several sample printcap entries to
<ftp://ftp.macbsd.com/pub/NetBSD/contrib/gs/new.sample.printcap>,
and there have been other samples posted to this mailing list.

If you're entry is right, you should be able to start "lpd" as root,
and then "lpr any-ps-file.ps" to print it.

To get papd to work, you need to get a Printer Description file from
Apple's web site. Birmy and Adobe might have some, too. Here's mine
again: I have a file called "Stylus Pro.PPD" in /usr/pkg/etc, and 

fredb-> cat /usr/pkg/etc/papd.conf
Epson Stylus Pro:\
        :pr=lp:pd=/usr/pkg/etc/Stylus Pro.PPD:

This simply tells papd to offer the settings in "Stylus Pro.PPD" to
the other Mac, and to use the "lp" printcap entry to actually print.

Now run /usr/pkg/etc/rc.atalk and watch for errors. (Eventually, add
that to /etc/rc.local, and also change lpd=no to lpd=yes in
/etc/rc.conf). If you get none, then the printer should now appear in
the Mac's chooser. If not, you should at least see something like this
on the NetBSD side:

fredb-> nbplkup
                         corwin:AFPServer 65280.24:130
               Epson Stylus Pro:LaserWriter 65280.24:128
                         corwin:netatalk 65280.24:4
                         corwin:Workstation 65280.24:4
                         Random:ARA - Client-Only 65280.156:2
                         Random:  Macintosh 65280.156:252
                         Random:Workstation 65280.156:4

In my case, entropy had set in on my Mac, and the printer didn't
actually show up until I downloaded and installed the latest
LaserWriter driver from Apple's web site. Since you're using your
LaserWriter driver already, it might just work for you.