[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/se3master/var/www/se3/html2pdf/examples/ -> about.php (source)

   1  <?php
   2  /**
   3   * HTML2PDF Librairy - example
   4   *
   5   * HTML => PDF convertor
   6   * distributed under the LGPL License
   7   *
   8   * @author      Laurent MINGUET <webmaster@html2pdf.fr>
   9   *
  10   * isset($_GET['vuehtml']) is not mandatory
  11   * it allow to display the result in the HTML format
  12   */
  13      require_once(dirname(__FILE__).'/../html2pdf.class.php');
  14  
  15      // get the HTML
  16       ob_start();
  17       include(dirname('__FILE__').'/res/about.php');
  18      $content = ob_get_clean();
  19  
  20      try
  21      {
  22          // init HTML2PDF
  23          $html2pdf = new HTML2PDF('P', 'A4', 'fr', true, 'UTF-8', array(0, 0, 0, 0));
  24  
  25          // display the full page
  26          $html2pdf->pdf->SetDisplayMode('fullpage');
  27  
  28          // convert
  29          $html2pdf->writeHTML($content, isset($_GET['vuehtml']));
  30  
  31          // add the automatic index
  32          $html2pdf->createIndex('Sommaire', 30, 12, false, true, 2);
  33  
  34          // send the PDF
  35          $html2pdf->Output('about.pdf');
  36      }
  37      catch(HTML2PDF_exception $e) {
  38          echo $e;
  39          exit;
  40      }


Generated: Tue Mar 17 22:47:18 2015 Cross-referenced by PHPXref 0.7.1