Printing to file with CUPS.

Kurt Pfeifle kpfeifle at danka.de
Thu Aug 10 00:44:11 PDT 2006


Piotr <piotrwie at gmail.erase-me.com> wrote (Wednesday 09 August 2006 15:42):

> I almost immediately (after ca. 2 hours of digging) found that 
> default package doesn't have any file output ability.

Not quite true. 

It's just not enabled by default for security reasons (because it is 
*very* simple, and meant to serve for debugging purposes only; it 
could easily be used for DoS attacks and worse things if it is there
in multi-user environments). 

To enable it, use

   FileDevice Yes

(in cupsd.conf) and you'll have "print to file" support. Then install 
your "psfileprinter":

   lpadmin -p psfileprinter -v file:/tmp/my-ps-files -E -P /path/to/PPD

Create the target directory:

   mkdir /tmp/my-ps-files

For the PPD you'd need to use one that is meant for a PostScript 
printer. To avoid inserting too much useless printer-specific code 
into the file, use a very generic one. (The one from an old version 
of Adobe Acrobat Distiller is fine).

(If you need to create PostScript exactly like it will be going to 
your PS printer, use the same PPD as you'd use for that printer.
Same for a PCL printer.)

> Googling  
> a lot helped me here - I found some "pdf file backend".

Was it the one at

  http://printing.kde.org/downloads/

Simple as it is, that does usually work fine... You'd copy it to
/usr/lib/cups/backend/, make it world executable and rename it to 
"pdf". Then you restart cupsd, install the PDF printer:

  mkdir /tmp/my_PDFs
  lpadmin -p pdfmaker -E -v pdf:/tmp/my_PDFs -P /path/to/PPD

and you're done. (Again, for the PPD, use a generic one like the
Acrobat Distiller PPD).

> At this moment I  
> learned what backend is. I've put it into the /var/lib/cups/backends 

CUPS uses "/usr/lib/cups/backend/", not *var* and not backend*s*.

> directory, restarted cupsd with 
> pkill -SIGHUP cupsd (which I assumed works - worked)... Someone 
> told at this mail that this was removed due to security reasons... 

Works for my self-compiled CUPS here...

Cheers,
Kurt




More information about the cups mailing list