📜  pdf 查看器 ionic 4 - TypeScript 代码示例

📅  最后修改于: 2022-03-11 14:48:16.244000             🧑  作者: Mango

代码示例1
ionic cordova plugin add cordova-plugin-document-viewer
npm install @ionic-native/document-viewer

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)