开发者

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

开发者 https://www.devze.com 2023-02-09 20:23 出处:网络
I\'m building a pdf document wit开发者_运维技巧h reportlab, using the Paragraph class: doc = SimpleDocTemplate(response, leftMargin=lateral_margin, rightMargin=lateral_margin,

I'm building a pdf document wit开发者_运维技巧h 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消