Fpdf - generating .pdf documents easily from your PHP program
Archive - Originally posted on "The Horse's Mouth" - 2012-07-24 22:38:09 - Graham Ellis
In Summary - use is as easy as
1. Load the class
require('fpdf.php');
2. Create a new FPDF object
$pdf = new FPDF();
3. Add a page to the output document
$pdf-> AddPage();
4. Set the font and font size
$pdf-> SetFont('Arial', 'B',16);
5. Add your text
$pdf-> Cell(80, 8,'07:00 - 09:00 - Breakfast',0,1,"C");
6. Send the pdf to the browser
$pdf-> Output();
Clearly there are lots of repeats of these lines to create the sample I have shown above, and I've used setmargin, setx, sety and settextcolor too ... full code [here].
Pre-requisite to using classes such as these:
a) Some knowledge about the take they'll undertake (you must be able to answer "What is a .pdf"?)
b) Knowledge of Object Orientation and how it works in PHP - see [here] for the appropriate course if you know PHP, but "OO" is new to you!