Solved

Acrobat Reader command line switches

Posted on 2004-10-01
17
92,887 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
Comment Utility
0
 
LVL 33

Expert Comment

by:sajuks
Comment Utility
0
 
LVL 44

Accepted Solution

by:
Karl Heinz Kremer earned 500 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
which language are you using to check it ?
Maybe checking for its existence under HKEY_CURRENT_USER\Software\Adobe\ might help .
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 44

Expert Comment

by:Karl Heinz Kremer
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
kleinbottle, please don't post in already answered questions.
0
 
LVL 4

Expert Comment

by:justin-clarke
Comment Utility
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

The ability to edit PDF documents can be useful, however it may not be a straight forward process. Many non-technical people don't realise that a PDF document is basically an image rather than a text file, even if it contains nothing but text. If…
One of the questions I get asked again and again is how to validate a field value in an AcroForm with a custom validation script. Adobe provided a lot of infrastructure to do that with just a simple script. Let’s take a look at how to do that wit…
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…
Sometimes we receive PDF files that are in the wrong orientation. They may be sideways or even upside down. This most commonly happens with scanned or faxed documents. It is possible to rotate the view of these PDFs with the free Adobe Reader produc…

762 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

11 Experts available now in Live!

Get 1:1 Help Now