title: Zend PDF Tables Helper
body: <p>Is there any Zend Helper that can make PDF document with tables.
  i need to pass result of my Query and the helper will return a PDF document with data in a table.
  Just like the below Csv Helper.</p>
  
  <p>what i did here is that i put the given class in </p>
  
  <pre><code>Zend/Controller/Action/Helper
  </code></pre>
  
  <p>and than in my Action i do so</p>
  
  <pre><code>    public function getcsvAction() {
      $this-&gt;_helper-&gt;layout()-&gt;disableLayout();
      $this-&gt;_helper-&gt;viewRenderer-&gt;setNeverRender();
      try{
          $clModel = new Application_Model_DbTable_Mytable();
          $select = $clModel-&gt;clCSV());
          $this-&gt;_helper-&gt;Csv($select, "genertadfile name");
      }catch(Exception $e){
          echo 'Oops! Something went wrong.';
      }
      exit;
   }
  </code></pre>
  
  <p>and this the class</p>
  
  <pre><code>  &lt;?php
  
  
  // Zend_Controller_Action_Helper_Csv
  
  class Zend_Controller_Action_Helper_Csv extends Zend_Controller_Action_Helper_Abstract{
  
  
  public function direct($aryData = array(), $strName = "csv", $bolCols = true){
      $this-&gt;printExcel($aryData, $strName, $bolCols);
       }
  
  
    public function printExcel($aryData = array(), $strName = "csv", $bolCols = true){
            if (!is_array($aryData) || empty($aryData)){  exit(1); }
  
  // header
      header('Content-Description: File Transfer');
      header('Content-Type: text/csv; charset=utf-8');
      header("Content-Disposition: attachment; filename=" . $strName . "-export.csv");
      header('Content-Transfer-Encoding: binary');
      header('Expires: 0');
      header('Cache-control: private, must-revalidate');
      header("Pragma: public");
  
      if ($bolCols){
        $aryCols = array_keys($aryData[0]);
        array_unshift($aryData, $aryCols);
         }
        ob_start();
  
      $fp = fopen("php://output", "w");
       if (is_resource($fp)){
     foreach ($aryData as $aryLine)  {
      fputcsv($fp, $aryLine, ',', '"');
          }
  $strContent = ob_get_clean();
  
     $strContent = preg_replace('/^ID/', 'id', $strContent);
     $strContent = utf8_decode($strContent);
     $intLength = mb_strlen($strContent, 'utf-8');
  
  header('Content-Length: ' . $intLength);
  echo $strContent;
      exit(0);
  }
  ob_end_clean();
  exit(1);
   }
     }
  ?&gt;
  </code></pre>