Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!decwrl!adobe!greid From: greid@adobe.com (Glenn Reid) Newsgroups: comp.lang.postscript Subject: Re: n-up printing of Encapsulated PS file Message-ID: <410@adobe.UUCP> Date: 7 Feb 89 20:23:34 GMT References: <6114@phoenix.Princeton.EDU> Sender: news@adobe.COM Reply-To: greid@adobe.COM (Glenn Reid) Organization: Adobe Systems Incorporated, Mountain View Lines: 73 In article <6114@phoenix.Princeton.EDU> rjchen@phoenix.Princeton.EDU (Raymond Juimong Chen) writes: >Now, merely redefining /showpage doesn't seem to be feasible, since >the /eop macro might have been "bind def"'ed, so that it always >grabs the "official" showpage macro. If you redefine "showpage" before "eop" is defined, there is no problem. If you read carefully the description of the "bind" operator, it only binds names which point to objects of type "operatortype". Thus the following will work just fine: /showpage { (showpage redefined here) = flush } def /eop { showpage } bind def In general, when you redefine something you send it ahead of the whole file, so using "bind" doesn't cause a problem. There are many EPSF files which do not contain "showpage" (for example, Adobe Illustrator files). It is probably better to write a front-end filter to place them exactly where you want them: %! /*showpage /showpage load def /showpage {} def /page save def 0 792 2 div translate .5 .5 scale % file 1 here page restore /page save def 612 2 div 792 2 div translate .5 .5 scale % file 2 here page restore /page save def 0 0 translate .5 .5 scale % file 3 here page restore /page save def 612 2 div 0 translate .5 .5 scale % file 4 here page restore *showpage or something like that. Then it doesn't matter whether they execute "showpage" or not. You call it when you want the page printed. This is, in fact, something like what a page layout program would do with four EPSF files that were placed in four quadrants of the page and scaled to 50% each. There is one major caveat: the EPSF files may not have a standard bounding box, and you must correct for this in order for the preceding scheme to work. You have to read the %%BoundingBox comment, take the first two numbers, and add a final "translate" (it's important to put it after the "scale" command) with the negatives of those coordinates. For example, if the bounding box for file 3 is %%BoundingBox: -10 -792 602 -792 You would add one more line to the above example for file 3 that looked like this: 10 792 translate I hope this makes some sense. Glenn Reid Adobe Systems