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
6/* Convert PDF to PostScript. */
7
8parse arg params
9
10gs='@gsos2'
11inext='.pdf'
12outext='.ps'
13
14if params='' then call usage
15
16options='-dNOPAUSE -dBATCH -P- -dSAFER -sDEVICE=ps2write'
17
18/* extract options from command line */
19i=1
20param=word(params,i)
21do while substr(param,1,1)='-'
22	options=options param
23	i=i+1
24	param=word(params,i)
25end
26
27infile=param
28if infile='' then call usage
29outfile=word(params,i+1)
30if outfile='' then do
31	outfile=infile''outext
32	infile=infile''inext
33end
34
35gs '-q -sOutputFile='outfile options infile
36exit
37
38usage:
39say 'Usage: pdf2ps [-dASCII85DecodePages=false] [-dLanguageLevel=n] input[.pdf output.ps]'
40exit
41