This is a filter for lpd (both the traditional and LPDng are supported) which takes a postscript file and converts it to .pdf format. It then mails the document back to the user (only tested on a SMB network and on a local system).
First, you need to edit pdfwriter.pl, it holds some important parameters
Secondly you'll have to create a spool directory in /var/spool/ldp/ named (in my case) pdfwrite with the right permissions: user:group is lp:lp and it should only be writeable to user lp.
Finally can use this entry in /etc/printcap:
pdfwrite:\
:lp=/dev/null:\
:sd=/var/spool/lpd/pdfwrite:\
:if=/home/erik/src/pdfwriter/pdfwriter.pl:
Edit it to reflect the actual places you've put the script and the spool directory.