简体   繁体   中英

Python and ReportLab: add a string at the end of every page

I'm building a pdf document with reportlab, using the Paragraph class:

doc = SimpleDocTemplate(response, leftMargin=lateral_margin, rightMargin=lateral_margin,
    topMargin=top_bottom_margin, bottomMargin=top_bottom_margin)
Document = []
Document.append(Paragraph("bla bla bla bla", my_style))
doc.build(Document)  

Now I want to add at the end of every page a string, how can I do that??

Your build call can include onFirstPage and onLaterPages arguments, which are functions invoked when the page starts. You can draw on the canvas in those functions to create fixed-position elements on each page, like page headers and footers.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM