开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜