8

How to show pdf on Android webview from url without using GoogleDocViewer?

PDF url needs authentication, and url is working fine on browser but when i'm trying to open the same url in android webview, it is showing blank screen.

1
  • I just cleared the question on edit for those guys who wanted to do this in future. Commented Jan 14, 2016 at 9:40

2 Answers 2

3

You can use mozilla's pdf.js.

Sample project on how you do it in Android. Sample project made by user Butelo.

As user LinX64 pointed out, this is only usable on android.os.Build.VERSION_CODES.JELLY_BEAN and above.

Sign up to request clarification or add additional context in comments.

Comments

1

You should use third-party libraries for these stuffs i guess, by the way, the native android browser doesn't support this pdf format.

For example, for completing above users answer, this is only available on + android.os.Build.VERSION_CODES.JELLY_BEAN

Check this too:

//The default value is true for API level android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1 and below, //and false for API level android.os.Build.VERSION_CODES.JELLY_BEAN and above.

if(android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN) 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.