How do I open a PDF file in my web view wihtout downloading and saving it to the SD card? I have done some R&D on this but until now I haven't got any appropriate answers. Can anyone tell me how to use googledoc to open the PDF file in the web view?
Asked
Active
Viewed 3,724 times
2 Answers
6
http://docs.google.com/viewer?embedded=true&url=link_to_pdf
will format your PDFs for you to open within the webview, using Google Docs Viewer.
WebView mWebView = new WebView(this);
mWebview.getSettings().setJavaScriptEnabled(true);
String url = "http://docs.google.com/viewer?embedded=true&url="+"http://sitename.com/xyz.pdf";
mWebview.loadUrl(url);

Anirudh Ramanathan
- 46,179
- 22
- 132
- 191
-
Thank you so much! – Leenah Apr 19 '18 at 04:09