FPDF is a PHP class which allows you to generate PDF files with pure PHP, that is to say without using the PDFlib library.
For those who are already familiar with FPDF, this post will show you how to output your PDF file using FPDF. There are 4 methods that you can use according to your own needs:
- Method 1: Saving the PDF to a file:
- Method 1 (for server): Saving the PDF file to server (make sure you have 777 writing permissions for that folder!):
- Method 2: Prompting user to choose where to save the PDF file:
- Method 3: Automatically open PDF in your browser after being generated:
- Method 4: Returning the PDF file content as a string: