How do I open a PDF to a specific page via the command line?

Several questions about opening PDFs from the Mac OS X command line:

1) How do I use the "open" command to open a PDF to a specific page? (I know I can open a document via: open doc_name.pdf)

2) How do I use the "open" command to pass multiple arguments (page no, zoom scale, view mode, etc...) to open a PDF file in a specific manner?

3) Does Preview handle the same parameters as Acrobat Reader? If not, what are the differences in options?

I've spent hours searching for this answer and have come up dry. I've downloaded Adobe's "PDF Open Parameters" document -- it lists all of the parameters I need, however I can't get any of them to work from the command line.

My goal: Open a PDF from the command line to a specific page. At first glance, I thought this would be simple to do and find -- however, after a lot of searching I haven't found an example on how to do it.

Anyone have any experience doing this, and care to share?

Much appreciated! ---> Kelsey

Various, Mac OS X (10.6)

Posted on Aug 26, 2010 9:01 AM

Reply
2 replies

Aug 26, 2010 9:23 PM in response to yeslekmc

I don't know of any way to do what you want using the 'open' command. It can probably be done with Applescript, which you could call from a shell script. The Preview application doesn't seem to be scriptable. I don't use Acrobat, so I can't tell you anything about that. Looking through the dictionaries of the apps I do have, it seems that Skim (another PDF viewer) has an AS 'page' class. Below are a couple of links that may get you started. Look for more specific guidance in Applescript forums.

http://sourceforge.net/apps/mediawiki/skim-app/index.php?title=AppleScript
http://links.tedpavlic.com/shell_scripts/skim

Aug 27, 2010 10:26 AM in response to yeslekmc

I know enough to be dangerous...

Mac OS applications are hidden directories. Look in the hidden directory via right clicking on the name or from the terminal.

You need to drill down into the bundle & start the actual program:
/Applications/Adobe\ Reader\ 9/Adobe\ Reader.app/Contents/MacOS/AdobeReader

You could try modifying the info plist:
/Applications/Adobe\ Reader\ 9/Adobe\ Reader.app/Contents/Info.plist

Robert

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How do I open a PDF to a specific page via the command line?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.