🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.postscript
Article #5399

Re: extract odd/even pages from postscript file

#5399
From: Graham Freeman
Date: Thu, 18 Apr 1991 06:45
42 lines
1696 bytes

ruck@reef.cis.ufl.edu (John Ruckstuhl) writes:
>  
> I would like to print some PostScript documents double-sidedly.
> If there is a PostScript page-eject command, I'd guess there is a simple
> awk or perl solution which can extract odd (or even) pages for me to
> print.  Then of course I can restock my LaserWriter's feed tray and
> print the opposite sides.


I would suggest including the following PostScript at the head of
your file, to print the even numbered pages:

%!
% Even pages
/oldshowpage /showpage load def
/showpage
 {
    0 begin /PageNo PageNo 1 add def PageNo 2 mod 0 eq
    {oldshowpage}{erasepage} ifelse end
 }bind def
/showpage load 0 1 dict dup /PageNo 0 put put


and this at the head to print only the odd pages:

%!
% Odd pages
/oldshowpage /showpage load def
/showpage
 {
    0 begin /PageNo PageNo 1 add def PageNo 2 mod 0 eq
    {erasepage}{oldshowpage} ifelse end
 }bind def
/showpage load 0 1 dict dup /PageNo 0 put put


These fragments redefine the "showpage" operator to erase or show
the alternate pages.

                                     Graham Freeman
Technical Details
Message-ID: <1991Apr18.064512.19628@sserve.cc.adfa.oz.au>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!rpi!batcomputer!munnari.oz.au!manuel!ccadfa!sserve!csadfa!gfreeman
References: <28017@uflorida.cis.ufl.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!rpi!batcomputer!munnari.oz.au!manuel!ccadfa!sserve!csadfa!gfreeman
From: gfreeman@csadfa.cs.adfa.oz.au (Graham Freeman)
Newsgroups: comp.lang.postscript
Subject: Re: extract odd/even pages from postscript file
Message-ID: <1991Apr18.064512.19628@sserve.cc.adfa.oz.au>
Date: 18 Apr 91 06:45:12 GMT
References: <28017@uflorida.cis.ufl.EDU>
Sender: news@sserve.cc.adfa.oz.au
Organization: Australian Defence Force Academy, Canberra, Australia
Lines: 42