Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!elroy.jpl.nasa.gov!decwrl!mcnc!uvaarpa!murdoch!usenet From: pts@faraday.clas.Virginia.EDU (Paul T. Shannon) Newsgroups: comp.sys.next Subject: postscript: returning values to my application Message-ID: <1991Mar21.160137.13875@murdoch.acc.Virginia.EDU> Date: 21 Mar 91 16:01:37 GMT Sender: usenet@murdoch.acc.Virginia.EDU Distribution: na Organization: University of Virginia Lines: 33 I sent this to the next programmers' mailing list, but it doesn't seem to have been distributed -- it didn't come back to me as my messages have before. I apologize if you're seeing this for the second time. I'm doing some very straightforward postscript programming, using single- operator functions from Objective-C. My problem comes when I need to return to a specific point on the screen (or page) after drawing a string. The length of the string is only known at run-time. I've tried two techniques: 1. calling PScurrentpoint (&x, &y) before drawing the string 2. calling PSstringwidth (string, &width, &height), so that I can then call PSrmoveto (-width, 0.0) after the string is drawn. Both of these work fine with Display PostScript. However neither work with a printer or with Preview. The printer (an Apple LaserWriter) prints nothing; Preview gives this error message: The PostScript code of the document erroneously tried to return values to the application... So it seems that while it's no problem for DPS to tell my application what it asks for (either current position or a string's width), it's impossible for either the LaserWriter or Previewer to send this information back to me. Can someone suggest an approach that works in all 3 contexts, DPS, Previewer, and a printer? Thanks. - Paul Shannon pts@Virginia.EDU