home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / wvhtm064.zip / wv / wvPDF < prev    next >
Text File  |  2000-10-19  |  725b  |  42 lines

  1. #!/bin/sh
  2.  
  3. # argument checking
  4. if [ ${#} -ne "2" ]; then
  5.     echo "Usage: ${0} <word document> <pdf output file>"
  6.     exit 1
  7. fi
  8.  
  9. which wvPS >/dev/null 2>&1
  10. if [ ${?} -ne "0" ]; then
  11.     echo "Could not find required program 'wvPS'"
  12.     exit 1
  13. fi
  14.  
  15. which distill >/dev/null 2>&1
  16. if [ ${?} -ne "0" ]; then
  17.     echo "Could not find required program 'distill'"
  18.     exit 1
  19. fi
  20.  
  21. # intermediate file
  22. PS_FILE="${2}.ps"
  23.  
  24. wvPS "${1}" "${PS_FILE}" >/dev/null 2>&1
  25. if [ ${?} -ne "0" ]; then
  26.     echo "Could not convert into PS"
  27.     exit 1
  28. fi
  29.  
  30. # Here we should add pstopdf -- MV
  31.  
  32. distill "${PS_FILE}" >/dev/null 2>&1
  33. if [ ${?} -ne "0" ]; then
  34.     echo "Could not convert into PDF"
  35.     exit 1
  36. fi
  37.  
  38. #clean up
  39. rm -f "${PS_FILE}" "${PS_FILE}.log"
  40.  
  41. mv "${PS_FILE}.pdf" "${2}"
  42.