Re: hptools and magicfilter
Mario Filipe wrote:
>
> On Wed, 26 Nov 1997, Brian K Servis wrote:
>
> OK
>
> I tried this but i don't think i have it right so i'll send the files in
> question for you to have a look, if that's ok with you :
>
> /etc/printcap
> #econo mode
> lpecono|HP Deskjet 660C econo:\
> :lp=/dev/printer:sd=/var/spool/lpd/hpdj660c:\
> :sh:pw#80:pl#72:px#1440:mx#0:\
> :if=/usr/sbin/dj550ce-filter:\
> :af=/var/log/lp-acct:lf=/var/log/lp-errs:
> # letter quality
> lp|dj|hpdj660c|HP Deskjet 660C:\
> :lp=/dev/printer:sd=/var/spool/lpd/hpdj660c:\
> :sh:pw#80:pl#72:px#1440:mx#0:\
> :if=/usr/sbin/dj550c-filter:\
> :af=/var/log/lp-acct:lf=/var/log/lp-errs:
>
> /usr/sbin/dj550ce-filter
> #! /usr/sbin/magicfilter
> #
> # Magic filter setup file for HP DeskJet 500 series color printers with
> # both black and CMY cartridges installed
> #
> # This file has been automatically adapted to your system.
> #
>
> # PostScript
> 0 %! filter /usr/sbin/econogsc $FILE
> #0 \004%! filter /usr/bin/gs -q -dSAFER -dNOPAUSE -r300
> -sDEVICE
> =cdj550 -sOutputFile=- -
>
> # TeX DVI
> [...]
>
> /usr/sbin/econogsc
> #!/bin/bash
> # called as: econogsc <psfile>
> # send hpset hp escape codes to a tmp file
> /home/mjnf/hptools_1.2.3/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.$$
>
> /usr/sbin/dj550c-filter
> #! /usr/sbin/magicfilter
> #
> # Magic filter setup file for HP DeskJet 500 series color printers with
> # both black and CMY cartridges installed
> #
> # This file has been automatically adapted to your system.
> #
>
> # PostScript
> 0 %! filter /usr/bin/gs -q -dSAFER -dNOPAUSE -r300
> -sDEVICE
> =cdj550 -sOutputFile=- -
> 0 \004%! filter /usr/bin/gs -q -dSAFER -dNOPAUSE -r300
> -sDEVICE
> =cdj550 -sOutputFile=- -
>
> when i do ls | /usr/sbin/dj550c[e]-filter I get the very same file.
>
> What did i do wrong ?
No problem. First of all, the reason 'ls | /usr/sbin/dj550ce-filter' doesn't
do anything to the text is because ls doesn't output postscript, it outputs
text (which the filter doesn't do anything with).
Now, your script /usr/sbin/econogsc should only need to do this:
#!/bin/bash
# called as: econogsc
# output hpset hp escape codes to stdout
/home/mjnf/hptools_1.2.3/hpset -c econo
# now output the ghostscript hp escape codes
/usr/bin/gs -q -dSAFER -dNOPAUSE -r300 -sDEVICE=cdj550 -sOutputFile=- -
That's it! Why create temp files? There's no need for that. Now, your filter
entry should be this:
0 %! filter /usr/sbin/econogsc
Again, you don't need to pass the filename. Everything is done with *pipes*.
--
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: