home *** CD-ROM | disk | FTP | other *** search
/ PC World 2000 August / PCWorld_2000-08_cd.bin / Software / TemaCD / ghostscr / gs601w32.exe / gs6.01 / lib / ps2ascii < prev    next >
Text File  |  2000-03-09  |  708b  |  18 lines

  1. #!/bin/sh
  2. # $Id: ps2ascii,v 1.1 2000/03/09 08:40:40 lpd 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. if ( test $# -eq 0 ) then
  12.     gs -q -dNODISPLAY -dNOBIND -dWRITESYSTEMDICT -dSIMPLE -c save -f ps2ascii.ps - -c quit
  13. elif ( test $# -eq 1 ) then
  14.     gs -q -dNODISPLAY -dNOBIND -dWRITESYSTEMDICT -dSIMPLE -c save -f ps2ascii.ps $1 -c quit
  15. else
  16.     gs -q -dNODISPLAY -dNOBIND -dWRITESYSTEMDICT -dSIMPLE -c save -f ps2ascii.ps $1 -c quit >$2
  17. fi
  18.