title: PHP embedd a PDF in a browser window
body: <p>This code opens a PDF in a blank browser window with no extra style.</p>
  
  <pre><code>header('Content-Type: application/pdf');
  header('Content-Disposition: inline; filename="'.basename($complete_path).'"');
  header('Cache-Control: private, max-age=0, must-revalidate');
  header('Pragma: public');
  header('Content-Length: ' .filesize($complete_path));
  
  $success = readfile($complete_path);
  </code></pre>
  
  <p>But I want to apply more info and some styling too. So I tried this code :</p>
  
  <pre><code>echo '&lt;!DOCTYPE html&gt;';
  echo '&lt;head&gt;';
      echo '&lt;meta charset="UTF-8"&gt;';
      echo '&lt;title&gt;'.$file_name.'&lt;/title&gt;';
      echo '&lt;link rel="stylesheet" type="text/css" href="css/docs.css" /&gt;';
  echo '&lt;/head&gt;';
  
  echo '&lt;body &gt;';
  
      echo'&lt;div class="frame"&gt;';
          $success = readfile($complete_path);
      echo'&lt;/div&gt;';    
  
  echo '&lt;/body&gt;';
  </code></pre>
  
  <p>Obviously this fails, it was a quick try. So how to embedd a PDF file in a styled browser page ? I do not want to download it on disk.</p>