Android - Download PDF / PDF Viewer

I want to display pdf content in webview.

Here is my code:

WebView webview = new WebView(this); setContentView(webview); webview.getSettings().setJavaScriptEnabled(true); webview.loadUrl("URL/Demo_PDF.pdf"); 

Problem:

When I try to start the application, at this time I get a blank screen.

And also, if there is any PDF viewer, then also suggest me !!

FYI, I have already set the Internet permission.

+24
android pdf
Dec 17 2018-10-17T00:
source share
6 answers

Finally, I got a solution, in fact I did the trick to upload a pdf file using Google Docs in a webview:

 webview.loadUrl("http://docs.google.com/gview?embedded=true&url=http://myurl.com/demo.pdf"); 
+49
Dec 24 '10 at 10:27
source share

Sorry, but WebView does not display PDF content.
What you may wish for is a PDF viewer that responds to the MIME PDF format.

Here are some free open source libraries you can check out:

+10
Dec 17 '10 at 7:52
source share

Vudroid is an open source project for the doc of the pfd / djvu document.

+1
Dec 17 '10 at 8:59
source share

You can try using mupdf (www.mupdf.com). You can create your own code library (libmupdf.so), which will be loaded into your Android project using ndk. This will provide much faster rendering of PDF files ... check the project at: http://mupdf.com/repos/mupdf/android/

+1
Jan 21 '11 at 11:19
source share

WebView does not have a PDF plugin. You must store the PDF locally and open an intent to view such content.

0
Dec 17 '10 at 13:25
source share

Qoppa offers a commercial toolkit for Android developers, this may be what you are looking for http://www.qoppa.com/android/pdfsdk/ .

0
Aug 23 '12 at 3:25
source share



All Articles