星火微课系统客户端
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.

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