Commit | Line | Data |
---|---|---|
827055d8 WJ |
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 | RESOLUTION=100 | |
14 | TEMPDIR=. | |
15 | PAGE=$1 | |
16 | shift | |
17 | FILE=$1 | |
18 | shift | |
19 | trap "rm -rf $TEMPDIR/$FILE.$$.pv" 0 1 2 15 | |
20 | dvips -D$RESOLUTION -p $PAGE -n 1 $FILE $* -o $FILE.$$.pv | |
21 | gs $FILE.$$.pv | |
22 | exit 0 |