home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 2 / AACD 2.iso / AACD / Magazine / UsingPDF / GhostScript / source / gs5.10 / pv.sh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  1997-09-30  |  1.1 KB  |  37 lines

  1. #!/bin/sh -f
  2. #
  3. # pv - preview a specified page of a dvi file in a Ghostscript window
  4. # usage: pv page file
  5. #
  6. # pv converts the given page to PostScript and displays it
  7. # in a Ghostscript window.
  8. #
  9. if [ $# -lt 2 ] ;then
  10.   echo usage: $0 'page_number file_name[.dvi]'
  11.   exit 1
  12. fi
  13. #
  14. # The following line used to appear here:
  15. #
  16. #RESOLUTION=100
  17. #
  18. # But according to Peter Dyballa
  19. # <pete@lovelace.informatik.uni-frankfurt.de>, "Modern versions of dvips are
  20. # taught to read configuration files which tell them the paths to PK, TFM,
  21. # VF and other files for example PostScript font programmes. These files
  22. # tell #dvips too which default resolution is used and therefore which
  23. # series of PK files (based on 300 DPI or 400 DPI or 600 DPI or even more)
  24. # are held on the system."  So we have deleted this line, and also removed
  25. # the -D switch from the call of dvips below.
  26. #
  27. TEMPDIR=.
  28. PAGE=$1
  29. shift
  30. FILE=$1
  31. shift
  32. trap "rm -rf $TEMPDIR/$FILE.$$.pv" 0 1 2 15
  33. #dvips -D$RESOLUTION -p $PAGE -n 1 $FILE $* -o $FILE.$$.pv
  34. dvips -p $PAGE -n 1 $FILE $* -o $FILE.$$.pv
  35. gs $FILE.$$.pv
  36. exit 0
  37.