FPDF is a PHP class which allows to generate PDF files with PHP Script. FPDF stands for Free PDF. You can use it for any kind of usage and modify it to suit your needs.

Main features are :

  • Choice of measure unit, page format and margins.
  • Page header and footer management.
  • Automatic page break and line break.
  • Automatic text justification.
  • Image support (JPEG, PNG and GIF).
  • Colors and Links
  • TrueType, Type1 and encoding support.
  • Page compression.

Download FPDF Class from http://www.fpdf.org/en/download.php and extract zip file into fpdf folder. The following example shows, how to create simple pdf using FPD in PHP.

 //create an FPDF object
 $pdf=new FPDF("P","mm","A4"); 
 //or custom page size
 //$pdf=new FPDF("P","mm",array(150,250)); 
 //Add Blank Page

 //Set Font,Style,Size 
 //Prints a cell with borders , alignment and fill background .
 // Close document and sent to the browser

Reference : http://www.fpdf.org/