home *** CD-ROM | disk | FTP | other *** search
/ Acorn User 10 / AU_CD10.iso / Updates / GhostScript / !GhostScr / bin / ps2ascii < prev    next >
Text File  |  1999-03-22  |  818b  |  16 lines

  1. | Extract ASCII text from a PostScript file.  Usage:
  2. |    ps2ascii [infile.ps [outfile.txt]]
  3. | If outfile is omitted, output goes to stdout.
  4. | If both infile and outfile are omitted, ps2ascii acts as a filter,
  5. | reading from stdin and writing on stdout.
  6.  
  7. | I'm sure there is a way of getting the number of args passed on the CLI - a problem for later
  8. wimpslot -min 2000K
  9. if "%0" = "" then set GS$ARGS 0 else if "%1" = "" then set GS$ARGS 1 else set GS$ARGS 2
  10.  
  11. if "<GS$ARGS>" = "0" then gs -q -dNODISPLAY -dNOBIND -dWRITESYSTEMDICT -dSIMPLE -c save -f ps2ascii.ps - -c quit
  12. if "<GS$ARGS>" = "1" then gs -q -dNODISPLAY -dNOBIND -dWRITESYSTEMDICT -dSIMPLE -c save -f ps2ascii.ps %0 -c quit
  13. if "<GS$ARGS>" = "2" then gs -q -dNODISPLAY -dNOBIND -dWRITESYSTEMDICT -dSIMPLE -c save -f ps2ascii.ps %0 -c quit > %1
  14.  
  15. unset GS$ARGS
  16.