Phonegap Cordova the best way to display PDF document

I have a site with ~ 100k pdf documents and I would like to create an Android app for Android. I am looking for the best way to display PDF documents in an application.

What's the best way ... or something that allows me to do this? The focus is on the best UX as I can. It should be fast and easy to use.

I've already tested PDF.js, but maybe there is another, better way to do it.

+3


source to share


2 answers


I would suggest using In-Browser App Browser .

You can install it by running:

cordova plugin add org.apache.cordova.inappbrowser

      

in your CLI (if you are using Cordova 3.x).
Previously, such versions (2.8.0, 2.9.0, etc.) had to be pre-installed.



Open open PDF documents in a new window:

window.open('http://your-url.com/yourPDF.pdf', '_blank');

      

You might be able to use the option '_system

instead '_blank'

, but I'm not sure about the results, it might open the system PDF viewer.

+3


source


Disclaimer: I am a developer at PSPDFKit

You can look at https://github.com/PSPDFKit/Cordova-iOS and https://github.com/PSPDFKit/Cordova-Android . Both plugins wrap PSPDFKit and make viewing PDF documents as easy as



function showMyDocument() {
    PSPDFKit.showDocument('file://.../document.pdf');
}

      

+1


source







All Articles