title: How to configure phpexcel for pdf
body: <p>i've been searching in the official docs but i can't seem to put all the things together in my mind (i'm new to programming). I managed to use the excel library and it's working super, but now i want to offer the user the chance to choose between downloading the file in .xls or in .pdf.</p>
  
  <p>I'm using Codeigniter and WAMP.</p>
  
  <p>I downloaded PHPExcel, and it's on my C: directory.</p>
  
  <p>Later i copied Classes: PHPExcel (folder) and PHPExcel.php to my codeigniter's third party folder.</p>
  
  <p>Then, inside Codeigniter's Application, Libraries, i created a file named pdf.php and copied in there the code from the original PHPExcel docs (21pdf.php)</p>
  
  <p><strong>pdf.php</strong></p>
  
  <pre><code>/** PHPExcel_IOFactory */
  require_once dirname(__FILE__) . '/../Classes/PHPExcel/IOFactory.php';
  $rendererName = PHPExcel_Settings::PDF_RENDERER_TCPDF;
  $rendererLibrary = 'tcPDF5.9';
  $rendererLibraryPath = '/php/libraries/PDF/' . $rendererLibrary;
  
  
  if (!PHPExcel_Settings::setPdfRenderer(
      $rendererName,
      $rendererLibraryPath
  )) {
  die(
      'NOTICE: Please set the $rendererName and $rendererLibraryPath values' .
      EOL .
      'at the top of this script as appropriate for your directory structure'
  );
  }
  </code></pre>
  
  <p>I don't really know how to configure it, my brain is burned right now. Any help would be very appreciated!</p>