A while back, Bill Cheeseman posted some code for printing to PDF from the front application. This script is based on his code.
tell application "System Events"
set appname to name of first process whose frontmost is true
end tell
activate application appname
tell application "System Events"
tell process appname
-- insert GUI Scripting statements here
keystroke "p" using command down
set PDFButton to menu button "PDF" of sheet 1 of window 1
click PDFButton
click menu item "Save As PDF…" of menu 1 of PDFButton
delay 1
click button "Save" of window 1
end tell
end tell