ps2epsi.cmd 955 B

12345678910111213141516171819202122232425262728293031323334
  1. /* $Id: ps2epsi.cmd,v 1.6 2002/04/25 21:29:08 ghostgum 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 %%%%Page: 1 1 >> %outfile%
  15. echo %%%%BeginDocument: %outfile% >> %outfile%
  16. echo /InitDictCount countdictstack def gsave save mark newpath >> %outfile%
  17. rem Append the original onto the preview header
  18. copy %outfile% + %infile%
  19. echo %%%%EndDocument >> %outfile%
  20. echo countdictstack InitDictCount sub { end } repeat >> %outfile%
  21. echo cleartomark restore grestore >> %outfile%
  22. goto end
  23. :usage
  24. echo "Usage: ps2epsi <infile.ps> <outfile.epi>"
  25. :end