下载pdf vue

时间:2017-11-11 10:25:55

标签: vue.js

当我在PostMan上调用此功能时,它会下载pdf,但是当我从页面调用时它不会下载但请求到达。我想要它下载

,generateFarmerPDF:function (id) {
            this.farmerId = id
          var data = new FormData()
          data.append('function','generateFarmerPDF')
            data.append('farmerId',this.farmerId )
          axios.post(this.url,data)
              .then( function (response ) {
          }.bind(this)).catch(function (error) {

          })

        }

这是api代码

if ($function == "generateFarmerPDF") {
    $farmerId = $_POST['farmerId'];

    $result = DB::instance()->executeSQL("SELECT * FROM `milk_production`  WHERE `farmerId` ='$farmerId'");
    $header = DB::instance()->executeSQL("SELECT `COLUMN_NAME` 
FROM `INFORMATION_SCHEMA`.`COLUMNS` 
WHERE `TABLE_SCHEMA`='blog_samples' 
AND `TABLE_NAME`='milk_production'");


    $pdf = new FPDF();
    $pdf->AddPage();
    $pdf->SetFont('Arial', 'B', 5);
    foreach ($header as $heading) {
        foreach ($heading as $column_heading)
            $pdf->Cell(20, 6, $column_heading, 1);
    }
    foreach ($result as $row) {
        $pdf->SetFont('Arial', '', 5);
        $pdf->Ln();
        foreach ($row as $column)
            $pdf->Cell(20, 6, $column, 1);
    }
    $pdf->Output();
}

这就是我所说的

<button v-on:click="generateFarmerPDF(milkvolume.farmerId)">Report</button></td>

2 个答案:

答案 0 :(得分:1)

例如,您可以使用它:

axios('/urltopdfgeneration', {
    method: 'GET',
    responseType: 'blob'
})
.then(response => {
    //Create a Blob from the PDF Stream
    const file = new Blob(
    [response.data], 
    {type: 'application/pdf'});
    //Build a URL from the file
    const fileURL = URL.createObjectURL(file);
    //Open the URL on new Window
    window.open(fileURL);
})
.catch(error => {
    console.log(error);
});

也许是因为window.open导致了弹出窗口阻止程序的捕获,但是使用axios来下载pdf的效果很好。

答案 1 :(得分:0)

考虑到您收到的.pdf是base64字符串(或可以解析或转换为base64字符串的任何格式),例如:

JVBERi0xLjQKJeTw7fgKOSAwIG9iago8PC9GaWx0ZXIvRmxhdGVEZWNvZGUvTGVuZ3RoID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ayBuffer: function(base64) {
    var binaryString = window.atob(base64);
    var binaryLen = binaryString.length;
    var bytes = new Uint8Array(binaryLen);
    for (var i = 0; i < binaryLen; i++) {
      var ascii = binaryString.charCodeAt(i);
      bytes[i] = ascii;
    }
    return bytes;
  },
  saveByteArray: function(data, name) {
    var a = document.createElement("a");
    document.body.appendChild(a);
    a.style = "display: none";
    var blob = new Blob(data, { type: "application/pdf" }),
      url = window.URL.createObjectURL(blob);
    a.href = url;
    a.download = name;
    a.click();
    window.URL.revokeObjectURL(url);
  }
}

从你的善行呼唤他们

    generateFarmerPDF:function (id) {
        this.farmerId = id
      var data = new FormData()
      data.append('function','generateFarmerPDF')
        data.append('farmerId',this.farmerId )
      axios.post(this.url,data)
          .then( function (response ) {

        let base64 = "you base64 String here";
        //or let base64 = response.data.myPdfInBase64;

        let byteCharacters = this.base64ToArrayBuffer(base64);
        this.saveByteArray([byteCharacters], selectedItem.pdfDap.nome);

      }.bind(this)).catch(function (error) {

      })

    }

如果您需要更多详细信息或想查看一个简单的javascript示例,请查看this答案。