9
我试图与ionic/cordova plugin here一起使用。DocumentViewer未与Ionic 3配合使用
所以我把这个代码在我的网页:
showDocument() {
var options: DocumentViewerOptions = {
title: 'A book',
documentView: { closeLabel: '' },
navigationView: { closeLabel: '' },
email: { enabled: true },
print: { enabled: true },
openWith: { enabled: true },
bookmarks: { enabled: true },
search: { enabled: false },
autoClose: { onPause: false }
}
this.docViewer.viewDocument('assets/arabic.pdf', 'application/pdf', options);
}
和一个简单的按钮来启动它的HTML页面:
<ion-content>
<button ion-button round (click)="showDocument()">
Read
</button>
</ion-content>
但我不能看到任何模拟器(因为它无法在浏览器上运行它)
离子信息有:
UPDATE:
这是我与我的设备和铬devtools调试时:
更新2:
我曾尝试以绝对路径工作,但我有空值,我hav E制备这些变化:
import { File } from '@ionic-native/file';
declare let cordova: any;
//staff
pdfSrc: string = cordova.file.applicationDirectory + 'assets/arabic.pdf';
//staff
console.log(this.pdfSrc);
this.document.viewDocument(this.pdfSrc, 'application/pdf', options)
但是看看我有:
控制台中的任何错误使用[远程调试](https://developers.google.com/web/tools/chrome-devtools/remote-debugging/)? –
其实我对远程调试没有太多的想法。我将看到如何使用它 –
@HoussemBdr是您的点击触发器? – Webruster