1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
|
$! This command file is run by PSPRINT/DEV=PS40 with the following parameters:
$! P1 = complete file specification
$! P2 = file format (DVI or PS or TEXT or TWO or WIDE)
$! P3 = options for PSDVI
$! P4 = options for PRINT
$! P5 = /NOTE value ("" if not used)
$! P6 = /COPIES value (1 if not used)
$! P7 = /OUTPUT value ("" if not used)
$! P8 = "bb<prep>" where b = Y or N and represents the status of the
$! boolean qualifiers /DELETE, /LANDSCAPE
$! and <prep> is the /PREP value, possibly empty
$!
$! This file is much like LW_PRINT.COM, but differs in the following ways:
$! * ^D cannot be sent to the PS40.
$! * No banner page need be created since the PS40 produces one (and a trailer).
$! * /NOTIFY will send PostScript messages back to the user.
$! * PSDVI uses write-white fonts appropriate for a Ricoh engine.
$! * /BANNER and /MANUALFEED are not implemented.
$
$ on control_y then exit
$ set symbol/scope=(nolocal,noglobal)
$ delflag = f$extract(0,1,p8)
$ landflag = f$extract(1,1,p8)
$ prepfile = f$extract(2,999,p8)
$
$ if (p6 .gt. 0) .and. (p6 .lt. 101) then goto CONTINUE
$ write sys$output "Bad /COPIES value. Specify 1 to 100."
$ exit
$
$ CONTINUE:
$ copies = f$string(p6)
$ job = f$parse(p1,,,"NAME")
$
$ copy tex_ps:ps40_header.ps sys$scratch:'job'.tmp
$ tmpfile = f$search("sys$scratch:''job'.tmp")
$ write sys$output -
"Creating SYS$SCRATCH:''job'.TMP" + f$parse(tmpfile,,,"VERSION")
$ open/append tmp 'tmpfile'
$ write tmp "/#copies " + copies + " def"
$ write tmp "/dev (PS40) def"
$ write tmp "/res 300 def"
$ write tmp "/fspec (" + p1 + ") def"
$ if landflag .eqs. "Y" then write tmp "/land true def"
$ if landflag .eqs. "N" then write tmp "/land false def"
$ close tmp
$
$ if p2 .eqs. "DVI" then append tex_ps:tex.ps, tex_ps:ps40_fonts.ps 'tmpfile'
$ if p2 .eqs. "PS" then append tex_ps:ps.ps 'tmpfile'
$ if p2 .eqs. "TEXT" then append tex_ps:text.ps 'tmpfile'
$ if p2 .eqs. "TWO" then append tex_ps:two.ps 'tmpfile'
$ if p2 .eqs. "WIDE" then append tex_ps:wide.ps 'tmpfile'
$
$ if (p2 .nes. "DVI") .and. (p2 .nes. "PS") then goto SKIPPREP
$ if prepfile .eqs. "" then goto SKIPPREP
$ write sys$output "Including " + prepfile
$ append 'prepfile' 'tmpfile'
$ SKIPPREP:
$
$ global = f$search("global.ps")
$ if (global .eqs. "") .or. (p2 .nes. "DVI") then goto SKIPGLOBAL
$ write sys$output "Including GLOBAL.PS"
$ append 'global' 'tmpfile'
$ SKIPGLOBAL:
$
$ if p2 .nes. "DVI" then goto PRINT
$
$ ver = 1
$ LOOP:
$ psdvifile = "sys$scratch:psdvi.tmp;''f$string(ver)'"
$ if f$search(psdvifile) .eqs. "" then goto ENDLOOP
$ ver = ver + 1
$ goto LOOP
$
$ ENDLOOP:
$ land = ""
$ if landflag .eqs. "Y" then land = "/xsize=297mm /ysize=210mm"
$ on warning then goto BADDVI
$ PSDVI 'p1' 'land' /HEADER='tmpfile' -
/OUTPUT='psdvifile' -
/RES=300 -
/FONT="write_white_fonts:" -
/DUMMY="cmr10.300pk" -
/NOCONSERVE -
/NOREVERSE 'p3'
$ delete/nolog 'tmpfile'
$ rename/nolog 'psdvifile' 'tmpfile'
$ goto PRINT
$
$ BADDVI:
$ delete/nolog 'tmpfile'
$ if f$search(psdvifile) .nes. "" then delete/nolog 'psdvifile'
$ write sys$output ""
$ write sys$output "Printing aborted due to error(s). Temporary file deleted."
$ exit
$
$ PRINT:
$ on error then exit
$ if p2 .nes. "DVI" then append 'p1' 'tmpfile'
$
$ if p7 .eqs. "" then goto PRINTJOB
$ copy tex_ps:empty.ps, 'tmpfile' 'p7'
$ delete/log 'tmpfile'
$ write sys$output ""
$ write sys$output "Nothing printed. PostScript saved in " + p7
$ exit
$
$ PRINTJOB:
$ print/note="''p5'"/queue=PS40/name='job' 'tmpfile'/delete 'p4'
$ if delflag .eqs. "Y" then delete/log 'p1'
|