网易云

Ionic实战视频教程(跨平台): https://www.itying.com/goods-1067.html

Flutter实战视频教程(跨平台): https://www.itying.com/goods-1176.html

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

联系我们?

If you're building a serious project, you can't afford to spend hours troubleshooting. Ionic's experts offer official maintenance, support, and integration help.

Contact Us Today!

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

ionic cordova plugin add cordova-plugin-document-viewer npm 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=YOURPRODUCTKEY npm install @ionic-enterprise/document-viewer

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

  • Android
  • iOS
  • Windows

Ionic 文档查看器Document Viewer插件的用法(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)