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 / bin / pv.sh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  2005-07-31  |  1.2 KB  |  43 lines

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