title: How can I convert excel file to pdf using TCPDF?
body: <p>I need to generate a report with graphs in excel to pdf. I tried using phpexcel but it fails to load the charts. It only generates PDF with tables. Here's my code in phpexcel. </p>
  
  <pre><code>$newpdf = "report-".date('m_d_Y_H_i_s', strtotime('now')).".pdf";
  $objPHPExcel1 = new PHPExcel();
  $objPHPExcel1 = PHPExcel_IOFactory::load('csv/'.$filename);
  $objPHPExcel1-&gt;getActiveSheet(0)-&gt;getPageSetup()-&gt;setOrientation(PHPExcel_Worksheet_PageSetup::ORIENTATION_PORTRAIT);
  $objPHPExcel1-&gt;getActiveSheet(0)-&gt;getPageSetup()-&gt;setPaperSize(PHPExcel_Worksheet_PageSetup::PAPERSIZE_A4);
  $objPHPExcel1-&gt;getActiveSheet(0)-&gt;getPageSetup()-&gt;setFitToWidth(true);
  $objPHPExcel1-&gt;getActiveSheet(0)-&gt;getPageSetup()-&gt;setFitToHeight(true);
  $objPHPExcel1-&gt;getActiveSheet()-&gt;setShowGridLines(false);
  
  header('Content-Type: application/pdf');
  header('Content-Disposition: attachment;filename="'.$newpdf.'"'); 
  header('Cache-Control: max-age=0'); //no cache
  $objWriter1 = new PHPExcel_Writer_PDF($objPHPExcel1); 
  $objWriter1-&gt;save('php://output');
  exit;
  </code></pre>
  
  <p>I also tried loading the contents from HTML using jchartfx for graphs without success. Any idea?<br>
  Thanks in advance. </p>