[Sussex] Printing to file

Steve 'Dobbo' Dobson steve at dobson.org
Thu Jul 19 20:34:04 UTC 2007


Brendan

On Thu, Jul 19, 2007 at 05:28:58PM +0100, Brendan Whelan wrote:
> I am battling to get the correct syntax to print to file rather than
> send the output direct to a printer.
> 
> I have an RTF file that I want to print to PS and I have set up a
> printer called 2420 (an HP PS printer).
> 
> I have tried such things as:
> 
> lpr -P 2420 -o test.ps test.rtf
> 
> But all I get is an empty PS file.

From reading the man page on lpr(1) on my Debian box the -o option is
not for sending output to a file but for setting job options.  In the
-p option below it gives and example for one such option:

      -p ... is equivalent to "-o prettyprint" and is only useful when
            printing text files.

There are two options:

1. Configured the printer deamon to use a filter to process submissions
   and convert them into a format your printer understands.  Imagemagick
   is often used here to cope with different image formats, but it doesn't
   work with RTF.

2. Convert your file first into PS and then submit that to the printer.
   If the conversion program you use writes its output to standard out
   this can be done with a pipe:
    
       rtf2ps test.rtf | lpr -P 2420

   Note: replace rtf2ps with the converter of your choice.

Steve
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.lug.org.uk/pipermail/sussex/attachments/20070719/588c5dae/attachment.pgp 


More information about the Sussex mailing list