Article View: comp.lang.postscript
Article #5666Re: Help with possible redef of showpage
From: Ross Cartlidge
Date: Tue, 14 May 1991 01:54
Date: Tue, 14 May 1991 01:54
65 lines
1857 bytes
1857 bytes
west@widgit.enet.dec.com (Jim West (Stealth Contractor)) writes:
> I'm teaching myself PostScript and have gone thru the 'Tutorial and
>Cookbook' and have stumbled my way thru the LRM.
> Here's what I'm trying to accomplish :
> I need the capability to redefine showpage to put a label at the top
> and bottom of every page and to print a running page number on each page
> as well.
Try this prepended to your PS
Hope this helps
%!PS
/page# 0 def
/showpage
[
{
initgraphics
/page# page# 1 add def
/Courier findfont 12 scalefont setfont
% Put your stuff here -
% this just write Page N at 100 100
100 100 moveto
(Page ) dup 5 3 getinterval page# exch cvs pop show
}
/exec cvx
/showpage load
dup type /operatortype ne
{
/exec cvx
}
if
]
cvx def
% overload restore because it will change the value of page#
/restore
[
{
page#
exch
}
/exec cvx
/restore load
dup type /operatortype ne
{
/exec cvx
}
if
{
/page# exch def
}
/exec cvx
]
cvx def
--
________________________________________________________________________
Ross Rodney Cartlidge | rossc@extro.ucc.su.oz.au
University Computing Service, H08 | Phone: +61 2 6923497
University of Sydney, NSW 2006, Australia | FAX: +61 2 6606557
Technical Details
Message-ID:
<rossc.674186073@extro>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!samsung!munnari.oz.au!metro!extro!rosscReferences:
<3138@shodha.enet.dec.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!samsung!munnari.oz.au!metro!extro!rossc From: rossc@extro.ucc.su.OZ.AU (Ross Cartlidge) Newsgroups: comp.lang.postscript Subject: Re: Help with possible redef of showpage Message-ID: <rossc.674186073@extro> Date: 14 May 91 01:54:33 GMT References: <3138@shodha.enet.dec.com> Sender: news@metro.ucc.su.OZ.AU Organization: Sydney University Computing Service, Sydney, NSW, Australia Lines: 65 Nntp-Posting-Host: extro.ucc.su.oz.au