Question: I need to create a PDF or Word file filled with contents from my database. Then the customer need to download that file. All this should happend when customer click on link.

Anyone have any idea?

Answer: 
Try TCPDF

<http://www.tcpdf.org/>

But google could have told you that
[wkthmltopdf](http://code.google.com/p/wkhtmltopdf/) is really THE ONLY solution that worked for me that could produce what I call acceptable results. Still, some minor modifications to the CSS had to be made, however, it worked really well when it comes to rendering the content. All the other packages are really only suitable if you have a rather simply document with one basic table etc. No chance to get them to produce fair results on complex docs with design elements, css, multiple overlapping images etc. If complex documents are in game - do not spend the time (like I did) - go straight to wkhtmltopdf.

Take a look at my own question and solution in this post [HTML2PDF in PHP - convert utilities & scripts - examples & demos](https://stackoverflow.com/questions/9910975/pdf2html-in-php-convert-untilities-scripts-examples-demos)