Open PDF

Mike Meyer mwm at mired.org
Thu Sep 22 11:42:28 EDT 2005


Dan <dan at cellectivity.com> writes:
> Under Linux you can probably use xpdf or gpdf:
>
>   os.system("xpdf /path/to/file.pdf")
>
> Note that you should check the return code of "system" to see if the
> execution was successful. For example, the user might not have xpdf
> installed.

This is the problem that the "open" package was designed to
solve. The API for Python apps is still under development, but if you
do 'os.system("open /path/to/file.pdf")', open will use the users
preferred pdf viewer, and interact with the user to select one if they
don't have a prefernce on record.

      <mike
-- 
Mike Meyer <mwm at mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.



More information about the Python-list mailing list