title: Generating PDF in php
body: <p>I am using the following code to generate pdf in php but when I open file it shows <code>corrupted or damaged file</code> error.    </p>
  
  <pre><code>$FileName = date("d-m-y") . '.pdf';
  $Content = "";
  
  # Titlte of the CSV
  $Content = "Name,Address,Age,Phone \n";
  
  # fill data in the CSV
  $Content .= "\"John Doe\",\"New York, USA\",15,65465464 \n";
  
  header('Content-Type: application/pdf');
  header('Content-Disposition: attachment; filename="' . $FileName . '"');
  echo $Content;
  exit();
  </code></pre>