rtf2ps.sh 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #!/bin/sh
  2. ########################################################################
  3. #
  4. # Convert an rtf document to PostScript format using 'Ted'.
  5. #
  6. # Usage rtf2ps.sh --paper paper something.rtf something.ps
  7. # Or rtf2ps.sh something.rtf something.ps
  8. #
  9. # Valid values for paper are a4, a5, a6, letter, legal and executive
  10. #
  11. # This is an example. Refer to http://www.nllgg.nl/Ted/index.html for the
  12. # 'Ted' documentation.
  13. #
  14. # If you want 'Ted' to use X11 configurable resources, use
  15. # Ted ++printToFilePaper ... In conjuction with X11 resources, the
  16. # standard X11 command line arguments to set resources can be practical. E.G:
  17. # Ted -xrm Ted.usePostScriptFilters:1 -xrm Ted.usePostScriptIndexedImages:1
  18. # ++printToFilePaper .....
  19. #
  20. ########################################################################
  21. PAPER=
  22. case $# in
  23. 2)
  24. ;;
  25. 4)
  26. case $1 in
  27. --paper)
  28. ;;
  29. *)
  30. echo $0: '$1='$1 'Expected --paper'
  31. exit 1
  32. ;;
  33. esac
  34. case $2 in
  35. a4|a5|a6|letter|legal|executive)
  36. PAPER=$2
  37. ;;
  38. *)
  39. echo $0: '$2='$2 'Expected a4|a5|a6|letter|legal|executive'
  40. exit 1
  41. ;;
  42. esac
  43. shift; shift;
  44. ;;
  45. *)
  46. echo $0: '$#='$#
  47. exit 1
  48. ;;
  49. esac
  50. case $PAPER in
  51. ?*)
  52. Ted --printToFilePaper $1 $2 $PAPER
  53. ;;
  54. *)
  55. Ted --printToFile $1 $2
  56. ;;
  57. esac