Salesforce.com makes it extremely easy to generate PDF documents on the fly by simply using the renderAs=”pdf” attribute for the <apex:page> component. It’s also a snap to attach these PDFs to records as Attachments. Below is a small Visualforce page and Controller that generates a PDF and saves it to an Account.
I responded to a similar questiuon at http://boards.developerforce.com/t5/General-Development/Creating-report-based-on-attachment/m-p/388171/highlight/false#M65517
Hope this helps
Jay
Hi,
Salesforce.com makes it extremely easy to generate PDF documents on the fly by simply using the renderAs=”pdf” attribute for the <apex:page> component. It’s also a snap to attach these PDFs to records as Attachments. Below is a small Visualforce page and Controller that generates a PDF and saves it to an Account.
Refer :
http://blog.jeffdouglas.com/2010/07/14/attach-a-pdf-to-a-record-in-salesforce/
Regards,
Md Farooq