source: trunk/client/inc/hpdf5/spipu/html2pdf/examples/about.php@ 418

Last change on this file since 418 was 347, checked in by roby, 4 years ago

Aggiornamento per compatibilità con php7.4

File size: 940 bytes
Line 
1<?php
2/**
3 * Html2Pdf Library - example
4 *
5 * HTML => PDF converter
6 * distributed under the OSL-3.0 License
7 *
8 * @package Html2pdf
9 * @author Laurent MINGUET <webmaster@html2pdf.fr>
10 * @copyright 2017 Laurent MINGUET
11 */
12require_once dirname(__FILE__).'/../vendor/autoload.php';
13
14use Spipu\Html2Pdf\Html2Pdf;
15use Spipu\Html2Pdf\Exception\Html2PdfException;
16use Spipu\Html2Pdf\Exception\ExceptionFormatter;
17
18try {
19 $html2pdf = new Html2Pdf('P', 'A4', 'fr', true, 'UTF-8', array(0, 0, 0, 0));
20 $html2pdf->pdf->SetDisplayMode('fullpage');
21
22 ob_start();
23 include dirname(__FILE__).'/res/about.php';
24 $content = ob_get_clean();
25
26 $html2pdf->writeHTML($content);
27 $html2pdf->createIndex('Sommaire', 30, 12, false, true, 2, null, '10mm');
28 $html2pdf->output('about.pdf');
29} catch (Html2PdfException $e) {
30 $html2pdf->clean();
31
32 $formatter = new ExceptionFormatter($e);
33 echo $formatter->getHtmlMessage();
34}
Note: See TracBrowser for help on using the repository browser.