Ok, you can see the code at :
The actual pdf generation is about 10 lines of code in the middle.
Keep in mind I'm not a php programmer by trade so it may be a bit untidy - hopefully theres not too many wtf? parts in there
I'd been interested in taking a look at any improvements you add.