Skip to content
0

zathura

zathura 是一个基于命令行的 PDF 查看工具,可以用作 Yazi 和 NeoMutt 的扩展工具。

配置文件

The customization of zathura is be managed via a configuration file called zathurarc. By default zathura will evaluate the following files:

  • /etc/zathurarc
  • $XDG_CONFIG_HOME/zathura/zathurarc (default: ~/.config/zathura/zathurarc)

The zathurarc file is a simple plain text file that can be populated with various commands to change the behaviour and the look of zathura which we are going to describe in the following subsections. Each line (besides empty lines and comments which start with a prepended #) is evaluated on its own, so it is not possible to write multiple commands in one single line.

复制文本

有时候,我们希望从 PDF 文件内复制一些信息,比如从一些 UPS shipping labels 上获取 tracking number,然后在浏览器上通过官网提供的界面进行轨迹查询。

注意

经过图片转换的 PDF 通常是无法提取文本的。只有经过文本文档转换过来的 PDF 才更容易提取文字。

如果没有事先进行配置,在 zathura 的查看界面,通过鼠标左键点击、拖动可以高亮文本,底部状态栏显示内容已经复制的提示信息:

Copied selected text to selection primary: Sound Rise II

官方文档说,这时文本已经复制至 PRIMARY 剪贴板,在其他的编辑应用内按下鼠标中键,可以粘贴。但是我的鼠标不行。

打开配置文件,添加:

zathurarc
# Change the X clipboard from PRIMARY to CLIPBOARD
set selection-clipboard clipboard

这时再通过鼠标左键点击、拖动、高亮文本,底部状态栏显示内容已经复制至系统剪贴板的提示信息:

Copied selected text to selection clipboard: Sound Rise II

去到其他的编辑应用,按下 Ctrl + V 就可正常粘贴了。

中文乱码

亚马逊 FBA 贴纸内包含中文的发货地址,在其他的查看器可以正常显示,在 zathura 查看却是乱码。这说明内置的编解码器出现了异常。

最近更新