First Aid list, amount list and kitchen list PDF download implemented
This commit is contained in:
17
app/Providers/PdfGenerateAndDownloadProvider.php
Normal file
17
app/Providers/PdfGenerateAndDownloadProvider.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Dompdf\Dompdf;
|
||||
|
||||
class PdfGenerateAndDownloadProvider {
|
||||
public static function fromHtml(string $html, string $orientation = 'portrait'): string
|
||||
{
|
||||
$dompdf = new Dompdf();
|
||||
$dompdf->loadHtml($html, 'UTF-8');
|
||||
$dompdf->setPaper('A4', $orientation);
|
||||
$dompdf->render();
|
||||
|
||||
return $dompdf->output();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user