Re: hptools and magicfilter
Brian K Servis wrote:
>
> Mario Filipe writes:
> >
> >
[ initial problem text removed ]
> >
>
> That person was me.
>
> I think the problem is that the stdin to your myfilter, which can be
> anything, and the stdout from hpset, which is hp escape codes, are not
> of the same format and probably get misinterpreted by magicfilter and
> are probably not even appended to each other. You need to prepend the
> hpset output to the processed stdout of ghostscript and send them to
> stdout as one unit to the printer. This is my solution:
>
> /etc/printcap:
> # econo mode
> lpc|djc|hpdj660c|HP Deskjet 660Cse Color Econo:\
> :lp=/dev/lp1:sd=/var/spool/lpd/hpdj660c:\
> :sh:pw#80:pl#66:px#1440:mx#0:\
> :if=/usr/sbin/dj550c-filter:\
> :af=/var/log/lp-acct:lf=/var/log/lp-errs:
> # letter quality
> lpcl|djcl|hpdj660cl|HP Deskjet 660Cse Color:\
> :lp=/dev/lp1:sd=/var/spool/lpd/hpdj660cl:\
> :sh:pw#80:pl#66:px#1440:mx#0:\
> :if=/usr/sbin/dj550cl-filter:\
> :af=/var/log/lp-acct:lf=/var/log/lp-errs:
>
> /usr/sbin/dj550c-filter:
> #! /usr/sbin/magicfilter
> #
> # PostScript
> 0 %! ffilter /usr/local/lib/magicfilter/econogsc $FILE
> [rest of filter left out]
>
> /usr/local/lib/magicfilter/econogsc:
> #!/usr/bin/tcsh
> # called as: econogsc <psfile>
> # send hpset hp escape codes to a tmp file
> /usr/local/bin/hpset -c econo >! /tmp/prt.$$
> # append the ghostscript hp escape codes to that tmp file
> /bin/cat $1 | /usr/bin/gs -q -dSAFER -dNOPAUSE -r300 -sDEVICE=cdj550 -sOutputFile=- - >> /tmp/prt.$$
> # cat the tmp file to stdout
> /bin/cat /tmp/prt.$$
> # clean up
> /bin/rm /tmp/prt.$$
>
Why all the mess? Why not:
#!/bin/sh
/usr/local/bin/hpset -c econo
/usr/bin/gs -q -dSAFER -dNOPAUSE -r300 -sDEVICE=cdj550 -sOutputFile=-
--
Jens B. Jorgensen
jjorgens@bdsinc.com
--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-request@lists.debian.org .
Trouble? e-mail to templin@bucknell.edu .
Reply to: