Solved

Acrobat Reader command line switches

Posted on 2004-10-01
17
92,946 Views
Last Modified: 2011-08-18
Hi experts,

what are the available command line switches for the Adobe Acrobat Reader versions? I would like to open a PDF document from the commandline, specifying the display zoom factor.

broesi
0
Comment
Question by:broesi
  • 7
  • 4
  • 4
  • +2
17 Comments
 
LVL 33

Expert Comment

by:sajuks
ID: 12198319
0
 
LVL 33

Expert Comment

by:sajuks
ID: 12198346
0
 
LVL 44

Accepted Solution

by:
Karl Heinz Kremer earned 500 total points
ID: 12198372
The document from sajuks' link describes the command line switches for the Unix version. Don't expect them to work for Windows.

You can find the switches that are supported in the Acrobat Developer FAQ (http://partners.adobe.com/asn/acrobat/docs.jsp) You need a free Adobe web account for this.

This document describes the "Acrobat Open Parameters": http://partners.adobe.com/asn/acrobat/sdk/public/docs/PDFOpenParams.pdf - one of them being the zoom factor.

0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 12198382
The better way to specify the zoom factor is by setting it in the PDF file with Acrobat. This will, it will always open the same way, and you don't have to rely on command line parameters.

BTW: My comment regarding sajuks' link was about the first link. The second one just lists the parameters from the Developer FAQ.
0
 
LVL 5

Author Comment

by:broesi
ID: 12198490
khkremer,

that is almost exactly what I am looking for. The only problem is that this works only if I call acrord32.exe with the parameters (e.g. c:\program files\adobe\acrobat reader\acrord32.exe /n /s "mydoc.pdf")
It does not work if I just type 'mydoc.pdf /s /n' on the command line on Windows.

Is there any way to make it work without specifiying the path to acrord32.exe?

The point is this:  my app is delivered with a set of pre-made PDF documents (so setting the zoom factor inside the PDF's is not an option here) I would like to launch. But I can't be sure if an Acrobat or Acrobat Reader is installed at all on the user's machines at all.



broesi
0
 
LVL 33

Expert Comment

by:sajuks
ID: 12198512
You can specify acrobat path in your system path :C:\Program Files\Adobe\Acrobat 6.0\Acrobat
That will enable you to open from any directory/path
0
 
LVL 5

Author Comment

by:broesi
ID: 12198539
But then I still need to know what (Acrobat itself or 'just' the reader) is there and where it is (the app will be shipped to a lot of clients, all with different machines).
And if I knew that, I could just as well address the EXE right where it is...

Now, is there an easy way to find out if Acrobat/Reader is installed and if so, where?

broesi
0
 
LVL 33

Expert Comment

by:sajuks
ID: 12198581
which language are you using to check it ?
Maybe checking for its existence under HKEY_CURRENT_USER\Software\Adobe\ might help .
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 12198592
You can check the file associations in Windows to see what application is installed to handle PDF files. This way you would know if Reader or Acrobat are installed.

If you want to ship this solution to customers, you should really think about setting the zoom setting as part of your "initial view" settings when you create the PDF documents, or in a separate step in Acrobat before you deploy the solution.
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 12198728
Just in case it's not clear: You can check the file associations in the registry.

When you set your file assocs for PDF, you can specify what action to perform when you open a file of this type. The default is something like this:

"C:\Program Files\Adobe\Acrobat 6.0\Acrobat\Acrobat.exe" "%1"

You can add your command line arguments to this line, and everytime you double-click on a PDF file, you will get the new settings.

However: I strongly suggest that you will not go this route. This means that you basically take over your customer's PCs. This will not be limited to just your PDF files, but will be active for all PDF files that they open on these machines. If you would do this on my system, you would definitely hear from me... And, I may no longer be one of your customers after that.

Again, the right way to do this is to modify the PDF files. YOu can do this by selecting the document properties (File>Document Properties), then select "Initial View" and set the "Magnification".
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 12198794
sajuks, the key you proposed only works if the current user has started Acrobat (or Reader) at least once. The better place to check is really in the file associations. This is set when the application is installed, and it does not require that it was run by the current user.

You can find this in HKEY_CLASSES_ROOT. The key .pdf points to the entry that handles PDF files. If this is set to AcroExch.Document, you have Acrobat installed. This entry contains all the information about how to process files of this type.
0
 
LVL 5

Author Comment

by:broesi
ID: 12198841
khkremer,

as I said, the PDF's I am shipping with my app (which is a VB6-program) are pre-made, so I can't change them. Of course changing the default file association is a no-go!
So I will probably look for an existing PDF file association and check if it is Acrobat or Acrobat reader.

The points go to khkremer, since the specified links showed me how to open an existing PDF with a certain zoom factor (I was searching Adobe's support area before, but couldn't find it myself...). But thanks to sajuks as well for your thoughts!

broesi
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 12198919
Are you actually opening the PDFs from within your application? If so, you can get the path to the PDF viewer from the registry, and then just use the full command line to open the files. This is a bit more involved as just asking Windows to open a certain file, but it will give you access to all the features.
0
 
LVL 5

Author Comment

by:broesi
ID: 12198977
Yes, thats exactly what I want to do! Right now I just send the filename "Mydoc.pdf" to a command shell and let Windows take care of the rest. According to your suggestions I will change this and get the path of the PDF viewer from the registry.

Thanks again,


broesi
0
 

Expert Comment

by:kleinbottle
ID: 14227363
I attempted to see default viewer  in the Wind registry using java and jst.
Oddly it works in my JBuilder IDE, and from commandline but NOT from within a jar.
A known java bug mens that jar execution does NOT recognise classpath, so the jni dll cant be found. So I have reverted to "cmd|command start Fred.pdf"  
Now for Linux... I suspect there is a default config file somewhere, but I will probably just try a bunch of commands until one woeks
kpdf
acroread
KGhostview
XPDF
GSview
XPDF
xpdf
Preview
Xpdf    (why cant Linux types be precise about cAse , since Linux is?)
PSviewer
....etc etc
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 14227692
kleinbottle, please don't post in already answered questions.
0
 
LVL 4

Expert Comment

by:justin-clarke
ID: 24136636
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Update 21-May-2015: I temporarily removed the source code and the code snippets to make major changes to the program. Regards, Joe A recent question here at Experts Exchange piqued my interest, so I decided to provide a thorough solution and publ…
*Adobe Acrobat 9 was used for this article.  Particular steps may vary depending on software versions. Adobe Acrobat has many, many variables that my be utilized to customize your forms for clarity and ease of use. The Form Editing Tool will be y…
In this third video of the Xpdf series, we discuss and demonstrate the PDFtoText utility, which converts PDF files into plain text files. Download and install the software.: You may have already downloaded and installed the Xpdf tools while watching…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now