简体   繁体   中英

How to load PDF in webView from URL?

I am creating and Android app that fetches file url from Parse server and displays the PDF in webView with the help of Google preview, directly loading the PDF into the webView takes forever to load.

But the problem here is Google has a limit of 25mb ie files larger than 25mb cannot be previewed and it gives a message "Whoops file size too large"

With Google previewer this is how the url looks:

https://docs.google.com/viewer?url=http://my.domain.com/yourPdfUrlHere.pdf

Is there any way to load PDF from URL and also displaying what has already loaded so that the users don't have to wait forever?

Thanks in advance..

webView.loadUrl("http://docs.google.com/gview?embedded=true&url=" + url);

This will concatenate your URL with Google Docs PDF Viewer and load it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM