FPDF is a PHP class which allows to generate PDF files with pure PHP. which can be easily integrated in our CakePHP 3 app.
Install FPDF via composer:
php composer.phar require setasign/fpdf
Add this at the top of our controller file:
Create a test PDF in one of your actions:
$pdf = new \FPDF(); $pdf->AddPage(); $pdf->SetFont('Arial','B',16); $pdf->Cell(40,10,'Hello World!'); $pdf->Output(); exit;