home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!stanford.edu!rutgers!uwvax!galtee.cs.wisc.edu!rose
- From: rose@galtee.cs.wisc.edu (Scott Rose)
- Newsgroups: comp.os.ms-windows.programmer.win32
- Subject: Re: I too have unable to print the PS files
- Message-ID: <1992Aug20.212702.19182@cs.wisc.edu>
- Date: 20 Aug 92 21:27:02 GMT
- References: <1992Aug10.180051.3140@titan.ksc.nasa.gov> <1992Aug20.063746.12690@microsoft.com> <1992Aug20.195819.18866@pony.Ingres.COM>
- Sender: news@cs.wisc.edu (The News)
- Organization: University of Wisconsin, Madison -- Computer Sciences Dept.
- Lines: 91
-
- In article <1992Aug20.195819.18866@pony.Ingres.COM> rion@Ingres.COM writes:
-
- >I have been able to print some of the docs, but with some problems.
- >
- >The tools manual is broken into some 20 or so files (corresponding to
- >chapters), but the Win32 API manuals are in two files around 2.5MB each!!
- >My postscript printer can print these just fine, but the print spool area is
- >limited to approx 1 MB, so the API manuals get truncated down to 372 pages.
- >
- >Does anyone know how to break up postscript files?
-
- I was able to get this to work by simply editing out all the code following
- the first showpage command and the showpage command associated with the page
- preceeding the first page I wanted. You do print the first page on each print
- run, but that might be cheaper than figuring out where the definitions end and
- the first page begin.
-
- Here is a gawk script that helps. Usage is
-
- <scriptname> -v page=<pagenumber>
-
- E.g.
-
- frompage -v page=272
-
- #!/usr/local/gawk -f
- BEGIN {
- foundFirst = 0;
- foundPage = 0;
- foundPageEnd = 0;
- if(page == 0) {
- print("usage");
- exit;
- }
- pagePattern = sprintf("(page %d", page);
- if(debug)
- print("pattern = " pagePattern);
- }
- {
- if(!foundFirst) {
-
- # haven't seen the first showpage yet
-
- if(i = index($0, "showpage")) {
-
- # here it is; print the prefix of the string including it
-
- foundFirst = 1;
- print(substr($0, 1, i+length("showpage")));
- }
- else {
-
- # always print lines that preceed the first showpage
-
- print($0);
- }
- }
- else {
-
- # HAVE seen the first "showpage"
-
- if(!foundPage) {
-
- # look for the line that indicates that we are on the start-after page
-
- if(index($0, pagePattern))
- foundPage = 1;
- }
- if(foundPage) {
-
- # HAVE seen our start-after page
-
- if(!foundPageEnd) {
-
- # look for the next "showpage"
-
- if(i = index($0, "showpage")) {
-
- # found it; everything following is printed
-
- foundPageEnd = 1;
- if(length($0) > i + length("showpage"))
- print(substr($0, i+length("showpage")));
- }
- }
- else {
- print($0);
- }
- }
- }
- }
-