title: download PDF file in safari 5.1.7
body: <p>I am working with cakephp. I have generate <code>FDF</code> file using the function from <a href="http://koivi.com/fill-pdf-form-fields" rel="nofollow">http://koivi.com/fill-pdf-form-fields</a> this URL</p>
  
  <p>It is working fine. Then I generate the PDF file using <code>PDFTK</code>, and have some header to download the file its working fine in Firefox, Chorome and IE but it did not work well in safari browser. In safari it shows the PDF file code. When I use <code>exit();</code> at the end of commands then safari download the file but it was not not complete.</p>
  
  <p>Normal size of file is 60Kb but with <code>exit()</code> it generate the 48Kb file. So its mean some of the <code>PDF</code> file contents missed out because of <code>exit()</code> command.</p>
  
  <p>If some one can give some hint to solve this problem in safari browser. 
  Thanks in advance.</p>
  
  <pre><code>header('Content-Type: application/octet-stream');
  header('Content-Disposition: attachment; filename="pdf_file_name.pdf"');
  header("Content-Type: application/download");
  header("Content-Length: " . filesize($pdf_doc));
  header('Expires: 0');
  header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
  header('Pragma: public');
  // $pdf_doc is the PDF Form physical path
  // $fdf_doc is the FDF file physical path
  echo passthru("/usr/local/bin/pdftk $pdf_doc fill_form $fdf_doc output - ");
  </code></pre>