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