Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!rutgers!netnews.upenn.edu!dsinc!unix.cis.pitt.edu!pitt!speedy.cs.pitt.edu!jonathan From: jonathan@speedy.cs.pitt.edu (Jonathan Eunice) Newsgroups: comp.unix.aix Subject: Re: How to use Display PostScript to preview PS? Keywords: DPS PostScript previewer Message-ID: <9635@pitt.UUCP> Date: 4 Jan 91 22:46:14 GMT References: <9632@pitt.UUCP> <9634@pitt.UUCP> Sender: news@pitt.UUCP Reply-To: jonathan@speedy.cs.pitt.edu.UUCP (Jonathan Eunice) Organization: University of Pittsburgh Computer Science Lines: 38 For those of you that do not want to figure out how to redefine the showpage operator to pause for input just to get dpsexec to work, the following PostScript fragment may be helpful. Put it in a file, say showpage.ps, and run it before trying to preview PS files. Whenever the PostScript interpreter runs into a showpage command, it will pause for a character of input, such as space or return. Thus multi-page files can be viewed. ----------- showpage.ps ----------- /wait-for-input { { (%stdin) (r) file read % read from stdin {pop exit} % if char avail, pop and exit {exit} % otherwise EOF, just exit ifelse } loop % wait for exit } def userdict /oldshowpage % prepare to add to userdict systemdict /showpage get % get guts of showpage routine put % oldshowpage now available /showpage { wait-for-input % redefine showpage to wait oldshowpage } def ----------- showpage.ps ----------- It would be nice to be able to say $cat showpage.ps mypostscriptfile.ps | dpsexec and have that work. Unfortunately, dpsexec exhibits strange behavior when I've tried this. [Anyone who can explain this, I'm curious.] The PS run command works considerably better than I/O redirection. If you use run, note that it expects absolute pathnames. Eg: $dpsexec PS>(/usr/lpp/DPS/showpage.ps) run PS>(/usr/lpp/DPS/mypostscriptfile) run