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: 
I have used [TCPDF](http://www.tcpdf.org/) with much success to generate PDF files programatically using PHP.

And to generate word documents: <http://www.phpdocx.com/> (this is a paid solution).
You can use for example: [html2pdf](http://www.html2pdf.fr/en/example). It's heavy library but seems to have very advanced functionality.

[dompdf](http://code.google.com/p/dompdf/) is a light library but it lacks a bit unicode support.

If you have access to the server maybe it would be better to install the [PECL PDF](http://www.php.net/manual/en/pdf.installation.php) library. But I never used so cannot tell you if it's good