Document Viewer

Contents

This plugin offers a slim API to view PDF files which are either stored in the apps assets folder (/www/*) or in any other file system directory available via the cordova file plugin.

Installation

ionic cordova plugin add cordova-plugin-document-viewernpm install @ionic-native/document-viewer
Ionic EE comes with fully supported and maintained plugins from the Ionic Team. Learn More or Contact Us
ionic enterprise register --key=YOURPRODUCTKEYnpm install @ionic-enterprise/document-viewer

Supported Platforms

  • Android
  • iOS
  • Windows

Usage

import { DocumentViewer } from '@ionic-native/document-viewer/ngx';


constructor(private document: DocumentViewer) { }

...
const options: DocumentViewerOptions = {
  title: 'My PDF'
}

this.document.viewDocument('assets/myFile.pdf', 'application/pdf', options)