Subject: GhostScript and printing?
To: None <netbsd-help@netbsd.org>
From: Richard Rauch <rkr@olib.org>
List: netbsd-help
Date: 07/21/2003 07:36:39
For concreteness, the fast machine is "hermes", and the machine that now
hosts the printer is "prometheus".
I have two issues. One is a WRINKLE (about 35 to 40 lines down) that I
might need to send-pr if it's not a known bug/feature. The other is an
extra page that gets ejected when I print, after changing how the printer
is connected. The general runup to these issues is:
For a number of years, I have happily printed via GhostScript to a directly
attached laser printer (non-PostScript capable, alas).
Since parallel port handling is a bit yucky, I've been using ulpt0 for this.
Since I only have 2 USB ports on phermes, and have occasionally had
to swap connections, I decided to relocate the printer to pprometheus,
which isn't using any USB devices. Ppromtheus is okay, but I'm used to fast
GhostScript execution, and I think that pprometheus is slow enough to make
a difference.
So, here's what I have done:
lpt -> of=... (GhostScript filter) -> pprometheus -> ulpt -> printer
This works with a bit of trickery. It seems that lpd doesn't honor BOTH
filters AND remote printing for a single printcap entry. So my local "ps"
printcap entry invokes
of=...
AND sets lp=/dev/null.
Then the output filter runs:
gs ... | lpr -Puraw
("uraw" is LOCALLY defined to point to pprometheus's raw ulpt0 printcap
entry. "uraw" is what pprometheus calls its untranslated ulpt0 (no EOL
handling, etc.) access, and that is exported to my LAN. "uraw" is also
what phermes calls it, though from phermes's point of view, "uraw" is
no longer discernably USB-related...)
Okay, that's the setup. I hope that it's clear. (^&
Printer is on pprometheus.
GhostScript and various PostScript-using applications are on phermes.
After a bit of futzing around, I have found a new (to me) wrinkle:
If a printcap entry ends in a line with :\ (or just \ ?), it affects
the handling of some of the options. (This came up because my FIRST
effort to do this was to use BOTH an of= entry AND an rm=...:rp=... entry.
The rm=...:rp=... was on the last line and was apparently disabling the of=
capability, so I commented out the last line. But I left the trailing \ on
the previous line. Is this a KNOWN BUG/FEATURE, or should I send-pr it?)
After taking a stab that the extra \ at the end of the prior line was a
problem, I removed both the trailing \ and the commented-out rm=...:rp=...
line. Now it MOSTLY works as I want, with ONE glaring little problem:
After EVERY PRINT JOB, a blank page is ejected.
I *do* have :sh: in phermes's ps, phermes's uraw, and pprometheus's uraw
printcap entries.
Any ideas?
The GhostScript filter on phermes looks like this:
/~~~
#!/bin/sh
#/usr/pkg/bin/gs -sDEVICE=pxlmono -q -sOutputFile=- /usr/local/libexec/printer-filters/margins.ps -
/usr/pkg/bin/gs -sDEVICE=pxlmono -q -sOutputFile=- - | lpr -Puraw
\___
...and up to the pipe-symbol, this is IDENTICAL to what I've used for years.
It has only started printing bogus trailing pages since I switched the
printer around this morning...at which point I added the pipe.
The printcap entries are as follows (excerpted for just the entries in
question):
/~~~ phermes
uraw|raw|lp raw|raw local printer:\
:lp=:sd=/var/spool/lpd/raw:/lf=/var/local/lpd/raw:\
:sh:mx#0:\
:rm=pprometheus:rp=uraw:
ps|PostScript printer:\
:lp=/dev/null:sd=/var/spool/lpd/ps:lf=/var/log/lpd/ps:\
:sh:mx#0:\
:if=/usr/local/libexec/printer-filters/ps:
\___ phermes
/~~~ pprometheus
uraw|raw|lp raw|raw local printer:\
:lp=/dev/ulpt0:sd=/var/spool/lpd/uraw:/lf=/var/log/lpd/uraw:\
:sh:mx#0:
\___ ppromtheus
(Moral of the story: Yes, it would probably be better if I just had a
PostScript-capable printer with ethernet built in. (^& But that's not
what I've got. This setup *should* be workable. And disparaging non-
PostScript printers aside, I'm getting the feeling that there may be
some problems with if/of handling in general, which may affect people
NOT living in homogenized PostScript-everywhere worlds, even if their
printers speak PostScript.)
For the next few days, I suppose that I'll just live with the extra
pages being printed. I'd like a software fix, but if need be I can
just go grab a USB hub and extension cable, and reconnect the printer
to phermes. Everthing worked correctly, that way. (^&
--
"I probably don't know what I'm talking about." http://www.olib.org/~rkr/