[Samba] Pdf printer by mail with samba 3.0.9-1

Adam Tauno Williams adam at morrison-ind.com
Tue Dec 7 14:26:14 GMT 2004


> This is what I use, it is a simple script called from smb.conf. I have 
> saved the script in /usr/bin and made it executable.

And here is what we use:

---------------------
#!/bin/sh
# Simple script to convert a specified postscript file into a PDF
# document # and place it in a location that is shared by the Samba
# server. #
# Arguments:
# 1st - The name of the spool file
#

DATE=`date +%b%d-%H%M%S`

# Directory in which to place the output i
# Be sure this directory
# exists and is writable by the user that Samba
# is running as (for
# example, the nobody user)
OUTDIR=/tmp

/usr/bin/ps2pdf14  $1 $OUTDIR/$DATE.pdf

# You can play with lots of options to vary the quality, size, etc...
# of the generated PDF
#ps2pdf
#  -sPAPERSIZE=letter \
#  -dMaxSubsetPct=100 -dCompatibilityLevel=1.3 \
#  -dSubsetFonts=true -dEmbedAllFonts=true \
#  -dAutoFilterColorImages=false \
#  -dAutoFilterGrayImages=false \
#  -dColorImageFilter=/FlateEncode \
#  -dGrayImageFilter=/FlateEncode \
#  -dMonoImageFilter=/FlateEncode \
#  -dPDFSETTINGS=/printer \
#   $1 $OUTDIR/$DATE.pdf

echo "Attached is the file you submitted for PDF conversion" |
/usr/local/bin/uuenview -b -a -s "$DATE PDF Conversion Result " -m
"$2 at morrison-ind.com"  $OUTDIR/$DATE.pdf

rm $OUTDIR/$DATE.pdf
-------------------------


Adam Tauno Williams
Network & Systems Administrator
Morrison Industries
Grand Rapids, Mi. USA


More information about the samba mailing list