home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / txpdf56.zip / contributed / SCOlp / pdfmail next >
Text File  |  2001-11-01  |  2KB  |  77 lines

  1. :
  2. # PDF printer for SCO / TRACS requires /txt2pdf from www.sanface.com to work
  3. # Install as pdfmail into /usr/spool/lp/model and configure as a "local"
  4. printer.
  5. #Set up some global variables.
  6. : ${SPOOLDIR:=/usr/spool/lp}
  7. : ${LOCALPATH:=${SPOOLDIR}/bin}
  8. : ${PATH:=/bin:/usr/bin/:/usr/local/bin:/txt2pdf:/files}
  9. : ${DIR="/tmp"}
  10. : ${FILE="FILE$$"}
  11. #Set up the default filter.
  12.  
  13. LPCAT="cat"
  14.  
  15. #If we are not using a filter, use the default one.
  16. if [ -z "${FILTER}" ]
  17. then
  18. FILTER="${LPCAT}"
  19. fi
  20.  
  21. if [ -x "${LOCALPATH}/drain.output" ]
  22. then
  23. DRAIN="${LOCALPATH}/drain.output 1"
  24. else
  25. DRAIN=
  26. fi
  27.  
  28. nobanner="yes"
  29.  
  30. for i in $5
  31. do
  32. case "${i}" in
  33. nobanner )
  34. nobanner="yes"
  35. ;;
  36. esac
  37. done
  38.  
  39. job=$1
  40. user=$2
  41. title=$3
  42. copies=$4
  43. cmd=$5
  44. email=$title
  45. echo
  46. "##########################################################################
  47. ###############" > /tmp/$HEADERFILE.txt
  48. echo "Title: $title " >> /tmp/$HEADERFILE.txt
  49. echo "Printed by $user at `date` via print spool job $job" >>
  50. /tmp/$HEADERFILE.t
  51. xt
  52. echo "############################
  53. echo
  54. "##########################################################################
  55. ###############" >> /tmp/$HEADERFILE.txt
  56. shift; shift; shift; shift; shift
  57. i=1
  58. files="$*"
  59.  
  60. while [ $i -le $copies ]
  61. do
  62. for file in $files
  63. do
  64. cd /txt2pdf
  65. cat ${file} | /txt2pdf/txt2pdf.pl - -c /txt2pdf/txt2pdf.cfg >>
  66. $DIR/$FILE.pdf
  67. done
  68. i=`expr $i + 1`
  69. done
  70.  [ "$title" ] &&  /usr/bin/mpack -s TRACSPDF_output -d /tmp/$HEADERFILE.txt
  71. $DI
  72. R/$FILE.pdf $email && sleep 30 && rm $DIR/$FILE.*
  73. #Draining characters might be necessary.
  74. ${DRAIN}
  75. exit 0
  76.  
  77.