Line | |
---|
1 | #!/bin/sh
|
---|
2 | # $Id: pdf2ps 8107 2007-07-05 19:04:29Z till $
|
---|
3 | # Convert PDF to PostScript.
|
---|
4 |
|
---|
5 | # This definition is changed on install to match the
|
---|
6 | # executable name set in the makefile
|
---|
7 | GS_EXECUTABLE=gs
|
---|
8 | gs="`dirname $0`/$GS_EXECUTABLE"
|
---|
9 | if test ! -x "$gs"; then
|
---|
10 | gs="$GS_EXECUTABLE"
|
---|
11 | fi
|
---|
12 | GS_EXECUTABLE=gs
|
---|
13 |
|
---|
14 | OPTIONS=""
|
---|
15 | while true
|
---|
16 | do
|
---|
17 | case "$1" in
|
---|
18 | -?*) OPTIONS="$OPTIONS $1" ;;
|
---|
19 | *) break ;;
|
---|
20 | esac
|
---|
21 | shift
|
---|
22 | done
|
---|
23 |
|
---|
24 | if [ $# -eq 2 ]
|
---|
25 | then
|
---|
26 | outfile=$2
|
---|
27 | elif [ $# -eq 1 ]
|
---|
28 | then
|
---|
29 | outfile=`basename "$1" \.pdf`.ps
|
---|
30 | else
|
---|
31 | echo "Usage: `basename $0` [-dASCII85EncodePages=false] [-dLanguageLevel=1|2|3] input.pdf [output.ps]" 1>&2
|
---|
32 | exit 1
|
---|
33 | fi
|
---|
34 |
|
---|
35 | # Doing an initial 'save' helps keep fonts from being flushed between pages.
|
---|
36 | # We have to include the options twice because -I only takes effect if it
|
---|
37 | # appears before other options.
|
---|
38 | exec "$GS_EXECUTABLE" $OPTIONS -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pswrite "-sOutputFile=$outfile" $OPTIONS -c save pop -f "$1"
|
---|
Note:
See
TracBrowser
for help on using the repository browser.