naresh
naresh

Reputation: 10392

android - Pdf link problem

My application has one button. If you click that button then it will display the web pages based on the web service response using webview.

It works properly for general links. But for links that have .pdf, a white screen gets displayed.

Is it possible to display the .pdf file using web view?

Would appreciate any help.

i used the following code

WebSettings webSettings = mWebView.getSettings();   
webSettings.setJavaScriptEnabled(true);

mWebView.loadUrl("http://docs.google.com/gview?embedded=true&url="
                +"http://www.kim-lai.com/images/Menu_100309.pdf");

Upvotes: 0

Views: 4233

Answers (2)

Moog
Moog

Reputation: 10193

It sounds like it could be trying to but there is no direct pdf rendering support in webview. Please look at the following question

android webview pdf

You may find the following question useful also

how to open a pdf file inside a webview for android?

EDIT

Android - Load PDF / PDF Viewer

Please also make sure you ask appropriate questions, prefrerably with code so that others can reproduce your problem and offer a solution. Do your own research!!! Stack overflow is not a magic site that does your work for you!!!

ADENDUM

You require internet permissions. Add this to your manifest.xml

SUPPLEMENTAL

I tried typing in the url into the browser and it tells me "Sorry, we are unable to retrieve the document for viewing or you don't have permission to view the document. "

Upvotes: 1

Nikola Despotoski
Nikola Despotoski

Reputation: 50538

mWebView.loadUrl("http://www.kimlai.com/images/Menu_100309.pdf"); 

Try like this, what do you see?

Upvotes: 0

Related Questions