In this post, I will explain how to create a pdf file in php. To create a PDF file in PHP we will use the FPDF library. It is a PHP library that is used to generate a PDF. FPDF is an open-source library. It is the best server-side PDF generation PHP library. It has rich features right from adding a PDF page to creating grids and more.
$pdf = new FPDF();
$pdf->Cell(80,10,’Hello World From FPDF!’);
$pdf->Output(‘test.pdf’,’I’); // Send to browser and display