[reportlab-users] Re: print "page <Page> of <PageCount> pages"

Jerome Alet reportlab-users@reportlab.com
Sun, 4 Jan 2004 23:24:24 +0100


Good evening, and happy new year to all

On Sun, Jan 04, 2004 at 11:05:24PM +0100, Luc Saffre wrote:
> 
> On 04.01.2004 16:42, Henning von Bargen wrote:
> 
> >AFAIK there are several ways to achieve this.
> >I have written my own DocTemplate class where this works very well (but it
> >requires two build() passes).
> >I haven't got the source code here, but could send it to you next week if
> >you like.

A way to do this in one pass is to define a PDF form. You do all 
your document as usual, but when you want to print "/ xx", you just 
print the PDF form (doForm IIRC). And the interesting part is that 
you never define the PDF form before the document is complete, then 
you know the number of pages and can do the beginForm/endForm (which 
contents print the appropriate value) 

I've never tried, but I remember having seen this in the mailing
list archives.

Hoping this helps

bye

Jerome Alet

-- 
"A non-free program is a predatory social system that keeps people 
in a state of domination and division, and uses the spoils to 
dominate more." - RMS