There are some solutions to be found free (off the top of my head, I remember seeing something before, called "HTML2PDF" or something like that, a freebie written in PHP).
Unfortunately, I also remember being rather unimpressed (actually downright disappointed) with these solutions. They all pretty much weren't worth the trouble, pretty hit or miss. If you are working on something for a client, then it will be much better to tell him that his particular feature request will cost $500 due to necessary software acquisition.