title: Download pdf vue
body: <p>when I call this fucntion on PostMan it does download the pdf but when I call in from the page it does not download but request reaches. I want it to download </p>
  
  <pre><code>,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) {
  
            })
  
          }
  </code></pre>
  
  <p>here is the api code</p>
  
  <pre><code>if ($function == "generateFarmerPDF") {
      $farmerId = $_POST['farmerId'];
  
      $result = DB::instance()-&gt;executeSQL("SELECT * FROM `milk_production`  WHERE `farmerId` ='$farmerId'");
      $header = DB::instance()-&gt;executeSQL("SELECT `COLUMN_NAME` 
  FROM `INFORMATION_SCHEMA`.`COLUMNS` 
  WHERE `TABLE_SCHEMA`='blog_samples' 
  AND `TABLE_NAME`='milk_production'");
  
  
      $pdf = new FPDF();
      $pdf-&gt;AddPage();
      $pdf-&gt;SetFont('Arial', 'B', 5);
      foreach ($header as $heading) {
          foreach ($heading as $column_heading)
              $pdf-&gt;Cell(20, 6, $column_heading, 1);
      }
      foreach ($result as $row) {
          $pdf-&gt;SetFont('Arial', '', 5);
          $pdf-&gt;Ln();
          foreach ($row as $column)
              $pdf-&gt;Cell(20, 6, $column, 1);
      }
      $pdf-&gt;Output();
  }
  </code></pre>
  
  <p>This is how I call it</p>
  
  <pre><code>&lt;button v-on:click="generateFarmerPDF(milkvolume.farmerId)"&gt;Report&lt;/button&gt;&lt;/td&gt;
  </code></pre>