简体   繁体   English

如何从资产文件夹android在webview中显示PDF

[英]How to display PDF in webview from assets folder android

I surfed a lot for this solution but everywhere I got same solution ie either use Intent and pass it to default/installed PdfReader applications, Other one is to use gview from googleDocs to load Pdfs online. 我为该解决方案冲浪了很多,但是到处都有相同的解决方案,即要么使用Intent并将其传递给默认/已安装的PdfReader应用程序,另一种方法就是使用googleDocs中的gview在线加载Pdfs。

But my question is how can view my pdf offline in webview ie if user click on list of pdf in my application don't go to other application or google/gview . 但是我的问题是如何在webview中离线查看我的pdf,即如果用户单击我的应用程序中的pdf列表而不转到其他应用程序或google / gview。

I tried passing assets folder path but not working getting message in webview that "webpage is temporarily down or move permanently." 我尝试传递资产文件夹路径,但无法在Webview中获取“网页暂时关闭或永久移动”的消息。

I also tried this link.. which describes to use pdfViewver.jar but that lib. 我也尝试了此链接..该链接描述了使用pdfViewver.jar但该库。 has it's own issues that needs to be fixed. 有自己需要解决的问题。

any help will highly appreciated 任何帮助将不胜感激

But my question is how can view my pdf offline in webview 但是我的问题是如何在webview中离线查看我的pdf

You can't. 你不能 WebView cannot display PDFs on its own. WebView无法WebView显示PDF。

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

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