If you are looking for a PDF library to handle PDF files with PHP, I will recommend to use FPDF library. FPDF is a php class file which makes the pdf generation easier than before. It has all the built in functions for creating pdf. It helps in creating documents at run time with PHP.
Download this call file from the offical website http://www.fpdf.org/
FPDF has many advantages which are not available in other PDF libraries. This class also supports many other languages other than english which makes it different from other libraries.
See the sample code below
$pdf = new FPDF();
In this code I have included the class file downloaded from the website. Then create a new object of FPDF. default pages for the pdf are in A4 portrait and all the units are in milimeter.
This PHP code will generate a PDF file that will have a single line “Helloo World!”
$pdf->SetFont(‘Arial’,’B’,16); // this line sets the font, style, size to the text. here B stands for bold.
Use $pdf->Output(); at the end of the file to generate PDF file.
You can find more tutorials about FPDF on the official website.