user3217668
user3217668

Reputation: 81

Opening PDF files on android webview without using GoogleDocViewer

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.

Upvotes: 8

Views: 496

Answers (2)

ʍѳђઽ૯ท
ʍѳђઽ૯ท

Reputation: 16980

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)

Upvotes: 1

Ludwig S
Ludwig S

Reputation: 551

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.

Upvotes: 3

Related Questions