Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!decwrl!bacchus.pa.dec.com!wsl.dec.com!heiney From: heiney@wsl.dec.com (Bob Heiney) Newsgroups: comp.lang.postscript Subject: Re: showpage-layering (eg. print-odd-pages-only) Keywords: showpage,troff,word-perfect,PSPRINT,problems Message-ID: <1990Aug14.163226.1253@wrl.dec.com> Date: 14 Aug 90 16:32:26 GMT References: <30532.26c6bf13@ccavax.camb.com> Sender: news@wrl.dec.com (News) Reply-To: heiney@wsl.dec.com (Bob Heiney) Organization: DEC Western Software Lab Lines: 57 The best way to achieve what you want would be to exploit the page comments that a good PostScript file gives you. By putting "%!-PS-Adobe-2.0" (or other version #) at the top, documents claim that they will follow a set of conventions that would easily give you the tools you need. You can get "struct.ps" from the Adobe file server if you want to see what's in the lastest version of the conventions. Unfortunately, in the words of Brian Reid (who came up with the original commenting conventions): "They're one of those things that everyone agrees is a great idea, easy easy to do, etc. -- but no one follows them." I foolishly whipped up an awk script to do segmentation of large files. I was at Berkeley at the time, and was constantly annoyed by people printing HUGE ps files. My 1000 byte job was always next in the queue after one of those monsters. So, since I occasionally need to print big ps files too, I decided to write a segmenter that would split the ps file into n page chunks. That way no one would curse my name when I printed large documents. Unfortunately, the absolute worst thing about this whole matter is that while few (I can count them on one hand... :-( ) applications *actually* follow the document structuring (a.k.a. commenting) conventions, almost *ALL* claim they do by putting "%!-PS-Adobe-2.0" at the top of their code. This the requires artificial intelligence from the paging software to have it figure out what's going on. The most common problem is that pages are not independent like they're supposed to be. On the Mac, for example, the first time a font is used, a revectoring is done. Since this revectoring is crucial, and only done once, if you don't execute the page that the revectoring occurs on, you'll get an error. I wish I had some more helpful advice, but since messing around with showpage is bound to be hairy, and since people don't follow the commenting conventions, I think this is one of those "fix it by hand when you really have to do it" kind of problems. That or you can write really smart software. In the end, I think the best solution would be for all applications to either generate properly structured code, or stop claiming that they are compliant when they're not. Bob Heiney Graphics Consultant