Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 13 by niro, Wed Apr 27 23:03:11 2005 UTC revision 14 by niro, Wed Apr 27 23:10:04 2005 UTC
# Line 2  Line 2 
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"
# Line 23  INPUT_FILES="$1" Line 24  INPUT_FILES="$1"
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    
# Line 30  OLD_IFS="$IFS" Line 35  OLD_IFS="$IFS"
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
   

Legend:
Removed from v.13  
changed lines
  Added in v.14