PDA

View Full Version : Invokinger PDF viewer from commandline


stevem
2007-06-20, 20:58
Hi. I would like to be able to invoke the PDF viewer from a shell, in order to open email attachments. I have poked around but so far haven't been able to work it out. Any hints gratefully received.

Thanks,
Steve

Bernard
2007-06-20, 21:37
You probably need to use the D-bus. I must say that I don't really understand it yet, but it probably be somewhat the same as using the webbrowser from xterm.
http://www.internettablettalk.com/forums/showthread.php?t=5713

for example starting the web browser:
dbus-send --print-reply --dest=com.nokia.osso_browser /com/nokia/osso_browser com.nokia.osso_browser.load_url string:http://www.internettablettalk.com/

it probably is somewhat the same for the pdf viewer, Please let us know when you figure it out

stevem
2007-06-21, 07:21
Hi Bernard. Thanks for the tip, and I shall do some poking around and see what I can do. I shall let you know if I succeed !

Regards
Steve.

jethro.itt
2007-06-22, 10:45
In Python it goes like this:


import osso
context = osso.Context("openmime", "0.0.1", False)
mime = osso.Mime(context)
mime.open_file_with_mime_type("/home/user/test.pdf", "application/pdf")


I guess it goes similarly in C, if you want to make a simple launcher program instead of using Python.