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.

42 lines
951 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 PostScript to PDF 1.4 (Acrobat 5-and-later compatible). */
  6. /* The PDF compatibility level may change in the future: */
  7. /* use ps2pdf12 or ps2pdf13 if you want a specific level. */
  8. parse arg params
  9. gs='@gsos2'
  10. inext='.ps'
  11. outext='.pdf'
  12. if params='' then call usage
  13. options=''
  14. /* extract options from command line */
  15. i=1
  16. param=word(params,i)
  17. do while substr(param,1,1)='-'
  18. options=options param
  19. i=i+1
  20. param=word(params,i)
  21. end
  22. infile=param
  23. if infile='' then call usage
  24. outfile=word(params,i+1)
  25. if outfile='' then do
  26. outfile=infile''outext
  27. infile=infile''inext
  28. end
  29. gs options '-q -P- -dCompatibilityLevel=1.4 -dWriteXRefStm=false -dWriteObjStms=false -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile='outfile options infile
  30. exit
  31. usage:
  32. say 'Usage: ps2pdf [options...] input[.ps output.pdf]'
  33. exit