星火微课系统客户端
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

ps2epsi.cmd 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /* $Id: ps2epsi.cmd 9619 2009-04-07 10:20:02Z ken $ */
  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 First we need to determine the bounding box. ps2epsi.ps below will pick
  12. rem the result up from %outfile%
  13. gsos2 -q -dNOPAUSE -dBATCH -dSAFER -dDELAYSAFER -sDEVICE=bbox -sOutputFile=NUL %infile% 2> %outfile%
  14. rem Ghostscript uses %outfile% to define the output file
  15. gsos2 -q -dNOPAUSE -dSAFER -dDELAYSAFER -sDEVICE=bit -sOutputFile=NUL ps2epsi.ps < %infile%
  16. rem We bracket the actual file with a few commands to help encapsulation
  17. echo %%%%Page: 1 1 >> %outfile%
  18. echo %%%%BeginDocument: %outfile% >> %outfile%
  19. echo /InitDictCount countdictstack def gsave save mark newpath >> %outfile%
  20. echo userdict /setpagedevice /pop load put >> %outfile%
  21. rem Append the original onto the preview header
  22. copy %outfile% + %infile%
  23. echo %%%%EndDocument >> %outfile%
  24. echo countdictstack InitDictCount sub { end } repeat >> %outfile%
  25. echo cleartomark restore grestore >> %outfile%
  26. goto end
  27. :usage
  28. echo "Usage: ps2epsi <infile.ps> <outfile.epi>"
  29. :end