By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,345 Members | 1,758 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,345 IT Pros & Developers. It's quick & easy.

launching adobe reader with arguments from os.system call

P: n/a
Currently I am launching adobe reader using the following call:
os.system("path.file.pdf")
this works fine for opening the pdf doc at the beginning. We would like
to enhance this and open the document to either a page or a nameddest
in the doc. The syntax for that in the DOS command prompt world is:
acroRd32.exe /A "nameddest=Before You Begin" "path.file.pdf"
However the os.system call won't allow me to call reader using that
syntax. Does anyone know how I can launch the Reader application and
pass in the parameters required to allow the document to be opened to
the named destination? Thanks in advance!!

Sep 6 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Greg Miller wrote:
Currently I am launching adobe reader using the following call:
os.system("path.file.pdf")
this works fine for opening the pdf doc at the beginning. We would like
to enhance this and open the document to either a page or a nameddest
in the doc. The syntax for that in the DOS command prompt world is:
acroRd32.exe /A "nameddest=Before You Begin" "path.file.pdf"
However the os.system call won't allow me to call reader using that
syntax. Does anyone know how I can launch the Reader application and
pass in the parameters required to allow the document to be opened to
the named destination? Thanks in advance!!
I'm not sure how/if you can do what you want with os.system(), but this
is what I've used to pass arguments directly to applications on
Windows: # spawn text editor on file
import os
applpath = r'C:\Windows\system32\notepad.exe'
filepath = r'D:\My Documents\somefile.txt'
os.spawnv(
os.P_WAIT,
applpath,
[ # argument list
applpath,
filepath
]
)


A downside is that it requires you to know the full path to the
application, 'acroRd32.exe' in your case. On the other hand, I think
you could pass just about any argument values (as strings) that you
wished in the list passed as the third argument.

HTH,
-Martin

Sep 6 '05 #2

P: n/a
Thank you Martin, here's what I discovered this morning to work, the
only problem is it is painfully slow to launch the application.

os.system('start acroRd32.exe'+' /A'+' "page=15"'+'
"C:\\Gregtemp\\estelletest\\NexGlosser_User_Guide_ W60G00_en.pdf"')

I'm going to give your method a try to see if it launches any quicker.
Thanks again.

Greg Miller

Sep 8 '05 #3

P: n/a
Greg Miller wrote:
Thank you Martin, here's what I discovered this morning to work, the
only problem is it is painfully slow to launch the application.

os.system('start acroRd32.exe'+' /A'+' "page=15"'+'
"C:\\Gregtemp\\estelletest\\NexGlosser_User_Guide_ W60G00_en.pdf"')

I'm going to give your method a try to see if it launches any quicker.
Thanks again.

Greg Miller

You might notice that if you already have an Acrobat Reader window open
the document comes up rather more quickly.

If you want fast document startup you could consider using the win32all
extensions to create an AcroReader application process in advance of
opening any documents.

regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC http://www.holdenweb.com/

Sep 8 '05 #4

P: n/a
Thank you for the information, when I launched the Reader on the actual
hardware it launched quickly. I think I just have too much running on
my application PC. I will consider starting an AcroReader app however.

Greg

Sep 8 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.