home *** CD-ROM | disk | FTP | other *** search
/ PCNET 2006 September - Disc 1 / PCNET_CD_2006_09.iso / linux / puppy-barebones-2.01r2.iso / pup_201.sfs / usr / local / bin / rtf2ps.sh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  2003-04-04  |  1.2 KB  |  64 lines

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