~ubuntu-branches/ubuntu/gutsy/gs-common/gutsy

« back to all changes in this revision

Viewing changes to scripts/ps2pdfwr

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2004-10-09 13:36:43 UTC
  • Revision ID: james.westby@ubuntu.com-20041009133643-rsidg7o5i5mpk328
Tags: 0.3.6ubuntu1
Depend on gs-esp | gs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
# $Id: ps2pdfwr,v 1.9 2002/02/21 21:49:28 giles Exp $
 
3
# Convert PostScript to PDF without specifying CompatibilityLevel.
 
4
 
 
5
OPTIONS="-dSAFER"
 
6
while true
 
7
do
 
8
        case "$1" in
 
9
        -?*) OPTIONS="$OPTIONS $1" ;;
 
10
        *)  break ;;
 
11
        esac
 
12
        shift
 
13
done
 
14
 
 
15
if [ $# -lt 1 -o $# -gt 2 ]; then
 
16
        echo "Usage: `basename $0` [options...] (input.[e]ps|-) [output.pdf|-]" 1>&2
 
17
        exit 1
 
18
fi
 
19
 
 
20
infile="$1";
 
21
 
 
22
if [ $# -eq 1 ]
 
23
then
 
24
        case "${infile}" in
 
25
          -)            outfile=- ;;
 
26
          *.eps)        base=`basename "${infile}" .eps`; outfile="${base}.pdf" ;;
 
27
          *.ps)         base=`basename "${infile}" .ps`; outfile="${base}.pdf" ;;
 
28
          *)            base=`basename "${infile}"`; outfile="${base}.pdf" ;;
 
29
        esac
 
30
else
 
31
        outfile="$2"
 
32
fi
 
33
 
 
34
# We have to include the options twice because -I only takes effect if it
 
35
# appears before other options.
 
36
exec gs $OPTIONS -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite "-sOutputFile=$outfile" $OPTIONS -c .setpdfwrite -f "$infile"