Android版PDF阅读器库阅读器、Android、PDF

2023-09-05 00:05:05 作者:相爱的激情

我知道这个问题已经被问了几次,但我不能找到一个满足answer.My要求simple.just内我的应用程序(机器人)打开PDF文档。但我无法找到这样做的一个简单的方法this.either其原生的C / C ++的方式或写你自己的engine.But心不是有什么简单的API,这样我可以包括它像一个瓶子和查看PDF文件?

I know this question has been asked several times but I couldnt find one satisfying answer.My requirement is simple.just to open the pdf docs within my app(android).But I am not able to find a simple way of doing this.either its native c/c++ way or writing your own engine.But isnt there any simple API so that I can include it like a jar and view the pdf?

推荐答案

没有。有一个在Android SDK中没有API来显示本机PDF。 解决方案我可以建议:

No. There is no API in the Android SDK to natively display PDF. Solutions I can suggest:

- 使用外部应用程序:

-Use an external application:

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(path, "application/pdf");
startActivity(intent);

- 如果您的PDF文档在线访问,使用谷歌文档查看器,以在打开PDF 的WebView

-If your PDF document is accessible online, use the Google Docs Viewer to open your PDF in a WebView:

http://docs.google.com/viewer?url=http://mypdf.pdf