1 % === BEGIN ps-print prologue 0
4 %%BeginProcSet: ErrorHandler
5 % Downloaded Error Break-page handler
7 % PostScript Language Program Design,
8 % Adobe Systems Incorporated.
9 % Appendix A, pages 217-219
11 /ps$brkpage where{pop}
13 /ps$brkpage 64 dict def
15 /tx 0 def/ty 0 def/toy 0 def/tox 0 def
17 dup type/stringtype ne{=string cvs}if
19 /tx exch def/ty 10 def
20 currentpoint/toy exch def/tox exch def
23 0 ty rlineto tx 0 rlineto
26 tox toy moveto 0 setgray show
28 /nl{currentpoint exch pop lmargin exch moveto 0 -10 rmoveto}def
29 /=={/cp 0 def typeprint nl}def
30 /typeprint{dup type dup currentdict exch known{exec}{unknowntype}ifelse}readonly def
34 dup length cp add rmargin gt{nl/cp 0 def}if
35 dup length cp add/cp exch def
38 /cvsprint{=string cvs tprint( )tprint}readonly def
39 /unknowntype{exch pop cvlit(??)tprint cvsprint}readonly def
40 /integertype{cvsprint}readonly def
41 /realtype{cvsprint}readonly def
42 /booleantype{cvsprint}readonly def
43 /operatortype{(//)tprint cvsprint}readonly def
44 /marktype{pop(-mark-)tprint}readonly def
45 /dicttype{pop(-dictionary-)tprint}readonly def
46 /nulltype{pop(-null-)tprint}readonly def
47 /filetype{pop(-filestream-)tprint}readonly def
48 /savetype{pop(-savelevel-)tprint}readonly def
49 /fonttype{pop(-fontid-)tprint}readonly def
50 /nametype{dup xcheck not{(/)tprint}if cvsprint}readonly def
53 {(\()tprint tprint(\))tprint}
54 {pop(-string-)tprint}ifelse}readonly def
58 {({)tprint{typeprint}forall(})tprint}
59 {([)tprint{typeprint}forall(])tprint}ifelse}
60 {pop(-array-)tprint}ifelse}readonly def
64 {({)tprint{typeprint}forall(})tprint}
65 {([)tprint{typeprint}forall(])tprint}ifelse}
66 {pop(-packedarray-)tprint}ifelse}readonly def
67 /courier/Courier findfont 10 scalefont def
68 /OLDhandleerror errordict/handleerror get def
72 systemdict begin $error begin ps$brkpage begin
74 {/newerror false store vmstatus pop pop 0 ne{grestoreall}if
76 ErrorMessage 1 and 0 ne{ % print on paper
77 courier setfont lmargin 720 moveto
78 (# ERROR: )prnt errorname prnt nl
79 (# OFFENDING COMMAND: )prnt/command load prnt
81 {nl nl(# STACK:)prnt nl nl $error/ostack get aload length{==}repeat}if
82 $error/errorinfo known
83 {nl nl(# ERRORINFO:)prnt nl nl $error/errorinfo get aload length{==}repeat}if
84 systemdict/showpage get exec}if
85 ErrorMessage 2 and 0 ne{ % send back to printing system
86 (\%\%[ Error: )print errorname =print
87 (; OffendingCommand: )print/command load =print
88 $error/errorinfo known
89 {(; ErrorInfo:)print $error/errorinfo get aload length{( )=print =print}repeat}if
91 (\%\%[ Rest of job is ignored ]\%\%)= flush}if
92 /newerror true store}if
96 dup 0 systemdict put % replace name by actual dict object
97 dup 4 ps$brkpage put % replace name by dict object
100 errordict 3 1 roll put % put proc in errordict as /handleerror
105 % operators for language level 2 only
107 (<<)cvn where % << operator
108 {pop/BMark(<<)cvn load def}
109 {/BMark{mark}bind def}ifelse
110 (>>)cvn where % >> operator
111 {pop/EMark(>>)cvn load def}
112 {/EMark{counttomark 2 idiv dup dict begin{def}repeat pop currentdict end}bind def}ifelse
113 /setpagedevice where % setpagedevice
115 {/setpagedevice{pop}bind def}ifelse
116 /packedarray where % packedarray
118 {/packedarray{array astore readonly}bind def}ifelse
121 % device dependent operators
124 dup where{pop pop pop}
125 {exch dup where{pop}{pop/pop}ifelse load def}ifelse}def
127 /duplexmode/setduplexmode DefOp
128 /tumble/settumble DefOp
130 % === END ps-print prologue 0