← 插件

PDF 查看器(PDF.js)

用 PDF.js 在 Paseo 的文件标签页中阅读 PDF:可选择文本、搜索、跟随链接,文件重新生成后自动刷新并保持当前页。

$ clisbot plugin add bendavid/pdfjs-viewer
报告问题
bendavid侧边栏0次安装9390c1051fd6源代码
PDF 查看器(PDF.js) 截图 1PDF 查看器(PDF.js) 截图 2

该插件的概览尚未翻译为你的语言,因此以英文显示。

Read PDFs inside Paseo's file tab. Click a .pdf in Files and it opens in a PDF.js viewer instead of "Binary preview unavailable".

The viewer is meant for documents an agent or a build keeps rewriting, such as Typst or LaTeX output. When the file changes, the tab reloads it and keeps your page, zoom, and scroll position, and it shows the old version until the new one has drawn. The tab also remembers where you were when you close and reopen it.

What you can do in the viewer:

  • Select and copy text, and follow links. Links inside the document jump within it; web links open in your browser.
  • Search the document, with a match count and highlighting.
  • Move by page, choose a zoom level from the zoom menu (automatic, actual size, fit page, fit width, or 50% to 400%), or pinch and Ctrl+scroll to zoom.
  • Turn pages with the Left and Right arrow keys when the whole page width is visible, as in Okular. Zoomed in further, they scroll sideways. The current page, shown in the page box, is the page you last jumped to until you scroll, and otherwise the page nearest the middle of the view, also as in Okular.
  • Turn off continuous mode to see one page at a time, as in Okular. Scrolling or pressing Down, Page Down, or Space past the bottom of a page shows the top of the next one; scrolling up past the top shows the bottom of the previous one. The tab remembers the setting.
  • Choose what dragging does: select text, pan the page with the hand tool, or mark an area. An area can be copied to the clipboard as text or as an image rendered at twice the screen's resolution. The tab remembers which tool you used.
  • Invert page colors for reading in a dark theme.
  • Open password-protected PDFs. The password is kept in memory only, never saved, and reused when the file is rebuilt.

Setup: Paseo 0.13.0 or later on both the app and the daemon. Installing from a Git repository or the registry runs npm ci and node on the daemon host, so both need to be on its PATH.

Limits:

  • Works in the desktop app and in a browser. The iOS and Android apps show a message instead, because Paseo plugins cannot run PDF.js there yet.
  • The whole file is read into the app each time it changes, over the relay when the host is remote. Files over 64 MB ask before opening.
  • Chinese, Japanese, and Korean text that uses non-embedded fonts needs a matching font installed on the computer you view it on.
  • The viewer does not fill in forms, edit annotations, print, or save.

The plugin's server code sends the PDF.js library and its fonts, character maps, and image decoders to the app; nothing is fetched from the internet.