2009-12-21 71 views

回答

3

只要你正在實現PdfPageEvent接口,你只需要覆蓋public void onEndPage(PdfWriter writer, Document document)方法,在新頁面啓動之前調用該方法。

編輯:這裏的一些代碼解釋的過程中,不知道你想要做什麼,如果一個新的頁面被iTextSharp的創建,這是最讓我可以給你:

Public Class YourReport 
    Implements PdfPageEvent 

    'Your report code 

    Public Overrides Sub onEndPage(ByVal writer as PdfWriter, 
             ByVal doc as Document) 
    'if you get here, a new page was created by iTextSharp 
    'so do what you need to do. 
    End Sub 

End Class 
+0

jball我怎麼做? – 2009-12-21 17:19:46

+1

覆蓋Sub onEndPage(ByVal作爲PdfWriter,ByVal文檔作爲文檔) – jball 2009-12-21 17:24:02

+0

所以我只是把該行放入子,它不會生成一個新的頁面? – 2009-12-21 17:26:39