title: DOMPDF: files with 0 bytes and text/plain mime-type
body: <p>I'm using Kohana 3 and pdfview/DOMPDF to generate pdf files but they are generated with 0 bytes and text/plain mime-type.</p>
  
  <p>Controller:</p>
  
  <pre><code>public function action_pdf() {
      if(isset($_POST['dados'])) {
          $pdf = View_PDF::factory('export/pdf');
          $pdf-&gt;title = '';
          $pdf-&gt;headers = array();
          $pdf-&gt;data = array();
  
          $this-&gt;request-&gt;response = $pdf;
          $this-&gt;request-&gt;send_file(true, 'dados.pdf');
      }
  }
  </code></pre>
  
  <p>View:</p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;
      &lt;meta http-equiv="content-type" content="text/html; charset=utf-8" /&gt;
          &lt;style type="text/css"&gt;
          * {
              border: 0;
              margin: 0;
              padding: 0;
          }
  
          table {
              border: 1px solid;
              border-collapse: collapse;
              margin: 0 auto;
              text-align: center;
              width: 500px;
          }
  
          td {
              border: 1px solid;
              padding: 5px;
          }
          &lt;/style&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;h1&gt;Teste&lt;/h1&gt;
          &lt;table&gt;
              &lt;tr&gt;&lt;/tr&gt;
          &lt;/table&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>When I download the file and open it in epdfview (PDF viewer), it says:</p>
  
  <pre><code>Unable to open document
  File type plain text document (text/plain) is not supported
  </code></pre>
  
  <p>I just don't know what's wrong. Thank you.</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>I downloaded the last beta version and of DOMPDF, deleted the pdfview Kohana's module and did something like that in my controller:</p>
  
  <pre><code>public function action_pdf() {
          if(isset($_POST['dados'])) {
              require_once(Kohana::find_file('vendor', 'dompdf/dompdf_config.inc'));
  
              $view = View::factory('report/pdf');
              $view-&gt;title = '';
              $view-&gt;data = array();
  
              $pdf = new DOMPDF();
  
              $pdf-&gt;load_html($view-&gt;render());
              $pdf-&gt;render();
              $pdf-&gt;stream('dados.pdf', array('Attachment' =&gt; 1));
          }
      }
  </code></pre>
  
  <p>Now it's working. Thanks!</p>