So erstellen Sie PDF mit Doompdf in PHP

<?php
require_once 'dompdf/autoload.inc.php';
use Dompdf\Dompdf;
$dompdf = new Dompdf();
$html = '<h1 style="color:blue;">Hello World!</h1><p>A PDF generated by DomPDF library.</p>';
$dompdf->loadHtml($html);
$dompdf->setPaper('A4', 'landscape');
$dompdf->render();
// write pdf to a file
$pdf = $dompdf->output();
file_put_contents("newfile.pdf", $pdf);
?>
Dark Dragonfly