You need to use a special library to generate a PDF, since the format is a complex one. If you have a budget to spend, you can buy a commercial product (these tend to be fuller in features) or download one of the few free libraries such as FPDF (which is more primitive and hence fiddly).
There are other complicating factors such as the embedding of fonts but the documentation for your chosen library will cover these.
FDPF won't do things like rotated text or fancy effects. However, I have never needed that. I have a couple of sites that happily spew out beautiful PDF documents on demand.
Here [tecnick.com] is an extruded project. I have no idea how good it is.
If you like pears, there's an extension there [pear.php.net] that might be useful. I don't really use Pear that much, as it tends to be total overkill on the sites I build. However, it is a great system.