2

can we render pdf and show it on web view in android. kindly help me out

user562237
  • 775
  • 5
  • 15
  • 24
  • WebView in Android cannot show PDFs. You should use any third party PDF reader like DroidReader or modify open source one. – Mudassir Apr 28 '11 at 07:45

3 Answers3

5

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.

Community
  • 1
  • 1
Paresh Mayani
  • 127,700
  • 71
  • 241
  • 295
2

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);
0

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