html2pdf mit composer hinzugefügt

This commit is contained in:
aschwarz
2023-02-16 09:19:46 +01:00
parent 3dcc93a65d
commit d1ab7f3763
613 changed files with 134681 additions and 0 deletions

33
vendor/spipu/html2pdf/examples/utf8.php vendored Normal file
View File

@ -0,0 +1,33 @@
<?php
/**
* Html2Pdf Library - example
*
* HTML => PDF converter
* distributed under the OSL-3.0 License
*
* @package Html2pdf
* @author Laurent MINGUET <webmaster@html2pdf.fr>
* @copyright 2017 Laurent MINGUET
*/
require_once dirname(__FILE__).'/../vendor/autoload.php';
use Spipu\Html2Pdf\Html2Pdf;
use Spipu\Html2Pdf\Exception\Html2PdfException;
use Spipu\Html2Pdf\Exception\ExceptionFormatter;
try {
$html2pdf = new Html2Pdf('P', 'A4', 'fr');
$content = file_get_contents(K_PATH_MAIN.'examples/data/utf8test.txt');
$content = '<page style="font-family: freeserif"><br />'.nl2br($content).'</page>';
$html2pdf->pdf->SetDisplayMode('real');
$html2pdf->writeHTML($content);
$html2pdf->output('utf8.pdf');
} catch (Html2PdfException $e) {
$html2pdf->clean();
$formatter = new ExceptionFormatter($e);
echo $formatter->getHtmlMessage();
}