Displaying PDFs in EnyoJS Apps deployed with Cordova

What's the most elegant way to display remote PDFs in a Cordova deployed app without storing them on the device: make them scrollable, navigateable, searchable etc.?


Assume I get the PDF downloaded from a remote server through a Cordova plugin that handles server authentication. The PDF data is then available in a JS byte array in memory. I tried involving PDF.js and feeding it with that byte array, displaying the PDF.js output on a Panels kind having one Canvas each PDF page. But on my target test devices (Galaxy S2, Galaxy S3) that performs worse than a slide show when having loaded a simple 1MB PDF with 27 pages.


Any suggestions?

Comments

  • On iOS, the native webview also handles showing PDFs, but I don't think that's available with other mobile platforms. I'd look at native Cordova plugins or some sort of server-side PDF-to-tilemap rendering strategy.
  • I am about to ship an iOS application that do that. I decided against using the native webview because of the way it handle pages. I wanted something like a flipbook. In the end I developed my own cordova plugin to call a non-free library and thats why I can't distribute it. The library I purchased is:

    http://yakamozlabs.com/products/pdftouch

    Creating the plugin was quite easy. Another option is to use a childBrowser instance to load Mozilla PDF.js, if your PDF is not too heavy it works well, and it is also cross platform but I see you tried it already.

    I could not find a PDF viewer library for Android. If you find one, then please post it back here.
Sign In or Register to comment.