473,386 Members | 1,602 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

launching adobe reader with arguments from os.system call

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
4 4395
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Greg | last post by:
I have some html code that is displayed on a wxHTMLwindow in a Python application. One of the ahref links is to a pdf document. When I click the link, I get what appears to be some sort of header...
2
by: Jens S0nderby Munk | last post by:
Hi, I'm having some problems with the Reponse.BinaryWrite, IE 6.0 and Adobe Reader 6.0. When I try to write a pdf-file to an IE browser with a Adobe Reader 6.0 installed then it just displays a...
2
by: Tim Stevens | last post by:
Hello, This is the first time I have had to resort to posting on here, as Ive always been able to find a solution to my problems in the past by browsing postings by others. So, to start with I...
1
by: Stephan Steiner | last post by:
Hi I'm trying to automate VPN connection establishment and disconnection using the Cisco VPN client. That particular client has an interactive cli interface. I set my program up to launch the...
1
by: Derrick | last post by:
What's the best way to go about doing this? I see the "Readme" dialog you can add, but that seems like only a small text box to put some .rtf text in. I would like to pop up a somewhat lengthy...
24
by: Alan M Dunsmuir | last post by:
What is the command (in Windows Forms VB.NET) which will cause the subject computer's default browser to launch, and display a specified Web page? -- Alan M Dunsmuir
3
by: Michael Moreno | last post by:
Hello, I am trying to automatically compile all my projects but I am stuck on something silly: launching csc with the right arguments. Here is my code private void CompileProject(string...
2
by: =?Utf-8?B?SmVycnkgQw==?= | last post by:
I have a server 2008 IIS 7.0 with indexing service installed. I have created the catalog and have a test page using these posts:...
0
by: kirankumarn | last post by:
I want to open pdf files from Adobe Reader 8.0 default from C# code. but in my system Adobe Acrobat 5.0 installed & Adobe Reader 8.0 installed. So my code opens by default in Adobe Acrobat 5.0 i want...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.