I'm sure it's been solved before and probably more gracefully but here's the print string I used to accomplish printing from MS Word. gs -sDEVICE=pdfwrite -dNOPAUSE -sOutputFile=/tmp/%s.pdf /var/spool/samba/%s;lpr -Pfaxit `strings %s|grep %%Title:|gawk '{print " -o phone="substr($5,1,11)}'` /tmp/%s.pdf;rm -f /tmp/%s.pdf