source: other-projects/trunk/winbin/bin/ghostscript/lib/pv.sh@ 17223

Last change on this file since 17223 was 17223, checked in by max, 16 years ago

Add Ghostscript binaries and libraries for windows.

File size: 1.4 KB
Line 
1#!/bin/sh -f
2# $Id: pv.sh 8104 2007-07-05 10:41:52Z till $
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#
10if [ $# -lt 2 ] ;then
11 echo usage: $0 'page_number file_name[.dvi]'
12 exit 1
13fi
14#
15# The following line used to appear here:
16#
17#RESOLUTION=100
18#
19# But according to Peter Dyballa
20# <[email protected]>, "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
31GS_EXECUTABLE=gs
32
33TEMPDIR=.
34PAGE=$1
35shift
36FILE="$1"
37shift
38if test -z "$TEMPDIR"; then
39 TEMPDIR=/tmp
40fi
41if which mktemp >/dev/null 2>/dev/null; then
42 tmpfile="`mktemp $TEMPDIR/\"$FILE\".pv.XXXXXX`"
43else
44 tmpfile="$TEMPDIR/$FILE.$$.pv"
45fi
46trap "rm -rf $tmpfile" 0 1 2 15
47#dvips -D$RESOLUTION -p $PAGE -n 1 "$FILE" "$@" -o $tmpfile
48dvips -p $PAGE -n 1 "$FILE" "$@" -o $tmpfile
49$GS_EXECUTABLE $tmpfile
50exit 0
Note: See TracBrowser for help on using the repository browser.