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.

https://github.com/sitewaerts/cordova-plugin-document-viewer

Ionic 文档查看器Document Viewer插件的安装(Installation)

ionic cordova plugin add cordova-plugin-document-viewer npm install @ionic-native/document-viewer

Ionic 文档查看器Document Viewer插件支持的平台(Supported Platforms)

  • Android
  • iOS
  • Windows

Ionic 文档查看器Document Viewer插件的用法(Usage)

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


constructor(private document: DocumentViewer) { }

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

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