0

I'm using web-view in an android application. In that application I have to view attached PDF and images. When I click image file it's opening fine, but when I click PDFs it's not opening.

Luke Peterson
  • 8,584
  • 8
  • 45
  • 46
  • Webview view html pages. Not pdfs. If you want to view a pdf, you need to have an app on the phone that does that. Its not built in functionality. – Gabe Sechan Apr 02 '15 at 09:35
  • For pdf files, you'll have to create your own custom pdf reader or you can use other apps for it. – Anshul Tyagi Apr 02 '15 at 09:43

1 Answers1

0

As said you need to use a native pdf renderer like RadaeePDF SDK for example, or you can try (https://mozilla.github.io/pdf.js/) inside the webview.

Rendering using JS should work well on the webview of the versions 4.4 and 5.x, For earlier versions you can check Show PDF file in Android WebView using mozilla pdf.js Android API Level below 19

Community
  • 1
  • 1
Nermeen
  • 15,883
  • 5
  • 59
  • 72