Working with PDFLib is not the easiest things to do with PHP. I have just came accross a article from Zend Developer Zone that shows how to work with PHP and Haru, a PECL extension, to easily create dinamic PDF‘s documents.
I haven’t worked with the Haru extension before, but, from the article examples, it seems simple. A good Object Oriented interface is used to create the PDF document in a very simple way.
Check out the article at http://devzone.zend.com/article/4044-Dynamically-Generating-PDF-Files-with-PHP-and-Haru for more information of how to use the Haru extension with PHP to create PDF Documents, it is worth the read.
If you are wondering where would you use this, it’s simple, just imagine a sytem where you have to send an invoice by email.
Have fun creating the script and, as a suggestion, do the last example, it’s awesome 🙂