This forum has been archived. All content is frozen. Please use KDE Discuss instead.
Please use bugs.kde.org for bug reports or feature requests. Development related questions should be directed to the okular-devel mailing list.

Accessing the okular api through dbus

Tags: None
(comma "," separated)
akc
Registered Member
Posts
1
Karma
0
I'm trying to call okular through dbus to open a document, and go to a particular line using its synctex functionality. This works fine if use the following in a command line:

Code: Select all
okular --unique file.pdf#src:138file.tex


where 138 is the line number in the tex file. If I try doing the same through dbus to interact with an already open okular session, this fails. For example

Code: Select all
 gdbus call --session --dest org.kde.okular --object-path /okular --method org.kde.okular.openDocument file.pdf#src:138file.tex


The okular window returns

Code: Select all
 Could not open file.pdf#src:138file.tex


There is another openDocument method in `/okular/okular_Shell_1` that takes two arguments: url and serializedOptions.

Code: Select all
 gdbus call --session --dest org.kde.okular --object-path /okular --method org.kde.okular.openDocument file.pdf "src:138file.tex"


And this returns

Code: Select all
 (false,)


Any ideas?


Bookmarks



Who is online

Registered users: Bing [Bot], daret, Google [Bot], Sogou [Bot]