forked from reingart/pyfpdf
-
Notifications
You must be signed in to change notification settings - Fork 1
AliasNbPages
Google Code Exporter edited this page Mar 18, 2015
·
1 revision
fpdf.alias_nb_pages()
Defines an alias for the total number of pages. It will be substituted as the document is closed.
alias:
The alias. Default value: {nb}.
class PDF(FPDF):
def footer(this):
# Go to 1.5 cm from bottom
this.set_y(-15)
# Select Arial italic 8
this.set_font('Arial','I',8)
# Print current and total page numbers
this.cell(0,10,'Page %s' % this.PageNo() + '/{nb}',0,0,'C')
pdf=PDF()
pdf.alias_nb_pages()
PageNo, Footer.