[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Magicfilter from potato



*- On 22 Jun, Didi Damian wrote about "Magicfilter from potato"
> Hello !
> 
> I'm trying to print to my stupid HP DeskJet 722c win#@## printer using
> the pbm2ppa conversion program (in short it takes PS and converts into
> PPA,poor man's PCL). I've been printing successfully in RH and SuSE
> before but can't get it to work since I switched to potato.I'm only able
> to print PS from command prompt with this script:
> 
> cat $1 | gs -sDEVICE=pbmraw -q -dNOPAUSE -r600 -sOutputFile=- - | \
> pbm2ppa - - >/dev/lp0
> 
> Thanks to Michael Merten I can print ascii too but i would like to setup
> magic or apsfilter. These are the two filters I tried: (very lengthy,
> skip to the end for errors)
> 


The fpipe facility you were using writes the input to a file(whos
location is set to $FILE in the filter)and then the command line would
use that as its source.  Then the magicfilter filter would then pass it
back to the magicfilter filter(because it is defined as a pipe) until it
matches a filter or ffilter facility. So you should do,

# PostScript
0       %!              fpipe gs -sDEVICE=pbmraw -q -dNOPAUSE -r600 -sOutputFile=- $FILE
0       \004%!          fpipe gs -sDEVICE=pbmraw -q -dNOPAUSE -r600 -sOutputFile=- $FILE 
 
Or just use the pipe facility since gs doesn't need to seek the input

# PostScript
0       %!              pipe gs -sDEVICE=pbmraw -q -dNOPAUSE -r600 -sOutputFile=- -
0       \004%!          pipe gs -sDEVICE=pbmraw -q -dNOPAUSE -r600 -sOutputFile=- - 


Then your ppm filter facilty will catch these as they are fed back into
the filter as pbm

 0       P4\n            filter /usr/local/bin/pbm2ppa -s a4 - - 


I can't test this but it looks good to me. =)

-- 
Brian 
---------------------------------------------------------------------
Mechanical Engineering                              servis@purdue.edu
Purdue University                   http://www.ecn.purdue.edu/~servis
---------------------------------------------------------------------



Reply to: