我正在使用旧版本的itext(因为新版本有一些许可证问题)来生成PDF文件,它也可以使用较新版本的itext和droidtext顺利运行,但是我在这个旧版本的itext中遇到运行时错误-2.1.7。 错误日志如下:
09-25 17:33:49.035: E/AndroidRuntime(1379): FATAL EXCEPTION: main
09-25 17:33:49.035: E/AndroidRuntime(1379): java.lang.NoClassDefFoundError: java.awt.Color
09-25 17:33:49.035: E/AndroidRuntime(1379): at com.lowagie.text.pdf.PdfChunk.color(Unknown Source)
09-25 17:33:49.035: E/AndroidRuntime(1379): at com.lowagie.text.pdf.PdfDocument.writeLineToContent(Unknown Source)
09-25 17:33:49.035: E/AndroidRuntime(1379): at com.lowagie.text.pdf.PdfDocument.flushLines(Unknown Source)
09-25 17:33:49.035: E/AndroidRuntime(1379): at com.lowagie.text.pdf.PdfDocument.newPage(Unknown Source)
09-25 17:33:49.035: E/AndroidRuntime(1379): at com.lowagie.text.pdf.PdfDocument.close(Unknown Source)
09-25 17:33:49.035: E/AndroidRuntime(1379): at com.lowagie.text.Document.close(Unknown Source)
09-25 17:33:49.035: E/AndroidRuntime(1379): at com.darshanmukadam.expensereports.PdfCreator.create_pdf(PdfCreator.java:195)
09-25 17:33:49.035: E/AndroidRuntime(1379): at com.darshanmukadam.expensereports.PdfCreator.access$0(PdfCreator.java:125)
09-25 17:33:49.035: E/AndroidRuntime(1379): at com.darshanmukadam.expensereports.PdfCreator$2.onItemClick(PdfCreator.java:108)
09-25 17:33:49.035: E/AndroidRuntime(1379): at android.widget.AdapterView.performItemClick(AdapterView.java:301)
09-25 17:33:49.035: E/AndroidRuntime(1379): at android.widget.AbsListView.performItemClick(AbsListView.java:1490)
09-25 17:33:49.035: E/AndroidRuntime(1379): at android.widget.AbsListView$PerformClick.run(AbsListView.java:3275)
09-25 17:33:49.035: E/AndroidRuntime(1379): at android.widget.AbsListView$1.run(AbsListView.java:4518)
09-25 17:33:49.035: E/AndroidRuntime(1379): at android.os.Handler.handleCallback(Handler.java:725)
09-25 17:33:49.035: E/AndroidRuntime(1379): at android.os.Handler.dispatchMessage(Handler.java:92)
09-25 17:33:49.035: E/AndroidRuntime(1379): at android.os.Looper.loop(Looper.java:137)
09-25 17:33:49.035: E/AndroidRuntime(1379): at android.app.ActivityThread.main(ActivityThread.java:5283)
09-25 17:33:49.035: E/AndroidRuntime(1379): at java.lang.reflect.Method.invokeNative(Native Method)
09-25 17:33:49.035: E/AndroidRuntime(1379): at java.lang.reflect.Method.invoke(Method.java:511)
09-25 17:33:49.035: E/AndroidRuntime(1379): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
09-25 17:33:49.035: E/AndroidRuntime(1379): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
09-25 17:33:49.035: E/AndroidRuntime(1379): at dalvik.system.NativeStart.main(Native Method)
我在谷歌搜索但我找不到任何解决方案,任何想法发生了什么? 提前谢谢。
答案 0 :(得分:0)
Android没有get()
。您的iText版本与Android不兼容,至少对于您投入java.awt.Color
的内容是什么。
答案 1 :(得分:0)
Library java.awt。*不是Android的一部分。 Android使用不同的技术来创建元素。