Hi all,

I  have this working well and thought I'd share the setup.

Thanks to Angus for the following (I hadn't even thought of it)

> How about trying adobe's "universal postscript windows driver"?
>
http://www.adobe.com/support/downloads/product.jsp?product=pdrv&platform=win

The adobe driver works great except for one thing, it;s monochrome.
I have much better results of I use the "Lexmark Optra Color 1200 PS"
driver.
The choice of the Lexmark wasn't a particularly scientific one, it was just
a color
printer that I'd had no problems setting up some time ago.

Anyway, here is my script (no apolgies for it's technical merits)
Available at http://www.cyberpro.com.au/downloads/scripts/pdfmailer.txt
-------------------------------------------------
#!/bin/sh

# This script is designed to accept a postscript file generated via
# a windows printer, convert it to pdf and email to the user

# Place the following paragraph in your smb.conf file
#[PS2PDF]
#   comment = converts postscript level 2 to PDF
#   printable = yes
#   print command = /usr/local/bin/pdfmailer %s %u
#   printer driver = Lexmark Optra Color 1200 PS

PATH=/bin:/usr/bin:/usr/local/bin:/root/bin:/sbin:/usr/sbin

DOMAIN="cyberpro.com.au"
SENDER="PDFmailer <root@${DOMAIN}>"

RECIPIENT="${2}@${DOMAIN}"
POSTSCRIPTFILE=$1
FILENAME="converted.pdf"
BOUNDARY="`hostname`-$$"


{
echo "From: ${SENDER}"
echo "To: ${RECIPIENT}"
echo "Subject: Your PDF converted file is attached"
echo "Mime-Version: 1.0"
echo "Content-Type: multipart/mixed; boundary=\"${BOUNDARY}\""
echo ""

echo "--${BOUNDARY}"

echo "Content-Type: text/plain; charset=iso-8859-1"
echo "Content-Transfer-Encoding: 7bit"
echo ""
echo "Attached is your pdf file created from postcript"
echo ""
echo "Processing output appears below:"
echo ""
ps2pdf ${POSTSCRIPTFILE}
echo ""
echo "Regards, ${SENDER}"
echo ""

echo "--${BOUNDARY}"

echo "Content-Type: application/octet-stream; name=\"${FILENAME}\""
echo "Content-Transfer-Encoding: base64"
echo "Content-Disposition: attachment;"
echo " filename=\"${FILENAME}\""
echo ""

mimencode ${POSTSCRIPTFILE}.pdf

echo "--${BOUNDARY}"

} | /usr/lib/sendmail -ba $RECIPIENT

rm -f ${POSTSCRIPTFILE} ${POSTSCRIPTFILE}.pdf
--------------------------------------------
end

-- 
SLUG - Sydney Linux User's Group - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

Reply via email to