Reputation: 785
can we render pdf and show it on web view in android. kindly help me out
Upvotes: 2
Views: 10676
Reputation: 235
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
Upvotes: 0
Reputation: 66
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);
Upvotes: 2
Reputation: 128458
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.
Upvotes: 5