【发布时间】:2018-12-18 13:22:49
【问题描述】:
您好,我使用以下代码不起作用如何解决它..
fileTransfer.download(url, path + 'abcd.pdf').then((entry) => {
let localUrl = entry.toURL();
const toast = this.toast.create({
message: 'Download Complted',
duration: 20000,
position: 'top',
closeButtonText: 'OK',
showCloseButton: true,
});
toast.present();
this.document.viewDocument(localUrl, 'application/pdf', {});
}, (error) => {
// handle error
console.log("In error");
console.log(error);
alert(JSON.stringify(error));
});
它是如何工作的!!
【问题讨论】:
-
您面临什么样的问题?请添加一些与您在使用上述代码时遇到的问题相关的详细信息。
-
问题就像文件已下载但无法在 documentViewer 中打开。我的意思是 this.document.viewDocument(localUrl, 'application/pdf', {});这--> 行不工作
标签: ionic-framework ionic3 documentviewer