Printing to file with CUPS
From openSUSE
There are times one have to use an application that don't know how to print to a file, gvim being the most common.
Printing to a file is a way to get a Postscript file, then probably a pdf one with ps2pdf.
Workaround
The first way to get something, if your starting is some sort of pure text is to begin with "a2ps" (for ASCII to PostScript, I guess).
Old solution, but does it work now?
You can find here http://www.josvisser.nl/lww/lww_pdf.html a very cool script using a2ps and ps2pdf to create a pdf printer, but I guess this works for lpd, but may not for CUPS (not tried).
True CUPS solutions
A very interesting but non-conventional solution is to use Alambic. This way you get an http converter.
An other simpler solution if you use Kde is to configure Konqueror to display the file internally (see file association, plain text in Kde config), Konqueror knows very well howto print to a pdf file through kprinter.
In many applications (mozilla, for example), you can configure Kprinter to be one of the standard printers and get all the fuzz for free.
It may be possible also to use the smbprngenpdf samba utility.

