There are times that it would be nice to automate the creation of PDF files. For example, one might want a workflow to open a file, change some paragraphs, and print to PDF. This would seem a simple thing, but I haven't found a way to script the Print to PDF functionality. However, the Pages app in the iWork suite will do it for you.
As an example, the following AppleScript will use {ages to print to PDF:
tell application "Pages"
open file "test6.pages"
set product to front document
set first paragraph of product to "Fee, fii, foo, fum!"
save product in "test6.pdf"
end tell
Of course, all of the above examples save the files at the root directory level -- full AppleScript paths would be needed to put the files where you want. This method is a valuable way to automate the creation of PDF files with the combination of Pages and AppleScript.
Mac OS X Hints
http://hints.macworld.com/article.php?story=20081013154417292