ps2epsi.cmd 837 B

12345678910111213141516171819202122232425262728293031
  1. /* $Id: ps2epsi.cmd,v 1.3 2001/06/22 16:09:22 lpd Exp $ */
  2. /*
  3. * This file is maintained by a user: if you have any questions about it,
  4. * please contact Mark Hale (mark.hale@physics.org).
  5. */
  6. @echo off
  7. if %1/==/ goto usage
  8. if %2/==/ goto usage
  9. set infile=%1
  10. set outfile=%2
  11. rem Ghostscript uses %outfile% to define the output file
  12. gsos2 -q -dNOPAUSE -dSAFER -dDELAYSAFER -sDEVICE=bit -sOutputFile=NUL ps2epsi.ps < %infile%
  13. rem We bracket the actual file with a few commands to help encapsulation
  14. echo /InitDictCount countdictstack def gsave save mark newpath >> %outfile%
  15. rem Append the original onto the preview header
  16. copy %outfile% + %infile%
  17. echo countdictstack InitDictCount sub { end } repeat >> %outfile%
  18. echo cleartomark restore grestore >> %outfile%
  19. goto end
  20. :usage
  21. echo "Usage: ps2epsi <infile.ps> <outfile.epi>"
  22. :end