ps2pdfxx.bat 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. @echo off
  2. @rem $Id: ps2pdfxx.bat,v 1.10 2001/06/22 16:09:22 lpd Exp $
  3. rem Internal batch file for calling pdfwrite driver.
  4. rem The files that call this one (ps2pdf*.bat) write the command-line
  5. rem options into _.at, and then pass the last 2 (or fewer) arguments
  6. rem to this file.
  7. call gssetgs.bat
  8. echo -q -dSAFER -dNOPAUSE -dBATCH -sDEVICE#pdfwrite >_.at2
  9. if "%OS%"=="Windows_NT" goto nt
  10. rem Run ps2pdf on any Microsoft OS.
  11. if %1/==/ goto usage
  12. if %2/==/ goto usage
  13. rem Watcom C deletes = signs, so use # instead.
  14. rem We have to include the options twice because -I only takes effect if it
  15. rem appears before other options.
  16. :run
  17. echo -sOutputFile#%2 >>_.at2
  18. copy /b /y _.at2+_.at >NUL
  19. echo -c .setpdfwrite -f %1 >>_.at2
  20. %GSC% @_.at @_.at2
  21. goto end
  22. :usage
  23. echo Usage: ps2pdf [options...] input.[e]ps output.pdf
  24. goto end
  25. rem Run ps2pdf on Windows NT.
  26. :nt
  27. if not CMDEXTVERSION 1 goto run
  28. if %1/==/ goto ntusage
  29. if %2/==/ goto nooutfile
  30. goto run
  31. :ntusage
  32. echo Usage: ps2pdf input.ps [output.pdf]
  33. echo or: ps2pdf [options...] input.[e]ps output.pdf
  34. goto end
  35. :nooutfile
  36. rem We don't know why the circumlocution with _1 is needed....
  37. set _1=%1
  38. call ps2pdfxx %1 %_1:.PS=.pdf%
  39. set _1=
  40. :end
  41. rem Clean up.
  42. if exist _.at erase _.at
  43. if exist _.at2 erase _.at2