pdf2ps.cmd 819 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /* $Id: pdf2ps.cmd,v 1.2 2001/02/03 18:31:12 alexcher Exp $ */
  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. /* Convert PDF to PostScript. */
  7. parse arg params
  8. gs='@gsos2'
  9. inext='.pdf'
  10. outext='.ps'
  11. if params='' then call usage
  12. options='-dNOPAUSE -dBATCH -dSAFER -sDEVICE=pswrite'
  13. /* extract options from command line */
  14. i=1
  15. param=word(params,i)
  16. do while substr(param,1,1)='-'
  17. options=options param
  18. i=i+1
  19. param=word(params,i)
  20. end
  21. infile=param
  22. if infile='' then call usage
  23. outfile=word(params,i+1)
  24. if outfile='' then do
  25. outfile=infile''outext
  26. infile=infile''inext
  27. end
  28. gs '-q -sOutputFile='outfile options infile
  29. exit
  30. usage:
  31. say 'Usage: pdf2ps [-dASCII85DecodePages=false] [-dLanguageLevel=n] input[.pdf output.ps]'
  32. exit