Xref: utzoo comp.lang.postscript:7300 comp.unix.questions:28100 comp.sources.wanted:14906 Path: utzoo!utgpu!watserv1!watmath!att!emory!wuarchive!uunet!mcsun!corton!irisa!decouty From: decouty@irisa.fr (Bertrand Decouty) Newsgroups: comp.lang.postscript,comp.unix.questions,comp.sources.wanted Subject: Re: selecting pages from PostScript Message-ID: <1991Jan17.140803.768@irisa.fr> Date: 17 Jan 91 14:08:03 GMT References: <1991Jan12.194650.25292@starnet.uucp> <1091@ecicrl.UUCP> <1991Jan17.082652.24288@msuinfo.cl.msu.edu> Sender: news@irisa.fr Organization: IRISA-INRIA, Campus de Beaulieu, 35042 Rennes Cedex, FRANCE Lines: 71 In article <1991Jan17.082652.24288@msuinfo.cl.msu.edu> raja@cpswh.cps.msu.edu writes: | | In article <1091@ecicrl.UUCP>, (Chris Lewis) writes: | < In article <1991Jan12.194650.25292@starnet> (Mark Zellers) writes: | < >In article <1991Jan10.171621@madmax> (Kenstir) writes: | | < >>Is it possible for a filter to select only certain pages | < >>from a PostScript document? I have a huge document | < >>(thanks, OSF/Motif) which I need to print in small chunks | < >>so as not to offend the community at large by hogging | < >>the printer. | < [......] | | | In fact, if you have the `Transcript' filters | (which you probably do), you can do it quite | simply using psrev: | | "psrev -s 23,65-69,81 file.ps | lpr" | | will print pages 23,65-69, and 81 on your | default printer. Check the psrev man page. [....] | | | Narayan Sriranga Raja. I think you are speaking about printing motif manual ps document. We have been faced recently to the same trouble. It is a huge file (around 15 MBytes), made with (di?)troff and so no epsf (begins with %! only). More, it includes a lot of figures, each figure being an included epsf file with %%Page: comment. I have tried psrev (several versions from Transcript). No one worked because of figures. So i suggest you the following method, which uses sed (remember it is a 15 MB file...): 1- first locate the prologue sed -e "1,/%%EndProlog/w prolog.ps" manual.ps >/dev/null (from memory, in fact manual.ps is all.ps) 2- then prints selected pages: sed -e "/Page: label 70/,/Page: label 75/w tmp" manual.ps >/dev/null cat prolog.ps tmp |lpr (and you print pages 70 to 75) Notes: - prolog.ps MUST begin with %! - as sed reads each time the whole file, it is rather long, but... - do not try this method for pages <=46 because there is a page # 460! - print few pages together because due to figures, some pages are huge: e.g.: pages 5-11 to 5-14 are 900 KB long. - if somebody has a better method, tell us! Flame: IMHO, it is a shame a company like OSF can't produce a real ps file using decent products. At least, they could have cut their man into several parts. Don't forget many people print on laserwriter at 9600 bauds! Time to download 15 megabytes?? Disclaimer: i speak for myself Bertrand Decouty. -- [ Bertrand DECOUTY | EMAIL : decouty@irisa.fr, decouty@irisa.uucp ] [ IRISA - INRIA (Atelier) | {uunet,mcsun,inria}!irisa!decouty ] [ Campus de Beaulieu | PHONE : +33 99 36 20 00 ] [ F-35042 Rennes Cedex - FRANCE| FAX : +33 99 38 38 32 | TELEX: 950473 UNIRISA]