can we render pdf on web view in android
can we render pdf and show it on web view in androi开发者_开发问答d. kindly help me out
Yes you can load PDF in Webview using Google's gview, It is a trick.
Here you can have my solution for the same trick: Android - Load PDF / PDF Viewer.
You cant open PDF file directly in android web browser but using Google Docs Viewer. you can open it in android Browser like:
String webUrl="http://myweb.com/demo.pdf";
mWebView.loadUrl("https://docs.google.com/gview?embedded=true&url="+ webUrl);
Unluckily, Google has changed the api... When you try to load the docs.google.com/gview url, the web view is redirect to the new drive.google.com/viewerng that can't render the pdf in the Android WebView...
Any other clever solution? :D
精彩评论