Print PDF Through Safari From Command Line

steve harley steve at paper-ape.com
Tue Feb 6 20:26:28 PST 2007


they whom i call Michael Stearne wrote:
> Does anyone know of a way to load a URL into Safari and then "print"
> (Save As PDF...) it to a fail all from the command line.
> 
> HTML File -> Safari -> PDF

this works with Acrobat Pro installed (with its default printer 
instance):

   open -b com.apple.Safari x.html
   osascript -e 'tell app "Safari" to print window 1 with 
properties {target printer:"Adobe PDF 8.0"}'

without Acrobat Pro, you could substitute a virtual PDF printer 
created using one of the approaches here:

<http://www.macosxhints.com/article.php?story=20031116190809396>

(scroll down to "10.4")



More information about the MacOSX-talk mailing list