2 |
|
|
3 |
# -i input1,input2,.... -o output.pdf |
# -i input1,input2,.... -o output.pdf |
4 |
|
|
5 |
|
# needs ghostscript-esp-7 |
6 |
|
|
7 |
usage() { |
usage() { |
8 |
echo |
echo |
9 |
echo "converts one or more postscript files to pdf" |
echo "Converts one or more postscript files to pdf" |
10 |
echo |
echo |
11 |
echo "Usage:" |
echo "Usage:" |
12 |
echo " $(basename $0) input1,input2,... output" |
echo " $(basename $0) input1,input2,... output" |
24 |
OUTPUT_FILE="$2" |
OUTPUT_FILE="$2" |
25 |
TEMP="/var/tmp/ps2pdf-ext-$$.ps" |
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 |
#create a empty temp file |
32 |
:> ${TEMP} |
:> ${TEMP} |
33 |
|
|
35 |
IFS="," |
IFS="," |
36 |
for i in ${INPUT_FILES} |
for i in ${INPUT_FILES} |
37 |
do |
do |
38 |
echo "Processing ${i} ..." |
echo " Processing ${i} ..." |
39 |
cat ${i} >> ${TEMP} |
cat ${i} >> ${TEMP} |
40 |
done |
done |
41 |
|
IFS="${OLD_IFS}" |
42 |
|
|
43 |
echo -n "Creating PDF '${OUTPUT_FILE}' ..." |
echo -n " Creating PDF '${OUTPUT_FILE}' ..." |
44 |
ps2pdf ${TEMP} ${OUTPUT_FILE} |
ps2pdf ${TEMP} ${OUTPUT_FILE} |
45 |
|
|
46 |
|
# remove temp file |
47 |
|
[ -f ${TEMP} ] && rm ${TEMP} |
48 |
|
|
49 |
echo "done" |
echo "done" |
50 |
echo |
echo |
|
|
|