There are a million similar questions/answers, all addressing how to open a remote PDF file using Google Docs + webview.
None address how to open a local PDF file.
Given these strings:
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=";
This works:
webview.loadUrl(googleDocsURL + remotePath);
Whereas this does not:
webview.loadUrl(googleDocsURL + localPath);
I realize there is a space in localPath
and I have tried encoding it to no avail:
String encodedLocalPath = "file:///storage/emulated/0/Droid+Noid/com.story.chapters/kalinka1369-1374847709-55.pdf";
Is it possible to open a local PDF file using Google Docs + webview? If so, how?