[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/se3master/var/www/se3/html2pdf/examples/ -> groups.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  ob_start();
  15  ?>
  16  <style type="text/css">
  17  <!--
  18      table.page_header {width: 100%; border: none; background-color: #DDDDFF; border-bottom: solid 1mm #AAAADD; padding: 2mm }
  19      table.page_footer {width: 100%; border: none; background-color: #DDDDFF; border-top: solid 1mm #AAAADD; padding: 2mm}
  20  -->
  21  </style>
  22  <page backtop="14mm" backbottom="14mm" backleft="10mm" backright="10mm" pagegroup="new">
  23      <page_header>
  24          <table class="page_header">
  25              <tr>
  26                  <td style="width: 100%; text-align: left">
  27                      Exemple d'utilisation des groupes de pages
  28                  </td>
  29              </tr>
  30          </table>
  31      </page_header>
  32      <page_footer>
  33          <table class="page_footer">
  34              <tr>
  35                  <td style="width: 100%; text-align: right">
  36                      page [[page_cu]]/[[page_nb]]
  37                  </td>
  38              </tr>
  39          </table>
  40      </page_footer>
  41      Ceci est la page 1 du groupe 1
  42  </page>
  43  <page pageset="old">
  44      Ceci est la page 2 du groupe 1
  45  </page>
  46  <page pageset="old">
  47      Ceci est la page 3 du groupe 1
  48  </page>
  49  <?php for ($k=2; $k<5; $k++): ?>
  50  <page pageset="old" pagegroup="new">
  51      Ceci est la page 1 du groupe <?php echo $k; ?>
  52  </page>
  53  <page pageset="old">
  54      Ceci est la page 2 du groupe <?php echo $k; ?>
  55  </page>
  56  <?php endfor; ?>
  57  <?php
  58      $content = ob_get_clean();
  59  
  60      require_once(dirname(__FILE__).'/../html2pdf.class.php');
  61      try
  62      {
  63          $html2pdf = new HTML2PDF('P', 'A4', 'fr', true, 'UTF-8', 0);
  64          $html2pdf->pdf->SetDisplayMode('fullpage');
  65          $html2pdf->writeHTML($content, isset($_GET['vuehtml']));
  66          $html2pdf->Output('groups.pdf');
  67      }
  68      catch(HTML2PDF_exception $e) {
  69          echo $e;
  70          exit;
  71      }


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