简体   繁体   English

如何将PDFBox.jar集成到Android Project中?

[英]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.

相关问题 使用pdfbox.jar将pdf文件转换为文本文件时,出现以下错误。如何解决这些问题? - While converting pdf file to text file using pdfbox.jar , I am getting below error.How to resolve these? 如何为java项目生成jar文件并在android项目中使用jar - How to generate a jar file for a java project and use the jar in an android project 如何将CreativeSDKImage与现有的Parse Android项目集成? - How to integrate CreativeSDKImage with an exisiting Parse Android Project? 当没有jar文件可用时,将另一个开源项目集成到Android项目中的规范方法是什么? - What is the canonical way to integrate another open source project into an Android project when no jar file is available? 在android项目中集成Liblinphone 4 - Integrate Liblinphone 4 in android project 如何在Eclipse中导出Android库项目的jar - How export jar of a android library project in eclipse 如何将Android库项目转换为外部JAR? - How to Convert an Android Library Project to an External JAR? 如何在Gluon Project中引用android.jar - How to reference android.jar in Gluon Project Java:如何使用自定义Ant build.xml将ProGuard集成到Jar项目中 - Java: How to integrate ProGuard in Jar Project using custom Ant build.xml 如何在我的android studio项目中集成第三方应用程序apk? - How to integrate third party app apk in my android studio project?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM