home *** CD-ROM | disk | FTP | other *** search
/ PC World 2000 August / PCWorld_2000-08_cd.bin / Software / TemaCD / ghostscr / gs601w32.exe / gs6.01 / lib / ps2pdfxx.bat < prev    next >
DOS Batch File  |  2000-03-14  |  1KB  |  60 lines

  1. @echo off
  2. @rem $Id: ps2pdfxx.bat,v 1.1 2000/03/14 20:20:20 lpd Exp $
  3. rem Internal batch file for calling pdfwrite driver.
  4.  
  5. rem    NOTE: for questions about using this file on Windows NT,
  6. rem    please contact Matt Sergeant (sergeant@geocities.com).
  7.  
  8. rem The files that call this one (ps2pdf*.bat) write the command-line
  9. rem options into _.at, and then pass the last 2 (or fewer) arguments
  10. rem to this file.
  11.  
  12. echo -q -dNOPAUSE -dBATCH -sDEVICE#pdfwrite >_.at2
  13. set PS2PDFGS=gswin32c
  14.  
  15. if "%OS%"=="Windows_NT" goto nt
  16.  
  17. rem    Run ps2pdf on any Microsoft OS.
  18.  
  19. if "%1"=="" goto usage
  20. if "%2"=="" goto usage
  21.  
  22. rem Watcom C deletes = signs, so use # instead.
  23. rem Doing an initial 'save' helps keep fonts from being flushed between pages.
  24. rem We have to include the options twice because -I only takes effect if it
  25. rem appears before other options.
  26.  
  27. :run
  28. echo -sOutputFile#%2 >>_.at2
  29. copy /b /y _.at2+_.at >NUL
  30. echo -c save pop -f %1 >>_.at2
  31. %PS2PDFGS% @_.at @_.at2
  32. goto end
  33.  
  34. :usage
  35. echo Usage: ps2pdf [options...] input.ps output.pdf
  36. goto end
  37.  
  38. rem    Run ps2pdf on Windows NT.
  39.  
  40. :nt
  41. set PS2PDFGS=gswin32c
  42. if not CMDEXTVERSION 1 goto run
  43. if "%1"=="" goto ntusage
  44. if "%2"=="" goto nooutfile
  45. goto run
  46.  
  47. :ntusage
  48. echo Usage: ps2pdf input.ps [output.pdf]
  49. echo    or: ps2pdf [options...] input.ps output.pdf
  50. goto end
  51.  
  52. :nooutfile
  53. ps2pdfxx %1 %1:.PS=.PDF%
  54.  
  55. :end
  56. rem    Clean up.
  57. SET PS2PDFGS=
  58. if exist _.at erase _.at
  59. if exist _.at2 erase _.at2
  60.