如何使用DBU中的EVINCE中的开放式PDF文档获取当前页码?

发布于 2025-01-21 13:23:31 字数 514 浏览 2 评论 0原文

如果我在Evince(GNOME文档查看器)中打开PDF文档,如何使用DBU获取当前页码?

使用Zathura我可以使用以下命令获取页码:(

busctl get-property --user org.pwmt.zathura.PID-1123767 \
 /org/pwmt/zathura \ 
org.pwmt.zathura pagenumber

我已经使用 d-feet 获取总线,对象和接口名称)。

但是,当谈到Gnome Evince时,我找不到任何API来检索当前页码。

有什么选择吗?

PS:我在Ubuntu上使用EVINCE 3.36.10 20.04

If I open a PDF document inside evince (GNOME Document Viewer), how do I get the current page number using DBus?

using zathura I could get the page number using the following command:

busctl get-property --user org.pwmt.zathura.PID-1123767 \
 /org/pwmt/zathura \ 
org.pwmt.zathura pagenumber

(I have used D-Feet to get the bus, object, and interface names).

However, when it comes to Gnome evince, I can't find any API to retrieve the current page number.

Are there any options to achieve that?

P.S: I am using evince 3.36.10 on Ubuntu 20.04

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

§普罗旺斯的薰衣草 2025-01-28 13:23:31

我认为没有办法使用DBU检索这些信息。但是,可以使用GVF(GNOME虚拟文件系统)检索与页码相关的元数据:

gio info -a "metadata::evince::page" /path/to/the/pdf/file

每当您滚动页面时,此信息都会更新。

一个重要的说明(根据我的测试)是该文档不应在/tmp目录中,因为看来这些元数据没有保存。

I think there is no way to retrieve that information using DBus. However, one can use GVFS (Gnome Virtual File System) to retrieve the metadata relevant to the page number:

gio info -a "metadata::evince::page" /path/to/the/pdf/file

This informations is updated whenever you scroll the page.

One important note (according to my tests) is that the document should not be under /tmp directory as it appears that those metadata are not saved.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文