简体   繁体   English

Android PDF 效果图

[英]Android PDF Rendering

I would like to render/open PDF file (stored in SDCard) in Android without using in-build application or viewer.我想在不使用内置应用程序或查看器的情况下在 Android 中渲染/打开 PDF 文件(存储在 SDCard 中)。

1) We have tried MuPDF open source library but rendering using this library is very slow. 1) 我们尝试过 MuPDF 开源库,但使用该库进行渲染非常慢。

2) Can we use iText library for rendering PDF files in Android (ie iText as a PDF Viewer). 2) Can we use iText library for rendering PDF files in Android (ie iText as a PDF Viewer).

Is there any other PDF library(open source) that can be used in Android Or suggest basic guideline for developing PDF viewer for Android.是否有任何其他 PDF 库(开源)可用于 Android 或建议为 PDF 查看器开发 PDF 84684E32C9AB780 的基本指南。

1) MuPDF is good to render textbook pdf in android while it may be slow to render pdf with big images. 1) MuPDF 可以很好地在 android 中渲染教科书 pdf,而用大图像渲染 pdf 可能会很慢。 A lot of customizations and improvements especially memory usage control need to do if you want the MuPDF to run fast and stable on android platform.如果您希望 MuPDF 在 android 平台上快速稳定地运行,需要进行大量自定义和改进,尤其是 memory 使用控制。 You can check out two open source projects VuDroid and apv which are based on MuPDF.您可以查看两个基于 MuPDF 的开源项目 VuDroid 和apv

2) It's up to your requirements. 2)这取决于您的要求。 The iText may be enough to render simple text pdf, but I don't think it has better performance than MuPDF or other libraries that developed by using C/C++. iText 可能足以渲染简单的文本 pdf,但我认为它没有比 MuPDF 或其他使用 C/C++ 开发的库更好的性能。

Another choice is to use Poppler .另一种选择是使用Poppler A successful story is the popular android app ezPDF Reader is based on Poppler, although it's violating GPL license.一个成功的案例是流行的 android 应用程序 ezPDF Reader 基于 Poppler,尽管它违反了 GPL 许可证。 The out of box Poppler needs more work than MuPDF to do to run on android smoothly.开箱即用的 Poppler 需要比 MuPDF 做更多的工作才能在 android 上顺利运行。 You can refer to the open source project apdfviewer .可以参考开源项目apdfviewer

I've done some research in this field recently, I've tried more than 14 libraries on Android, I've done simple benchmarking on some high resolution print-ready PDF magazines and I'm currently considering to use MuPDF or Radaee in work as they went out as the best.我最近在这个领域做了一些研究,我在 Android 上尝试了超过 14 个库,我在一些高分辨率的打印就绪 PDF 杂志上做了简单的基准测试,我目前正在考虑在工作中使用 MuPDF 或 Radaee因为他们是最好的。

I've tried VuDroid and apv as well and they are very unstable, they are crashing very often on complex PDF documents and very slow in comparsion to MuPDF or Radaee.我也尝试过 VuDroid 和 apv,但它们非常不稳定,它们经常在复杂的 PDF 文档上崩溃,并且与 MuPDF 或 Radaee 相比非常慢。

Since MuPDF and Radaee (and some other libraries) are written in pure C and are used on Android through NDK, they are giving the best possible performance (and they both are paid for a commercial use).由于 MuPDF 和 Radaee(以及其他一些库)是用纯 C 编写的,并通过 NDK 在 Android 上使用,因此它们提供了最佳性能(并且它们都为商业用途付费)。

Take a look at my PDF reader for Android here at anddev .在 anddev 上查看我的 PDF 阅读器,用于Android As I remember it uses modified PDFBox (without things related to editing), and features my own font converter (to feed fonts to Android and render them faster).我记得它使用修改后的 PDFBox(没有与编辑相关的东西),并具有我自己的字体转换器(将 fonts 提供给 Android 并更快地渲染它们)。

I don't develop PDF reader anymore and I can make all my changes opensource (though it will require some work, and time).我不再开发 PDF 阅读器,我可以将所有更改开源(尽管这需要一些工作和时间)。 You can try it out to find out how well it performs for you.你可以试一试,看看它对你的表现如何。 Note: reader doesn't support encryption and copy-protection.注意:阅读器不支持加密和复制保护。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM