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

How to launch pdf viewer on Mac?

P: n/a
Hi,

On Windows, os.startfile() does what I want:

os.startfile("myDocument.pdf")

That launches the default PDF viewer on the system in a separate
process. Perfect.

On Linux, I understand that there really isn't a standard for
determining a default application for a given file type (indeed, there
may not even be a windowing system installed), so on that platform I've
resorted to:

os.system("xpdf myDocument.pdf &")

But on Mac, what do I do? The user may prefer Adobe Acrobat Reader, the
native Preview utility, or some other viewer. Actually, at this point
I'll settle with figuring out how to launch the native Preview utility,
but the ideal solution would let the user preference as set at the Mac
system level determine the viewer.

While my question is "how do I launch a pdf viewer on Mac" I'll take
constructive criticism on how I've solved this for Windows and Linux as
well...

Thanks! See you at PyCon!
--
pkm ~ http://paulmcnett.com
Jul 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
has
Paul McNett wrote:
On Windows, os.startfile() does what I want:

os.startfile("myDocument.pdf")

But on Mac, what do I do?


os.system("open myDocument.pdf")

HTH
has

Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.