Magellan Linux

Contents of /trunk/ps2pdf-extended/ps2pdf-extended.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 14 - (show annotations) (download) (as text)
Wed Apr 27 23:10:04 2005 UTC (19 years ago) by niro
File MIME type: application/x-sh
File size: 782 byte(s)
added some cosmetics

1 #!/bin/bash
2
3 # -i input1,input2,.... -o output.pdf
4
5 # needs ghostscript-esp-7
6
7 usage() {
8 echo
9 echo "Converts one or more postscript files to pdf"
10 echo
11 echo "Usage:"
12 echo " $(basename $0) input1,input2,... output"
13 echo
14 echo "written by Niels Rogalla <niro@magellan-linux.de>"
15 echo
16
17 exit 1
18 }
19
20 [ $# -ne 2 ] && usage
21
22
23 INPUT_FILES="$1"
24 OUTPUT_FILE="$2"
25 TEMP="/var/tmp/ps2pdf-ext-$$.ps"
26
27 echo
28 echo "ps2pdf-extended, Niels Rogalla <niro@magellan-linux.de>"
29 echo
30
31 #create a empty temp file
32 :> ${TEMP}
33
34 OLD_IFS="$IFS"
35 IFS=","
36 for i in ${INPUT_FILES}
37 do
38 echo " Processing ${i} ..."
39 cat ${i} >> ${TEMP}
40 done
41 IFS="${OLD_IFS}"
42
43 echo -n " Creating PDF '${OUTPUT_FILE}' ..."
44 ps2pdf ${TEMP} ${OUTPUT_FILE}
45
46 # remove temp file
47 [ -f ${TEMP} ] && rm ${TEMP}
48
49 echo "done"
50 echo

Properties

Name Value
svn:executable *