Last change
on this file since 429 was 347, checked in by roby, 4 years ago |
Aggiornamento per compatibilità con php7.4
|
File size:
787 bytes
|
Rev | Line | |
---|
[347] | 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 | */
|
---|
| 12 | require_once dirname(__FILE__).'/../vendor/autoload.php';
|
---|
| 13 |
|
---|
| 14 | use Spipu\Html2Pdf\Html2Pdf;
|
---|
| 15 | use Spipu\Html2Pdf\Exception\Html2PdfException;
|
---|
| 16 | use Spipu\Html2Pdf\Exception\ExceptionFormatter;
|
---|
| 17 |
|
---|
| 18 | try {
|
---|
| 19 | ob_start();
|
---|
| 20 | include dirname(__FILE__).'/res/example12.php';
|
---|
| 21 | $content = ob_get_clean();
|
---|
| 22 |
|
---|
| 23 | $html2pdf = new Html2Pdf('P', 'A4', 'fr');
|
---|
| 24 | $html2pdf->writeHTML($content);
|
---|
| 25 | $html2pdf->output('example12.pdf');
|
---|
| 26 | } catch (Html2PdfException $e) {
|
---|
| 27 | $html2pdf->clean();
|
---|
| 28 |
|
---|
| 29 | $formatter = new ExceptionFormatter($e);
|
---|
| 30 | echo $formatter->getHtmlMessage();
|
---|
| 31 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.