【问题标题】:Python and ReportLab: add a string at the end of every pagePython 和 ReportLab:在每页末尾添加一个字符串
【发布时间】:2011-02-08 23:23:48
【问题描述】:

我正在用 Reportlab 构建一个 pdf 文档,使用 Paragraph 类:

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)  

现在我想在每个页面的末尾添加一个字符串,我该怎么做??

【问题讨论】:

    标签: python django reportlab


    【解决方案1】:

    您的build 调用可以包含onFirstPageonLaterPages 参数,它们是页面启动时调用的函数。您可以在这些函数中的画布上绘制,以在每个页面上创建固定位置的元素,例如页眉和页脚。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-07-30
      • 2010-10-10
      • 2017-04-10
      • 2016-01-03
      • 1970-01-01
      • 1970-01-01
      • 2016-07-20
      • 2021-10-06
      相关资源
      最近更新 更多