title: How uses helper callbacks to generate a PDF from the contents with TCPDF?
body: <p>Hi i am trying create a helper to convert a entire html from a CTP to PDF using tcpdf->writeHTML();</p>
  
  <p>I have tried:</p>
  
  <pre><code>function beforeLayout(){
  
      ob_clean();
  
      ob_start();
  
      $pageOrientation = 'P';
  
      $this-&gt;setup($pageOrientation);
      $this-&gt;pdf-&gt;AddPage(); 
  
      $this-&gt;pdf-&gt;setPrintHeader(false);
      $this-&gt;pdf-&gt;setPrintFooter(false);
  
      $this-&gt;pdf-&gt;SetFont('times','B',8);
  
      $this-&gt;pdf-&gt;writeHTML(ob_get_contents(), false, false, false, false, 'L');
  
      echo $this-&gt;pdf-&gt;Output('x.pdf', 'D'); 
  
  }
  </code></pre>
  
  <p>But without sucess :(</p>