A Samba Printer that will Email you a PDF.

OK, just initial notes. This has been implemented on RedHat and Debian (as that's what we use - sorry guys!), and uses LPRng. See CUPSNotes for a CUPS version of this system.

First, I defined a queue in printcap like so:


Next, I created the pdffilter script as follows:


PDF=`which ps2pdf`
MUA=`which mutt`
ADDRESS="`echo $1 | sed -e 's/-A//' | awk -F@ '{ print $1 }'`@$DOMAIN"
CMDLINE="`echo $*`"

cat > $TEMPFILE1


rm -f $TEMPFILE1
rm -f $TEMPFILE2
rm -f $TEMPFILE3

/usr/share/printconf/body is just the message you want to email your users. Feel free to experiment with PDFSETTINGS, I have found the /prepress one seems to give the best quality output.

Note: For Samba setups using winbind, you will end up with emails going to DOMAIN/ A fix for this (awk/optimisation geeks, condense at will!) is:

ADDRESS="`echo $1 | sed -e 's/-A//' | awk -F@ '{ print $1 }' | awk -F/ '{ print $2 }'`@$DOMAIN"

For your windows clients, just add a postscript printer (any will do - I use Kodak ColorEase PS - no reason, just out of habit), and point it at \\servername\pdfwriter.

The job will be emailed to the same name the print job was submitted under, so ensure there are aliases for these if they differ from your email address namespace. This also assumes you have mutt, an mta, and ps2pdf installed.

Hope this is useful.

NOTE: This solution also works under other distributions as long as you use LPRng not standard bsd lpr is installed. We are using debian (just enter "apt-get install lprng") - our printcap file looks like this:


Part of CategoryPrinting

The following authors of this page have not agreed to the WlugWikiLicense. As such copyright to all content on this page is retained by the original authors.
  • MarcelNoe
The following authors of this page have agreed to the WlugWikiLicense.

PHP Warning

lib/plugin/WlugLicense.php:99: Warning: Invalid argument supplied for foreach()

lib/plugin/WlugLicense.php:111: Warning: in_array() [<a href=''></a>]: Wrong datatype for second argument

lib/plugin/WlugLicense.php:111: Notice: Undefined variable: ignore_authors