Android : 有没有免费的 Android PDF 库

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3530780/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 10:38:18  来源:igfitidea点击:

Android : Is there any free PDF library for Android

androidpdfmupdf

提问by Nezir

I need a PDF library for manipulating a PDF documents, (creating PDF, image convertinng to PDF) and things like that but in Android.

我需要一个 PDF 库来操作 PDF 文档,(创建 PDF,图像转换为 PDF)以及类似的东西,但在 Android 中。

I tried the android itext port but the library project generates compile errors after I added it to my Project. Looks like it is still using some affinetransformation classes that are defined in AWT.

我尝试了 android itext 端口,但是在我将它添加到我的项目后,库项目生成了编译错误。看起来还是在使用AWT中定义的一些仿射变换类。

采纳答案by softarn

It seems that no one of the pure java pdf libraries will work with android because they use libraries that aren't supported by android. I think I read that iText is interested in doing a port to android but thinks that google should support them if they did, haven't got a source on that though.

似乎没有一个纯 Java pdf 库可以与 android 一起使用,因为它们使用了 android 不支持的库。我想我读到 iText 有兴趣对 android 进行移植,但认为 google 应该支持他们,如果他们这样做了,虽然还没有消息来源。

Here is a project in work for writing pdfs in android: sourceforge.net/projects/apwlibraryHaven't tried it and it says that it only does simple pdfs

这是一个在 android 中编写 pdf 的项目:sourceforge.net/projects/apwlibrary还没试过,它说它只做简单的 pdf

回答by Kurt Pfeifle

Have a look at MuPDF.

看看MuPDF

MuPDF uses a very small footprint and has nearly-complete support for all features of PDF-1.7. It is the base for the quite popular (Windows) SumatraPDF viewer, but it has been ported to Android and iOS too.

MuPDF 占用空间非常小,几乎完全支持 PDF-1.7 的所有功能。它是非常流行的 (Windows) SumatraPDF 查看器的基础,但它也已移植到 Android 和 iOS。

Then also have a look at all the questionsthat have been asked on this website concerning MuPDF.

然后还可以查看本网站上有关 MuPDF 的所有问题

回答by Danny D'Amours

IText seems to work fine.

IText 似乎工作正常。

To fix the affineTransform compilation issue you simply need to mark the "Micro PJAWT.jar" in iText for export in Eclipse so that your dependent project can use it for compilation purposes.

要修复 affineTransform 编译问题,您只需在 iText 中标记“Micro PJAWT.jar”以便在 Eclipse 中导出,以便您的依赖项目可以将其用于编译目的。