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.

21 lines
631 B

1 month ago
  1. #!/bin/sh
  2. # Extract ASCII text from a PostScript file. Usage:
  3. # ps2ascii [infile.ps [outfile.txt]]
  4. # If outfile is omitted, output goes to stdout.
  5. # If both infile and outfile are omitted, ps2ascii acts as a filter,
  6. # reading from stdin and writing on stdout.
  7. # This definition is changed on install to match the
  8. # executable name set in the makefile
  9. GS_EXECUTABLE=gs
  10. trap "rm -f _temp_.err _temp_.out" 0 1 2 15
  11. OPTIONS="-q -dSAFER -sDEVICE=txtwrite"
  12. if ( test $# -eq 0 ) then
  13. $GS_EXECUTABLE $OPTIONS -o - -
  14. elif ( test $# -eq 1 ) then
  15. $GS_EXECUTABLE $OPTIONS -o - "$1"
  16. else
  17. $GS_EXECUTABLE $OPTIONS -o "$2" "$1"
  18. fi