home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 18 REXX
/
18-REXX.zip
/
rexxlb.zip
/
SAMPLES
/
ASC2PS.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1993-01-08
|
2KB
|
63 lines
/*****************************************************************************/
/* */
/* Print an ASCII file on a Postscript printer */
/* */
/* Requires Personal REXX or REXXLIB (dosisdir & dosisfile functions) */
/* */
/* Command format: ASC2PS <infile> <outfile> */
/* */
/*****************************************************************************/
arg infile outfile .
if dosdir(infile) = '' then do
say "Input file '"infile"' not found."
exit
end
if outfile = '' then
outfile = 'PRN'
if dosisfile(outfile) then
call dosdel outfile
call pageinit
i = 0
deltay = 72 * 11 / 66
do while lines(infile)
line = linein(infile)
i = i + 1
call lineout outfile, 0 (66-i) * deltay 'moveto'
line = quote(line, "\()")
call lineout outfile, '('line') show'
if i < 66 then
iterate
call lineout outfile, 'showpage restore'
call pageinit
i = 0
end
if i > 0 then
call lineout outfile, 'showpage'
call lineout outfile, 'restore'
call lineout outfile
call lineout infile
exit
/* initialize page */
pageinit:
call lineout outfile, 'save 36 36 translate'
call lineout outfile, '.9375 .9091 scale'
call lineout outfile, '/Courier findfont 12 scalefont setfont'
return
/* insert escape characters */
quote: procedure
parse arg line, quotechars
x = 1
do forever
x = verify(line, quotechars, 'm', x)
if x = 0 then
leave
line = insert('\', line, x-1)
x = x + 2
end
return line