Advertisement
Guest User

render (main file)

a guest
Apr 4th, 2012
645
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.80 KB | None | 0 0
  1. <?php
  2. /**
  3.  * HTML2PDF Librairy - example
  4.  *
  5.  * HTML => PDF convertor
  6.  * distributed under the LGPL License
  7.  *
  8.  * @author      Laurent MINGUET <[email protected]>
  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.     include(dirname(__FILE__).'/form.php');
  16.     $content = ob_get_clean();
  17.  
  18.     // convert to PDF
  19.     require_once(dirname(__FILE__).'/html2pdf.class.php');
  20.     try
  21.     {
  22.         $html2pdf = new HTML2PDF('P', 'A4', 'en', false, 'ISO-8859-1', 3);
  23.         $html2pdf->pdf->SetDisplayMode('fullpage');
  24.         $html2pdf->writeHTML($content, isset($_GET['vuehtml']));
  25.         $html2pdf->Output('exemple03.pdf');
  26.     }
  27.     catch(HTML2PDF_exception $e) {
  28.         echo $e;
  29.         exit;
  30.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement