2013-04-02 109 views
0

我在itext pdf上工作時,我擴展了一個PdfPageEventHelper類,它顯示下面的錯誤。itext pdf在tapestry

Base class com.lowagie.text.pdf.PdfPageEventHelper (super class of 
de.fu_berlin.inf.klausurenportal.pages.question.TableHeader) is not in a controlled package 
and is therefore not valid. You should try moving the class to package 
de.fu_berlin.inf.klausurenportal.base. 
+0

包名中包含我的名字(Lowagie)的類已過時,不應再使用。請升級到更新的iText版本。 –

回答

0

看來你的部件是從com.lowagie.text.pdf.PdfPageEventHelper類,它是不是掛毯控制包內延伸。所有tapestry5組件和頁面的超類應放置在root.base包中。

http://tapestry.apache.org/component-classes.html#ComponentClasses-ComponentPackages

但你可以實現PdfPageEvent接口來代替。您甚至可以在root.base包中創建類似PdfPageEventHelper類的內容並對其進行擴展。

但是你真的需要在你的組件中使用這個類嗎?您可以使用PdfPageEvent作爲單獨的課程,例如作爲頁面的內部類或作爲實用程序類。