It really is amazing how hard it is just to retrieve the currently opened pdf file and its page number in a pdf viewer. Some pdf viewers (Like Zathura) provide this via DBus, but even very common ones like Evince don't. I managed to find a way using gvfs, although it's a bit of a hack.
For others (e.g. Mendeley), I have no idea on how to do this... Anybody have ideas? it is Qt based, maybe I can hook into that via some debugging tool?