pdf viewer in phonegap Android
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.
Leon van der Veen
Updated on July 20, 2022Comments
-
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.
-
BBdev over 11 yearslook at this link stackoverflow.com/questions/6979344/…
-
Leon van der Veen over 11 yearsThanks but I think its not very useful because they only have a solution for IOS
-
BBdev over 11 yearshave you checked this blog giovesoft.com/2011/08/download-and-open-pdf-with-phonegap.html
-
Leon van der Veen over 11 yearsYes like I said in my topic ;)
-
BBdev over 11 yearsoops didnt look at your link sorry ..... ;-)
-
Simon MacDonald over 11 yearsThe reason it doesn't work for you is that the plugin needs to be updated to Cordova. simonmacdonald.blogspot.com/2012/04/…
-
-
Leon van der Veen over 11 yearsThanks, I already used this plugin but on some PDF files the rendering is not optimal.
-
akohout over 10 yearsI 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.