home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / usr / bin / ps2ascii < prev    next >
Encoding:
Text File  |  2005-11-16  |  645 b   |  19 lines

  1. #!/bin/sh
  2. # $Id: ps2ascii,v 1.6 2002/02/21 21:49:28 giles Exp $
  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.  
  9. trap "rm -f _temp_.err _temp_.out" 0 1 2 15
  10.  
  11. OPTIONS="-q -dNODISPLAY -dSAFER -dDELAYBIND -dWRITESYSTEMDICT -dSIMPLE"
  12. if ( test $# -eq 0 ) then
  13.     gs $OPTIONS -c save -f ps2ascii.ps - -c quit
  14. elif ( test $# -eq 1 ) then
  15.     gs $OPTIONS -c save -f ps2ascii.ps "$1" -c quit
  16. else
  17.     gs $OPTIONS -c save -f ps2ascii.ps "$1" -c quit >"$2"
  18. fi
  19.