WebView webview = (WebView) findViewById(R.id.webview);
webview.getSettings().setJavaScriptEnabled(true);
String pdf="http://www.ashwinikidneycentre.com/asset/Kidney-Book-In`English.pdf";
webview.loadUrl("http://drive.google.com/viewerng/viewer?embedded=true&url=" + pdf);
Asked
Active
Viewed 143 times
-1

Yasin Patel
- 5,624
- 8
- 31
- 53

RKP
- 1
- 2
-
1Try this link http://weimenglee.blogspot.in/2013/05/android-tip-displaying-pdf-document.html – Ankita Mar 30 '18 at 05:39
-
You can go through with this link also https://stackoverflow.com/questions/2655972/how-can-i-display-a-pdf-document-into-a-webview – Ankita Mar 30 '18 at 05:42
-
Possible duplicate of [Webview loadRequest not working](https://stackoverflow.com/questions/14491062/webview-loadrequest-not-working) – Ishvar Kikani Mar 30 '18 at 05:57
-
That is because your url is not existing. Have you tried to open `http://www.ashwinikidneycentre.com/asset/Kidney-Book-In`English.pdf` in the browser? – Vladyslav Matviienko Mar 30 '18 at 06:42
1 Answers
3
There is an issue in the line:
String pdf="http://www.ashwinikidneycentre.com/asset/Kidney-Book-In`English.pdf";
The proper url is www.ashwinikidneycentre.com/asset/Kidney-Book-In-English.pdf
Try:
String pdf="www.ashwinikidneycentre.com/asset/Kidney-Book-In-English.pdf"

Owen Campbell
- 622
- 1
- 5
- 10
-
I tried String pdf="www.ashwinikidneycentre.com/asset/Kidney-Book-In-English.pdf" also not working. while i am appending to google drive it asking for login and through google doc it is showing no preview available – RKP Mar 30 '18 at 08:39