Search code examples
iospdfcordovahybrid-mobile-app

Pdf / Docx preview in a Phonegap app on iOS


I need to open Pdf / Docx documents for preview from a Phonegap app.

On Android it's possible to open files in extenal apps using WebIntent plugin.

Now what about iOS? It seems possible to do this entirely with the build-in browser (which surprisingly does render docx) by creating a html page with a header and a back button in the top and an iframe taking up the rest of the screen.

It would be great if the user could zoom and drag the document while the header would remain stationary, but I couldn't get to zoom working at all inside the iframe.

Any suggestions?


Solution

  • I ended up using InAppBrowser Plugin with enableViewportScale=yes. It displays a toolbar with a back button with custom caption. It would be better if I can add my own toolbar, so the navigation is consistent in the whole app, but this is good enough.