You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
909 B

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