[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/se3master/var/www/se3/html2pdf/examples/ -> radius.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      // get the HTML
  14       ob_start();
  15  ?>
  16  <style type="text/css">
  17  <!--
  18  .div { background: #CCDDCC; color: #002200; text-align: center; width: 70mm; height: 20mm; margin: 2mm; }
  19  .div1 { border: solid 2mm black; border-radius: 5mm;              -moz-border-radius: 5mm;              }
  20  .div2 { border: solid 2mm black; border-radius: 3mm 10mm 0mm 3mm; -moz-border-radius: 3mm 10mm 0mm 3mm; }
  21  .div3 { border: solid 2mm black; border-radius: 10mm / 7mm;       -moz-border-radius: 10mm / 7mm;       }
  22  .div4 { border: solid 6mm black; border-radius: 5mm / 10mm;       -moz-border-radius: 5mm / 10mm;       }
  23  .div5 { border: solid 5mm black; border-top: none; border-bottom: none; border-radius: 5mm; -moz-border-radius: 5mm; }
  24  .div6 { border: solid 5mm black; border-left: none; border-right: none; border-radius: 5mm; -moz-border-radius: 5mm; }
  25  .div7 { border: solid 5mm black; border-left: none; border-top: none; border-radius: 5mm;   -moz-border-radius: 5mm; }
  26  .div8 { border-radius: 8mm; -moz-border-radius: 8mm; border-left: solid 2mm #660000; border-top: solid 1mm #006600; border-right: solid 2mm #000066; border-bottom: solid 4mm #004444;}
  27  -->
  28  </style>
  29  <page>
  30      <div class="div div1">Exemple de div</div>
  31      <div class="div div2">Exemple de div</div>
  32      <div class="div div3">Exemple de div</div>
  33      <div class="div div4">Exemple de div</div>
  34      <div class="div div5">Exemple de div</div>
  35      <div class="div div6">Exemple de div</div>
  36      <div class="div div7">Exemple de div</div>
  37      <div class="div div8">Exemple de div</div>
  38  </page>
  39  <?php
  40       $content = ob_get_clean();
  41  
  42      // convert to PDF
  43      require_once(dirname(__FILE__).'/../html2pdf.class.php');
  44      try
  45      {
  46          $html2pdf = new HTML2PDF('P', 'A4', 'fr');
  47          $html2pdf->writeHTML($content, isset($_GET['vuehtml']));
  48          $html2pdf->Output('radius.pdf');
  49      }
  50      catch(HTML2PDF_exception $e) {
  51          echo $e;
  52          exit;
  53      }


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