You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
761 B

1 month ago
  1. /*
  2. * This file is maintained by a user: if you have any questions about it,
  3. * please contact Mark Hale (mark.hale@physics.org).
  4. */
  5. /* Convert PDF to PostScript. */
  6. parse arg params
  7. gs='@gsos2'
  8. inext='.pdf'
  9. outext='.ps'
  10. if params='' then call usage
  11. options='-dNOPAUSE -dBATCH -P- -dSAFER -sDEVICE=ps2write'
  12. /* extract options from command line */
  13. i=1
  14. param=word(params,i)
  15. do while substr(param,1,1)='-'
  16. options=options param
  17. i=i+1
  18. param=word(params,i)
  19. end
  20. infile=param
  21. if infile='' then call usage
  22. outfile=word(params,i+1)
  23. if outfile='' then do
  24. outfile=infile''outext
  25. infile=infile''inext
  26. end
  27. gs '-q -sOutputFile='outfile options infile
  28. exit
  29. usage:
  30. say 'Usage: pdf2ps [-dASCII85DecodePages=false] [-dLanguageLevel=n] input[.pdf output.ps]'
  31. exit