[ale] Setting up pseudo-printer

Dow Hurst dhurst at kennesaw.edu
Mon Jan 19 12:02:00 EST 2004


Try using this script as the control for what you want to do:

!#/bin/bash
/usr/local/bin/johnsconvertscript $1 | display &;
exit


You call it something like disp.sh so if it lives in 
/usr/local/bin you would "disp.sh image.txt", it would pass 
the image.txt file to the convert script you have, and pipe 
it into the display command, then exit.  It's not what your 
asking for though.  I don't know how to add this as a pseudo 
printer into CUPs.  Good question though.  If I find out how 
I'll post it.  The above could save you alot of typing.  You 
could alias /usr/local/bin/disp.sh to "cdi" so that "cdi 
image.txt" would act the same way.
Dow


John Mills wrote:
> Dow -
> 
> Thanks very much for your note and suggestions.
> 
> On Fri, 16 Jan 2004, Dow Hurst wrote:
> 
>  [...]
> 
>>However, even the lp system can use filters, so a little 
>>searching might find a HOWTO on setting a filter that would 
>>do what you want.  The Netpbm library is a powerful package 
>>for converting image files.  I looked at a tiff2ps package 
>>that looked very nice.  I don't have the link for that with me.
> 
> 
>>Am I understanding the question correctly?  Which is that 
>>you want to print an image?  Gimp will print images 
>>fantastically after you set it up for your printer.
> 
> 
> I guess my question was too indirect or not well put. I have a short 
> script that decodes a text-encoded image file (typically a JPEG) and pipes 
> it to 'display' which puts it on my screen. I could use any utility that 
> could accept an image format at <stdin>; I just happen to be using 
> 'display'. This is exactly what I want it to do as though it were a 
> printer.
> 
> My question is:
>  How can I access this script so that 'lpr' will _use_it_ as though it
> were a printer. I want to invoke 'lpr -P viewer <file>' on the text file
> and just _see_ the image on the screen. No printed copy at all.
> 
> I was trying to put my script as a processing filter (a'la _ghostscript_)  
> with its text output (and errors) going to /dev/null, and its graphic
> output going transparently to the screen. The problem must be analogous to
> putting a printer filter on a stream being sent to a remote printer,
> except that text output is sent to /dev/null and the image is
> transparently redirected to the screen.
> 
> Any ideas?
> 
> 
>>John Mills wrote:
> 
> 
>>>I have a script to pipe through a decoding filter, and uses 'display' to
>>>show an image on the screen. For example, I can show an image with:
>>> % cat <encoded_jpeg_file> | /usr/local/bin/viewer_filter
> 
>  
> 
>>>I'm having some trouble setting this up as a printer, so that I could
>>>invoke it with [say]:
>>> % lpr -P viewer <encoded_jpeg_file>
> 
> 
> TIA.
> 
>  - John Mills
>    john.m.mills at alum.mit.edu
> 
> 

-- 
__________________________________________________________
Dow Hurst                  Office: 770-499-3428            *
Systems Support Specialist    Fax: 770-423-6744            *
1000 Chastain Rd. Bldg. 12                                 *
Chemistry Department SC428  Email:   dhurst at kennesaw.edu   *
Kennesaw State University         Dow.Hurst at mindspring.com *
Kennesaw, GA 30144                                         *
************************************************************
This message (including any attachments) contains          *
confidential information intended for a specific individual*
and purpose, and is protected by law.  If you are not the  *
intended recipient, you should delete this message and are *
hereby notified that any disclosure, copying, distribution *
of this message, or the taking of any action based on it,  *
is strictly prohibited.                                    *
************************************************************



More information about the Ale mailing list