[英]How to integrate PDFBox.jar into Android Project?
I am aware that this question has been asked several times however I can not solve my problem. 我知道这个问题已经问过几次了,但是我不能解决我的问题。 I am using pdfbox-1.8.7.jar.
我正在使用pdfbox-1.8.7.jar。 My intention is to read the content of a
PDF
document and output it in the console. 我的意图是阅读
PDF
文档的内容并将其输出到控制台中。
I put the pdfbox-1.8.7.jar into the libs folder. 我将pdfbox-1.8.7.jar放入libs文件夹。 app/libs/pdfbox-1.8.7.jar .
app / libs / pdfbox-1.8.7.jar 。 I am able to import the content of the jar, into my class.
我可以将jar的内容导入到我的课程中。
import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.util.PDFTextStripper;
But if I run the application, an exception occurs: 但是,如果我运行该应用程序,则会发生异常:
FATAL EXCEPTION: main
java.lang.NoClassDefFoundError: org.apache.pdfbox.pdmodel.PDDocument
You have to use the Android Forked version of PDF Box 您必须使用Android Forked版本的PDF Box
https://github.com/Birdbrain2/PdfBox-Android https://github.com/Birdbrain2/PdfBox-Android
It has the Gradle Build which will work on Android Studio 它具有可以在Android Studio上运行的Gradle Build
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.