ps2epsi.bat 720 B

12345678910111213141516171819202122232425262728
  1. @echo off
  2. @rem $Id: ps2epsi.bat,v 1.6 2001/06/22 16:09:22 lpd Exp $
  3. if %1/==/ goto usage
  4. if %2/==/ goto usage
  5. call gssetgs.bat
  6. set infile=%1
  7. set outfile=%2
  8. rem Ghostscript uses %outfile% to define the output file
  9. %GSC% -q -dNOPAUSE -dSAFER -dDELAYSAFER -sDEVICE=bit -sOutputFile=NUL ps2epsi.ps < %infile%
  10. rem We bracket the actual file with a few commands to help encapsulation
  11. echo /InitDictCount countdictstack def gsave save mark newpath >> %outfile%
  12. rem Append the original onto the preview header
  13. copy %outfile% + %infile%
  14. echo countdictstack InitDictCount sub { end } repeat >> %outfile%
  15. echo cleartomark restore grestore >> %outfile%
  16. goto end
  17. :usage
  18. echo "Usage: ps2epsi <infile.ps> <outfile.epi>"
  19. :end