[reportlab-users] Page n of m?

Harald Armin Massa haraldarminmassa at gmail.com
Wed Aug 13 09:25:09 EDT 2008


Yes, it is possible.

Usually the solution is:

1) add "Page <actual Page> of" to the footer of your Page
canv.drawRightString(10*cm, 0.75*cm, u"Page %s of % (doc.page,))

2) add a PDF-Form to the place right of the "of"
canv.doForm("pageCount")

3) render the PDF
4) after the rendering, fill the Number of Pages into PDF-Form which
gets drawn after the "of"
def _endBuild(self):
self.canv.beginForm("pageCount")
self.canv.setFont(fontnormal,7)
self.canv.drawString(12*cm,0.75*cm u"%s" % (self.canv.getPageNumber(),))
self.canv.endForm()
BaseDocTemplate._endBuild(self)


Best wishes,

Harald

On Wed, Aug 13, 2008 at 14:13, <Paul.Keating at nibc.com> wrote:

> My users want a report that says "Page n of m" where m is the last page

> number.

>

> Is this possible?

>

> --

> Paul Keating

> The Hague

>

> _______________________________________________

> reportlab-users mailing list

> reportlab-users at reportlab.com

> http://two.pairlist.net/mailman/listinfo/reportlab-users

>




--
GHUM Harald Massa
persuadere et programmare
Harald Armin Massa
Spielberger Straße 49
70435 Stuttgart
0173/9409607
no fx, no carrier pigeon
-
EuroPython 2009 will take place in Birmingham - Stay tuned!


More information about the reportlab-users mailing list