PDFTron offers two options for displaying PDF and Office documents in Ionic and Cordova apps. Both offer offline functionality and the ability to view and annotate PDF documents.
This guide explains the options and their relative strengths.
The native plugin supports displaying the document viewer/annotator full screen, or over an area specified by a
The relative strengths of using a native plugin over the WebViewer option (discussed below) are:
- Performance: true native performance for scrolling, zooming and animations.
- Appearance: native controls that appear and behave in accordance with platform norms and possibly user expectations.
- Rendering speed: good rendering speed on all devices, including older models with limited memory.
- PDF streaming: The native plugin supports streaming, where a remote PDF is viewable before it has been downloaded in its entirety, and can even be configured to only download the pages of a PDF that are actually viewed by the user, saving on mobile data usage.
The relative strengths of using WebViewer inside your Ionic/Cordova app are:
- Identical API: The API used for a website written using WebViewer will be 100% identical that used in the Ionic/Cordova app.
- Identical UI: The UI is the same across all devices (rather than adopting the platform's UI norms).
- .xod files The WebViewer can open and render .xod files, which are PDF files that have been optimized for web-viewing (PDF files can also be rendered directly, but with degradation in performance).