how to print a document to a .pdf file using applescript?

Does anybody know how to automatically print a document to a .pdf file with a script?
Please help

I replied to your question under my request see item below. But this was about OSX. If you have OS9 you can use printtopdf which is a pdf printer driver, found at

http://www.jwwalker.com/pages/pdf.html