如何在 android 中使用 tom rush 的 apache pdfbox 端口按原样显示 PDF 文件的内容?
最佳答案
可以查看dependencies page PDFBox 文档。
这是文档中的引述:
The three PDFBox components are named pdfbox, fontbox and jempbox. The Maven groupId of all PDFBox components is org.apache.pdfbox.
The fontbox and jempbox components are standalone libraries for handling font information and XMP metadata. These components have no external dependencies and can be used simply by adding the respective jar files to the classpath of your application.
The main PDFBox component, pdfbox, has hard dependencies on the fontbox and jempbox components and the commons-logging library.
正如它所说,有 2 个依赖项,jempbox 和 fontbox(它们也是开源的)。两者都依赖于 commons-logging,它可以以某种方式设置为不需要 log4j,而是使用标准的 Java 日志记录 API。我不知道 Android 是否完全实现了标准的 Java 日志记录 API。
反正如果你用的是Eclipse,设置源码依赖是没有问题的。只需为每个库源创建一个 Java 项目,并在其构建路径中将您的 Android 项目设置为依赖于这些 Java 项目。我已经这样做了,而且工作正常。
关于android - 使用 PDFBox 在 Android 中显示 PDF 文件的内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7126594/