Morgen
Morgen

Reputation: 71

Android : How to Load PDF?

Is there any way to load PDF file from Asset/URL in Browser or WebView or any other way?

Upvotes: 4

Views: 4337

Answers (2)

anticafe
anticafe

Reputation: 6892

Instead loading PDF file from local resource, you can think about open it online using Google Docs Viewer:

WebView webview = (WebView) findViewById(R.id.webview);
webview.getSettings().setJavaScriptEnabled(true); 
String pdf = "http://www.adobe.com/devnet/acrobat/pdfs/pdf_open_parameters.pdf";
webview.loadUrl("http://docs.google.com/gview?embedded=true&url=" + pdf);

Upvotes: 1

zfedoran
zfedoran

Reputation: 3046

There is no native way to do this at the moment. However, you could write your own pdf viewer activity. Also, check out RepliGo Reader and PDF GView.

Upvotes: 1

Related Questions