我知道这个问题已被问过几次,但我找不到一个令人满意的答案。我的要求很简单。只需在我的app(android)中打开pdf文档。但是我无法找到一个简单的方法来做到这一点。它的本地c / c ++方式或编写自己的引擎。但是没有任何简单的API,所以我可以像jar一样包含它并查看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);
-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
you can use native plugin to show the PDF within your app. try this apv
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.