android - 使用 PDFBox 在 Android 中显示 PDF 文件的内容

标签 android pdf pdfbox

如何在 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/

相关文章:

android - 使用服务中的媒体播放器在后台播放视频

android - 使用 firebase 的用户数据的 json 格式

python - 自动将 PDF 转换为图像

javascript - 图像质量差使用 JSPDF 将 Google Charts 插入 PDF

java - 使用 PDFBox 2.0.0 签署加密的 PDF 文档

java - 使用 Bouncy CaSTLe 和 PDFBox 在 Java 中验证 PDF 签名

java - 动态添加行到表 - Easytable (PDFBox)

android - 启动 ActionMode 时的两个操作栏

android - 如何在创建时不可见的 ScrollView (位于线性布局内)中保留 View ?

java - 使用 PDFBox 添加页码