0

I would like to open a PDF file that located in the server (Here)

in a specific place in my application.

I saw a couple of example how to do it with a webview, but no one works for me.

This is part of my code that should preview the pdf inside a WebView :

     WebView webView = (WebView) findViewById(R.id.webView1);
     webView.getSettings().setSaveFormData(true);
     webView.getSettings().setJavaScriptEnabled(true); 
     webView.loadUrl("http://mes.mes-ltd.com/itay.pdf");

The solution is just a Blank webview.

Thanks for help!

user2235615
  • 1,513
  • 3
  • 17
  • 37

1 Answers1

0

You can't open a PDF directly in the WebView, it just doesn't support this. You'll need to do something like the solution outlined here.

Community
  • 1
  • 1
marcin.kosiba
  • 3,221
  • 14
  • 19
  • I did this, But if i want to show the pdf file not in a new intent? and only in a part of the screen. what should i do? – user2235615 May 28 '14 at 08:24
  • @user2235615 - you'd probably need to embed some sort of pdf viewer in your app then. See https://code.google.com/p/apv/ for example. – marcin.kosiba May 28 '14 at 08:44