[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/se3master/var/www/se3/html2pdf/examples/ -> js3.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  
  14      // get the HTML
  15       ob_start();
  16  ?>
  17  <page>
  18      <h1>Test de JavaScript 3</h1><br>
  19      <br>
  20      Normalement une valeur devrait vous être demandée, puis affichée
  21  </page>
  22  <?php
  23      $content = ob_get_clean();
  24  
  25      // PDF script to execute
  26      $script = "
  27  var rep = app.response('Donnez votre nom');
  28  app.alert('Vous vous appelez '+rep);
  29  ";
  30  
  31      // convert to PDF
  32      require_once(dirname(__FILE__).'/../html2pdf.class.php');
  33      try
  34      {
  35          $html2pdf = new HTML2PDF('P', 'A4', 'fr');
  36          $html2pdf->pdf->IncludeJS($script);
  37          $html2pdf->writeHTML($content, isset($_GET['vuehtml']));
  38          $html2pdf->Output('js3.pdf');
  39      }
  40      catch(HTML2PDF_exception $e) {
  41          echo $e;
  42          exit;
  43      }


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