2011-02-08 28 views
1

我建立與ReportLab的PDF文檔的末尾添加一個字符串,用款類:Python和ReportLab的:在每一頁

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) 

現在我想在每一頁的末尾添加字符串,我該怎麼做?

回答

3

您的build調用可以包括onFirstPageonLaterPages參數,它們是頁面啓動時調用的函數。您可以在畫布上繪製這些函數,以在每個頁面上創建固定位置元素,如頁眉和頁腳。

+0

是的,你是對的。謝謝 –