Primo commit: trasferimento del progetto PPEasy

This commit is contained in:
2024-09-18 10:30:50 +02:00
commit eb475f257e
4233 changed files with 1043848 additions and 0 deletions
+56
View File
@@ -0,0 +1,56 @@
<?php
require 'dompdf/autoload.inc.php';
use Dompdf\Dompdf;
use Dompdf\Options;
$options = new Options();
$options->set('isHtml5ParserEnabled', true);
$options->set('isRemoteEnabled', true); // Enable remote files to be fetched
$dompdf = new Dompdf($options);
// HTML content for the PDF
$html = '
<html>
<head>
<style>
body { font-family: Arial, sans-serif; }
.content { text-align: center; }
.content img { width: 100%; max-width: 500px; }
</style>
</head>
<body>
<div class="content">
<h1>Sample PDF with Image</h1>
<img src="http://localhost/cmccopiaoriginale/public/assets/images/ce.jpg" alt="Image">
</div>
</body>
</html>
';
$dompdf->loadHtml($html);
// (Optional) Set up the paper size and orientation
$dompdf->setPaper('A4', 'portrait');
// Render the HTML as PDF
$dompdf->render();
// Output the generated PDF to Browser
$dompdf->stream("sample.pdf", array("Attachment" => false));