home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 2 / AACD 2.iso / AACD / Magazine / UsingPDF / GhostScript / source / gs5.10 / ps2pdf.bat < prev    next >
Encoding:
DOS Batch File  |  1997-11-03  |  1.4 KB  |  63 lines

  1. @echo off
  2. rem Convert PostScript to PDF.
  3.  
  4. rem    NOTE: for questions about using this file on Windows NT, please
  5. rem    contact Matt Sergeant (sergeant@geocities.com).
  6.  
  7. set PS2PDFPARAMS=-q -dNOPAUSE -dBATCH -sDEVICE#pdfwrite
  8. set PS2PDFOPT=
  9.  
  10. if "%OS%"=="Windows_NT" goto nt
  11.  
  12. rem    Run ps2pdf on any Microsoft OS.  The executable must be named gs.
  13.  
  14. set PS2PDFGS=gs
  15.  
  16. :run
  17. if "%1"=="" goto usage
  18. if "%2"=="" goto usage
  19. :opt
  20. if "%3"=="" goto exec
  21. set PS2PDFOPT=%PS2PDFOPT% %1
  22. shift
  23. goto opt
  24.  
  25. :exec
  26. rem Watcom C deletes = signs, so use # instead.
  27. rem Doing an initial 'save' helps keep fonts from being flushed between pages.
  28. %PS2PDFGS% %PS2PDFPARAMS% %PS2PDFOPT% -sOutputFile#%2 -c save pop -f %1
  29. goto end
  30.  
  31. :usage
  32. echo "Usage: ps2pdf [options...] input.ps output.pdf"
  33. goto end
  34.  
  35. rem    Run ps2pdf on Windows NT.  The executable must be named gswin32c.
  36.  
  37. :nt
  38. set PS2PDFGS=gswin32c
  39. if not CMDEXTVERSION 1 goto run
  40. if "%1"=="" goto ntusage
  41. if "%2"=="" goto nooutfile
  42. if not "%3"=="" goto opt
  43.  
  44. rem Watcom C deletes = signs, so use # instead.
  45. %PS2PDFGS% %PS2PDFPARAMS% -sOutputFile#%2 -c save pop -f %1
  46. goto end
  47.  
  48. :ntusage
  49. echo "Usage: ps2pdf input.ps [output.pdf]"
  50. echo "   or: ps2pdf [options...] input.ps output.pdf"
  51. goto end
  52.  
  53. :nooutfile
  54. set PS2PDF=%1
  55. set PS2PDF=%PS2PDF:.PS=.PDF%
  56. %PS2PDFGS% %PS2PDFPARAMS% -sOutputFile#%PS2PDF% -c save pop -f %1
  57.  
  58. :end
  59. rem    Clean up.
  60. SET PS2PDFPARAMS=
  61. SET PS2PDFGS=
  62. SET PS2PDFOPT=
  63.