Article View: fj.lang.postscript
Article #799Re: printer
From: Amagai Yoshiji
Date: Wed, 03 Mar 1993 15:15
Date: Wed, 03 Mar 1993 15:15
90 lines
3652 bytes
3652 bytes
<TAO.93Mar3195156@ra13.zuken.co.jp> $B$K$F(B
tao@zuken.co.jp $B$5$s(B
> $B%(%i!<$rJV$95;!"%D!<%k$+2?$+$,$"$k!#(B
$B$o$?$7$O$3$l$r;H$C$F$$$^$9(B. $B$=$N;~!9$G>/$7JQ99$7$?$j$7$^$9$1$I(B.
$BE,@Z$J$H$3$m$KKd$a9~$s$G$/$@$5$$(B.
$BE73$(B
----------------------------------------------------------------
From: lhamey@mqccsunb.mqcc.mq.oz.au (Len Hamey)
Date: 27 Aug 90 04:31:59 GMT
Newsgroups: comp.lang.postscript
Message-ID: <432@macuni.mqcc.mq.oz>
Subject: PostScript Error Dump Routine (free)
Whilst trying to determine why a particular PS file would not print,
I developed the following error trap routine. I offer it to the net
freely (you get what you pay for, usually). I would be interested
in better/improved solutions to the same problem.
% Catch PS error and print out potentially useful info.
% If your PS code fails, just include this at start. Upon failure
% it dumps the current (incomplete) page then prints out two pages
% of error info.
/ErrorStringBuffer 1000 string def
errordict /handleerror
{ showpage
% showpage also initializes graphics state.
/Times-Roman findfont 12 scalefont setfont
{
72 680 moveto
(Error encountered: ) show
$error /errorname get ErrorStringBuffer cvs show
72 660 moveto (Command in error: ) show
$error /command get ErrorStringBuffer cvs show
72 640 moveto
vmstatus (Virtual memory: max: ) show ErrorStringBuffer cvs show
( used: ) show ErrorStringBuffer cvs show
( level: ) show ErrorStringBuffer cvs show
72 600 moveto
(Context:) show
1 1 5
{ pop currentpoint 16 sub exch pop 108 exch moveto
(\%stdin) (r) file ErrorStringBuffer readline exch show
% Status_of_readline_false_if_end_of_file
not { exit } if
} for
currentpoint 20 sub exch pop 72 exch moveto
(Execution Stack:) show
$error /estack get
length 1 sub % n-1
dup 100 sub dup % n-1 n-101 n-101
0 lt % n-1 n-101 n-101<0
{ 0 } { dup } ifelse % n-1 n-101 max(0,n-101)
exch pop -1 exch % n-1 -1 max(0,n-101)
{ currentpoint 16 sub exch pop 108 exch moveto
$error /estack get exch get ErrorStringBuffer cvs show
} for
} stopped pop
showpage
{
72 680 moveto
(Operand Stack:) show
$error /ostack get
length 1 sub % n-1
dup 100 sub dup % n-1 n-101 n-101
0 lt % n-1 n-101 n-101<0
{ 0 } { dup } ifelse % n-1 n-101 max(0,n-101)
exch pop -1 exch % n-1 -1 max(0,n-101)
{ currentpoint 16 sub exch pop 108 exch moveto
$error /ostack get exch get % Item from operand stack
dup type ErrorStringBuffer cvs show (: ) show
ErrorStringBuffer cvs show
} for
} stopped pop
showpage
} put
% The following is a test example of an error...
4 5 6 [1 2 3] (Fred was here) notandexistingoperator morebadstuff
This is a line of text
There is a little more
% A comment line
There follows more
and more
Len Hamey
Macquarie University
Technical Details
Message-ID:
<54576311@May.NTT.JP>Path:
arc1-ca.pugleaf.net!sparky!uunet!ccut!news.u-tokyo.ac.jp!wnoc-tyo-news!etl.go.jp!gama!lab!amagai.MayReferences:
<TAO.93Mar3195156@ra13.zuken.co.jp>Show Full Headers
Complete Article Headers
X-Google-Language: Japanese,JIS X-Google-Thread: fa2ca,edbb0ec8090c30da X-Google-Attributes: gidfa2ca,public X-Google-ArrivalTime: 1993-03-03 21:53:18 PST Path: arc1-ca.pugleaf.net!sparky!uunet!ccut!news.u-tokyo.ac.jp!wnoc-tyo-news!etl.go.jp!gama!lab!amagai.May From: amagai@May.NTT.JP (Amagai Yoshiji) Newsgroups: fj.lang.postscript Subject: Re: printer Message-ID: <54576311@May.NTT.JP> Date: 3 Mar 93 15:15:11 GMT References: <TAO.93Mar3195156@ra13.zuken.co.jp> Sender: news@lab.ntt.jp Reply-To: amagai@nuesun.ntt.jp Distribution: fj Organization: NTT Basic Research Laboratories, Musashino Tokyo, JAPAN Lines: 90