Make a generate word or pdf

how to make an automatic report in word or pdf form and the data comes from the input form? is there any tutorial?