Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!ucsd!network.ucsd.edu!keynes.ucsd.edu!pbiron From: pbiron@keynes.ucsd.edu (Paul Biron) Newsgroups: comp.sys.next Subject: Re: Postscript Summary: errordict.ps Keywords: postscript errors, error handling, errordict Message-ID: <5113@network.ucsd.edu> Date: 3 Apr 91 18:03:14 GMT References: <13126@ur-cc.UUCP> <1461@toaster.SFSU.EDU> Sender: news@network.ucsd.edu Organization: SnUG/SIGHaCK, San Diego NeXT Users Group, Dev SIG Lines: 64 Nntp-Posting-Host: keynes.ucsd.edu In article <1461@toaster.SFSU.EDU> eps@cs.SFSU.EDU (Eric P. Scott) writes: >In article <13126@ur-cc.UUCP> esht_cif@troi.cc.rochester.edu > (Eran Shtiegman) writes: >>When I save a postscript file to disk, upload it to a sun and try and >>print it using lpr it does not work. > >What EXACTLY does not work? Do you get error messages back? >If so, what are they? > >> Does anyone know what I am doing >>wrong? Yes, when there is a ps error in a print job, many times you get no feedback from the printer as to what the problem was (as you do in say, Yap, for example). Here's a little something that I picked up somewhere to help with debugging ps files. Just prepend this to the front of your ps file (e.g. cat errordict.ps yourfile.ps | lpr -Pprinter), and then any ps errors will be printed out so that you can see what they were (my guess in this case, the file uses a font such as Olhfs, which is on the NeXT but not on the Sun). --------------------------------Cut Here------------------------ %! % Error handler to be prepended to postscript files... % % HISTORY % 17-Feb-89 Dan Nydick (dan) at Carnegie-Mellon University % Created. % % define an error handler errordict begin /handleerror { systemdict begin $error begin userdict begin /str 40 string def initgraphics /Courier findfont 12 scalefont setfont 0 setgray /lmarg 72 def /hgt 720 def /nl {/hgt hgt 20 sub def lmarg hgt moveto} def lmarg hgt moveto (Postscript error detected) show nl (Error: ) show errorname str cvs show nl (Offending command: ) show /command load str cvs show nl (Stack:) show /lmarg lmarg 37 add def nl $error /ostack get aload length { str cvs show nl } repeat systemdict /showpage get exec end end end % userdict $error systemdict } def end %errordict --------------------------------Cut Here------------------------