pdf viewer in phonegap Android

14,363

Solution 1

you can use pdf.js :

pdf.js is an HTML5 technology experiment that explores building a faithful and efficient Portable Document Format (PDF) renderer without native code assistance.

https://github.com/mozilla/pdf.js

Solution 2

I answered a similar question already (see Open PDF with PhoneGap in Android) but will do the same here. Use the ChildBrowser plugin as suggested in conjunction with Google Docs like so:

onclick='window.plugins.childBrowser.showWebPage(encodeURI("http://docs.google.com/viewer?url=' + pdfLink + '"));

This works fine for me and I have tested it in Android 2.1 up to 4.1.

Share:
14,363
Leon van der Veen
Author by

Leon van der Veen

Updated on July 20, 2022

Comments

  • Leon van der Veen
    Leon van der Veen almost 2 years

    I'm looking for a pdf viewer for Android using Phonegap 2.0. I tried the childbrowser plugin which worked on iOS but not on Android. I tried this http://www.giovesoft.com/2011/08/download-and-open-pdf-with-phonegap.html but that didn't work either, I get error messages like PhoneGap is not defined at file and cannot call method "showPdf" of undefined.

  • Leon van der Veen
    Leon van der Veen over 11 years
    Thanks, I already used this plugin but on some PDF files the rendering is not optimal.
  • akohout
    akohout over 10 years
    I also tried out pdf.js, but may impression is that it is too slow for production use on mobiles. It has to repaint for every page and zoom factor.