2

I need open an PDF file that is in an url. I need open it with an PDF Viewer...

It is possible?

Thanks for all.

Best regards.

Alberto Juarez
  • 444
  • 8
  • 23
  • Were you able to find any library or any workaround for opening PDF with Phonegap in Android? I am also stuck there. – karthick Mar 18 '13 at 10:35

2 Answers2

6

I suggest using the ChildBrowser plugin and using Google's viewer to actualy open the PDF (since Android doesn't have a default PDF viewer).

So you can open a PDF like this:

onclick='window.plugins.childBrowser.showWebPage(encodeURI("http://docs.google.com/viewer?url=' + pdfLink + '"));
Ian Devlin
  • 18,534
  • 6
  • 55
  • 73
  • 1
    Can we alter this method to work with a PDF stored on the device? – Ming K Dec 11 '12 at 17:06
  • As of version 2.3 no need for installing plugin http://docs.phonegap.com/en/2.3.0/cordova_inappbrowser_inappbrowser.md.html#InAppBrowser – gmh04 Mar 21 '13 at 09:13
  • InAppBrowser doesn't work for PDF's on Android. works well on IOS though. – 29er May 01 '13 at 16:35
1

in android (i don't know phonegap) there are many pdf viewer libraries.

like Android-Pdf-Viewer-Library

or Droid Text

or MuPDF

or APV Pdf Viewer

if you develope your application commercial and don't want to pay any money

use first one.

Barış Çırıka
  • 1,570
  • 1
  • 15
  • 24