IONIC:pdf未在IOS中打开和下载
我在爱奥尼亚4中创建pdf。以下代码适用于web和android,但不适用于IOS。在IOS中,它发出警报(“创建文件时出错:“+err”)IONIC:pdf未在IOS中打开和下载,pdf,ionic-framework,pdfmake,Pdf,Ionic Framework,Pdfmake,我在爱奥尼亚4中创建pdf。以下代码适用于web和android,但不适用于IOS。在IOS中,它发出警报(“创建文件时出错:“+err”) 请参阅下面的消息。有一个bug阻止了在iOS上进行统一的本地文件下载体验 两种选择: 1.将pdf上载到服务器并重新下载。 2.等待13 .catch(err => { this.runloading = 'hide'; alert("Error creating file: " + er
请参阅下面的消息。有一个bug阻止了在iOS上进行统一的本地文件下载体验 两种选择: 1.将pdf上载到服务器并重新下载。 2.等待13
.catch(err => {
this.runloading = 'hide';
alert("Error creating file: " + err);
throw err;
});
if (this.platform.is("cordova")) {
this.pdfObj.getBuffer(buffer => {
var blob = new Blob([buffer], { type: "application/pdf" });
this.file
.writeFile(this.file.externalRootDirectory, "pro.pdf", blob, {
replace: true
})
.then(fileEntry => {
this.fileOpener
.open(
this.file.externalRootDirectory + "pro.pdf",
"application/pdf"
)
.catch(err => alert("Please install pdf viewer"));
this.runloading = 'hide';
})
.catch(err => {
this.runloading = 'hide';
alert("Error creating file: " + err);
throw err;
});
});
} else {
pdfmake.createPdf(docDefinition).open();
// this.pdfObj.download();
this.runloading = 'hide';
}