PDFs

Your app will automatically handle PDFs, but they are handled differently depending on the situation. Here's how they work.

Remote files: any remote PDF (hosted on the web) will be viewed in the web browser
Local files: any PDF in the assets folder, or downloaded to your app will use a local PDF viewer outside the app.

PDFs will be available for download outside of your app, it is not possible to restrict PDFs to be viewed only in your app.

Requirements

To view local PDF files on Android, your app users must have a PDF app installed. It can be any app that handles PDFs, for example Acrobat Reader.

iOS handles PDFs natively and does not have any requirements.

Display a PDF in a Custom Page

// remote file
<button ion-button (click)="mediaModal('https://mysite.com/path-to-file.pdf')">View PDF</button>

// local file (must be included in offline assets folder)
<button ion-button (click)="mediaModal('assets/path-to-file.pdf')">View PDF</button>

Display Downloaded PDFs

Any PDFs downloaded to the app from WordPress or using the media list with downloads enabled, will automatically open a PDF viewer outside the app. This works while offline.

Custom Links to PDFs in WordPress

If you have a link to a PDF in a WordPress page, it will work fine in iOS.

Android does not have a native PDF viewer, so you may need to change your link to use an online PDF viewer like this:

<a href="https://docs.google.com/viewer?url=http://research.google.com/archive/bigtable-osdi06.pdf" target="_blank">View PDF</a>