There are a million similar questions / answers that address how to open a remote PDF file using Google Docs + webview.
There is no address how to open a local file .
Given these lines:
String remotePath = "https://myserver.com/data/files/organization/4/pdf/kalinka1369-1374847709-55.pdf";
String localPath = "file:///storage/emulated/0/Droid Noid/com.story.chapters/kalinka1369-1374847709-55.pdf";
String googleDocsURL = "https://docs.google.com/gview?embedded=true&url=";
It works:
webview.loadUrl(googleDocsURL + remotePath);
If this is not the case:
webview.loadUrl(googleDocsURL + localPath);
I understand that localPaththere is a space in it, and I tried to code it to no avail:
String encodedLocalPath = "file:///storage/emulated/0/Droid+Noid/com.story.chapters/kalinka1369-1374847709-55.pdf";
Can I open a local PDF file using Google Docs + webview? If so, how?
source
share