Is it possible to open pdf file storage in sdcard / cache in webview?
I am uploading a PDF file to my application and I want to allow the user to view it. Is it possible that with webview I can display this pdf file downloaded to SD card or local memory. As I know, there is a workaround where I can provide a pdf file link to google url that will open the pdf in webview. But it lags behind and is very slow.
source to share
Try using pdf.js. See http://www.worldwidewhat.net/2011/08/render-pdf-files-with-html5/
I downloaded its source and put it in sdcard.
Then I use WebView
to download it index.htm
.
It was showing pdf in webView in sdcard on android 4.0 device but sometimes it shows white page. I need to reload it and it can finally show.
Unfortunately I also tested on Android 2.2 and 2.3 devices. They just show a white page, nothing. I know it uses html5 canvas technology. I checked when loading http://html5test.com/ on WebView
and has a check mark on the canvas element but still can't show the pdf. Strange behavior. Perhaps it really depends on the Android version.
source to share