Integrada libreria dompdf y ejemplo hola mundo

This commit is contained in:
imnavajas
2023-11-02 22:59:29 +01:00
parent ad55a2290f
commit bfa5e04550
6 changed files with 148 additions and 3 deletions

View File

@ -0,0 +1,24 @@
<?php
namespace App\Controllers\Pdf;
use App\Controllers\BaseController;
class PdfController extends BaseController
{
function __construct()
{
}
public function index()
{
return view('pdf_view');
}
public function htmlToPDF(){
$dompdf = new \Dompdf\Dompdf(['isRemoteEnabled' => true]);
$dompdf->loadHtml(view('pdf_view'));
$dompdf->setPaper('A4', 'portrait');
$dompdf->render();
$dompdf->stream();
}
}