Subject: Re: SUBSCRIBE

From: Bill Richards <[email-masked]>
Date: Wed, 24 May 2000 17:40:28 GMT

I'm sorry to waste bandwidth with what I am sure is a trivial
question. I have netatalk up and running fine on a RH6.2 system.
My question is printing. We have a few non-PS HP Appletalk printers
I need to access. I can papstatus them and aecho works fine, so
we're connected OK. I'm having filter problems, though and don't
quite have my printcap set up right. I've seen several examples
from the web pages and mail archive, but they all looked like
PS LaserWriters and such. I need to get GS in the path. Is
there a FAQ I'm missing from somewhere? Thanks for any pointers.

Regards,

-bill richards-

---

From: Patrik Schindler <[email-masked]>
Date: Thu, 25 May 2000 14:11:17 +0200

At 17:40 Uhr +0000 24.05.2000, Bill Richards wrote:

>we're connected OK.

HP drivers are quite dumb. They try to talk to the printer (or spooler, if set up right with gs), won't get a response and bomb. So you'll have to use a driver  which likes Spoolers more: LaserWriter. It generates PostScript, which you must RIP to a bitmap, the printer will understand.

Will someone add this to a FAQ, please?

> I'm having filter problems, though and don't
>PS LaserWriters and such.

It's quite easy.

Step 1: Make PS-Printing from unix work.
Setup: AppleTalk connected printer, unix box with PS-Files.

- Set up printcap (example follows):
dw|HP DeskWriter:\
    :sd=/var/spool/lpd/hpdw:\
    :lp=/dev/null:\
    :of=/usr/local/printerfilter/ps2dj500:\
    :mx#0:sh:

sd is the spooldir, lp is a dummy, because the data will be delivered via the outfilter of and may be discarded afterwards.
For details see printcap(5).

- create the directory as mentioned with the sd tag:
drwxr-xr-x   2 lp       lp           1024 May 11 21:36 /var/spool/lpd/hpdw/

Important: chown(1), chgrp(1) the directory to lp!

- create the neccessary information so pap can forward the job to the destination:
cat > /var/spool/lpd/hpdw/.paprc
DWPatrik:DeskWriter@*
^D

Indeed, you need to fill in your own printer. See nbplkup(1) how to acces the exact information of your printer name as well as nbp_name(3) for conventions to nbp-naming. nbp (name binding protocol) is the equivalent to DNS you know from IP.

- create the outfilter as mentioned with the of tag:
#!/bin/sh
trap '' SIGINT
#
DDICT="-dSAFER -dNOPAUSE -dBATCH -dSHORTERRORS -dQUIET"
SDICT="-sPAPERSIZE=a4 -sDEVICE=cdjmono -sOutputFile=-"
OPTS="-q"
#
/usr/bin/gs $OPTS $DDICT $SDICT - |/usr/local/bin/pap -E -e -sstatus
#

See gs(1) for more information about GhostScript options.
Use gs --help to get a list of supported devices (printer driver modules in gs).
See pap(1) for what pap does. -E has been an undocumented parameter in pap:

       -E     Close  the pap-connection immediately after the job
              has been sent. Don't wait for EOF from the printer.
              (Works  around  some buggy HP pap implementations).
              WARNING this may break your printer accounting.

- re-start your spooler now:
lpc restart dw

See lpc(8) for details.

Step 2: add spooling from the mac via /usr/local/etc/papd.conf:

DW-Spool:\
    :pr=| lpr -Pdw -h:\
    :op=poc:

- re-start papd to show up the new spooler in your chooser:
kill `ps auxw |fgrep papd |fgrep fgrep | awk '{print $2}'`
/usr/local/sbin/papd

See papd(8) for details.

Voila, there you are with a self-made PS-RIP for your printer. Don't expect good quality results as with the HP-made drivers: They use diffusion dither which gives better results in many cases. GhostScript doesn't support diffusion dither at all (to my knowledge, correct me if I'm wrong).

Perhaps you'll have to fiddle with PPD files for best results. Unfortunately, PPDs are only available for PostScript printers (as *P*ostScript *P*rinter *D*escription states) and it's hard to find somthing appropriate. If I have little spare time, I'll fiddle with a generic PPD...

Hope, that helped.

:wq! PoC