user562237
user562237

Reputation: 785

can we render pdf on web view in android

can we render pdf and show it on web view in android. kindly help me out

Upvotes: 2

Views: 10676

Answers (3)

Riccardo Cipolleschi
Riccardo Cipolleschi

Reputation: 235

Unluckily, Google has changed the api... When you try to load the docs.google.com/gview url, the web view is redirect to the new drive.google.com/viewerng that can't render the pdf in the Android WebView...

Any other clever solution? :D

Upvotes: 0

Chetan Urmaliya
Chetan Urmaliya

Reputation: 66

You cant open PDF file directly in android web browser but using Google Docs Viewer. you can open it in android Browser like:

String webUrl="http://myweb.com/demo.pdf";
mWebView.loadUrl("https://docs.google.com/gview?embedded=true&url="+ webUrl);

Upvotes: 2

Paresh Mayani
Paresh Mayani

Reputation: 128458

Yes you can load PDF in Webview using Google's gview, It is a trick.

Here you can have my solution for the same trick: Android - Load PDF / PDF Viewer.

Upvotes: 5

Related Questions