Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
IONIC:pdf未在IOS中打开和下载_Pdf_Ionic Framework_Pdfmake - Fatal编程技术网

IONIC:pdf未在IOS中打开和下载

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

我在爱奥尼亚4中创建pdf。以下代码适用于web和android,但不适用于IOS。在IOS中,它发出警报(“创建文件时出错:“+err”)


请参阅下面的消息。有一个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';
      }