Is there a way to access the pdf page labels so that I can use them in
drawing the page numbers on the page and including them in a table of
contents?
Jeff
-------------8<-------------------8<-------------------8<------------------
from reportlab.pdfgen import canvas
from reportlab.lib.units import cm
c = canvas.Canvas("page_numbering.pdf")
c.addPageLabel(c.getPageNumber()-1, 'ROMAN_LOWER')
for num in ['i', 'ii', 'iii', 'iv', 'v']:
c.drawString(3*cm, 3*cm, num)
c.showPage()
c.addPageLabel(c.getPageNumber()-1, 'ARABIC')
for num in range(1,5):
c.drawString(3*cm, 3*cm, str(num))
c.showPage()
c.addPageLabel(c.getPageNumber()-1, 'ARABIC', 10)
for num in range(10,15):
c.drawString(3*cm, 3*cm, str(num))
c.showPage()
c.addPageLabel(c.getPageNumber()-1, 'ARABIC', prefix='A.')
for num in range(1,5):
c.drawString(3*cm, 3*cm, 'A.' + str(num))
c.showPage()
c.save()
_______________________________________________
reportlab-users mailing list
reportl...@lists2.reportlab.com
http://two.pairlist.net/mailman/listinfo/reportlab-users
What is actually stored in the PDF is just a reference for each time
the page numbering changes. Each page does not store its page number
and numbering system, this is calculated by the PDF reader when the
page is displayed. Thus there is nothing which will let you query the
logical page number (PageLabel) of a particular page directly from the
PDF.
Christian
2009/11/14 Jeffrey O'Neill <jeff....@openstv.org>: