title: Calling a view and generating a PDF in TCPDF at the same time in Codeigniter
body: <p>I'm trying to call a controller/method which returns a view,
  but also in the same controller I'm creating a PDF,</p>
  <p>The problem is, the Buffer of TCPDF object and the view, are messing up,
  I had tried with ob_clean and related commands, but still no success, if I return the view, the pdf doesn't show any data, but if I return the pdf with success, the view doesn't show up.</p>
  <p>How can I solve this?<br />
  example</p>
  <pre><code>public function index(){
      $this-&gt;load-&gt;view(&quot;some_view&quot;); //Doesn't matter
      $this-&gt;createPDF(); //In which order I place them, the result is the same
  }
  
  public function createPDF(){
   // settings
      $pdf-&gt;writeHTML($html, true, false, true, false, '');
      ob_clean();
      $pdf-&gt;Output(dirname(__FILE__).'/pdf/file.pdf', 'F');      
  }
  </code></pre>