Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!rex!mandel@vax.anes.tulane.edu From: mandel@vax.anes.tulane.edu (Jeff E Mandel MD MS) Newsgroups: comp.sys.mac.programmer Subject: Re: downloading a PostScript header, interacting with a PS printer Message-ID: <6131@rex.cs.tulane.edu> Date: 13 Feb 91 20:27:52 GMT References: <1991Feb12.101257.23988@brolga.cc.uq.oz.au> Sender: news@rex.cs.tulane.edu Organization: Tulane University School of Medicine Lines: 42 In article <1991Feb12.101257.23988@brolga.cc.uq.oz.au> vthrc@brolga.cc.uq.oz.au (Danny Thomas) writes: >I would like to know the best way(s) to communicate between an application >and a PostScript printer. > >The PS header proc set can't be defined within a page (ie first) unless it >is going to be prepended to every one because each close page does a >grestore to the state at the beginning of the page erasing those >definitions, but I don't seem to be able to include the PS code in the >stuff going to the printer unless it is being output on an open page. >How do you output PS to the Printer Manager so it is placed in the Proc >Set component of a PS file? preferably with the Printer Manager placing >it between the proper document structuring comments, or do you have to >bypass the Printing Manager? > Here is what you need to know. The LaserWriter driver does do a grestore between pages, and since it does the gave prior to the first page, this is a minor nuisance. There is a work-around, however. The LaserWriter driver will transmit the contents of a PREC resource #103 prior to the gsave (if one is present in the resource heirarchy). The resource is plain text, not length byte, no null byte, just PostScript, straight no chaser. The way I use it is: type 'PREC' { string; }; resource 'PREC' (103) { "/jeffDict 50 dict def jeffDict begin " [useful definitions] "end" }; Note that each line should end with a white space, as Rez will otherwise run lines together. This is not well documented by Apple, but I was able to peice it together from various sources, and it works. I have a HyperCard XCMD that makes use of this which I use for mailing lists. Jeff E Mandel MD MS Asst Professor of Anesthesiology Tulane University School of Medicine New Orleans, LA