Skip to content

Releases: ktabe/pdfless

pdfless v2.0.0

Choose a tag to compare

@ktabe ktabe released this 11 Oct 12:01
587487b

pdfless 2.0.0

日本語版はこのページの末尾にあります(「日本語」を開いてください).
A Japanese version is at the end of this page.

pdfless is a less(1)-like pager that shows documents as images in the
terminal (iTerm2, WezTerm). Version 1.1.0 showed PDFs, images and text files.
Version 2.0.0 also shows Markdown, Office documents and SVG, and adds a table
of contents, page thumbnails, a continuous view and a much better search.

Some options and keys have changed; see "Changes that need attention" below.

New formats

  • Markdown is rendered as formatted pages, with search, clickable links
    (including links to headings within the file) and a table of contents from
    its headings. Fenced mermaid blocks are drawn as diagrams. Press t to
    see the source.
  • Office documents: Word, Excel, PowerPoint and OpenDocument through
    LibreOffice; on macOS, also Pages, Numbers and Keynote through Quick Look.
    RTF, Visio and WMF are supported too.
  • SVG is rendered with a headless Chrome or Chromium.
  • Images show their information in text mode (t): size, format, EXIF
    data including exposure settings, and GPS coordinates ready to paste into a
    map.
  • Password-protected PDFs and Office documents ask for their password.

Most of these need additional software; the README's "Additional formats"
section lists what each one needs. Rendered pages are cached between runs
(--no-cache, --clear-cache).

Finding your way around

  • Table of contents (o or TAB): jump to a section from a PDF's
    bookmarks, Markdown headings, Word headings or PowerPoint slide titles.
  • Page thumbnails (S, or -s / --sidebar): a column of thumbnails down the
    left edge. Click one, or press s to pick one with the keyboard.
  • Continuous view (c or -c): pages follow one another, so you can
    scroll from one page into the next.
  • Scrollbar: click or drag it to move through the document (r or
    --no-scrollbar to hide it).
  • File list (O): pick one of the files given on the command line. {
    and } also switch files.
  • A directory on the command line stands for the files directly in it.

Search

  • ? searches backward; / or ? followed by ENTER repeats the last
    search.
  • Search finds text through Unicode variants (such as full-width and
    half-width forms), extra spaces and line breaks.
  • A regex stays within one line unless you press ^T while typing it.
  • The search prompt has a cursor and readline-style editing.
  • While a search is active, q or ESC clears it instead of quitting.

Text mode

  • Switching between image and text mode (t) keeps the place being read.
  • T enters text mode already cleared for copying: no border, end-of-line
    marks, line numbers or scrollbar.
  • New toggles: line numbers (-N), end-of-line marks (E), long-line
    wrapping (W).
  • On a terminal without inline-image support, pdfless starts in text mode
    instead of failing.

Other additions

  • Pager use: pdfless reads standard input when no file is given, so it
    works as $PAGER.
  • Follow mode (-f, or F while viewing): reload the file when it
    changes. v opens the file in its own macOS app and turns follow mode on.
  • -F: quit at once if the document fits on one screen, as less -F
    does.
  • --doctor: check which of the programs and libraries pdfless uses
    are installed, and what will not work without the missing ones.
  • tmux: images now display inside tmux (with allow-passthrough on).
  • Speed: the next page and the next file are prepared in the background,
    and scrolling redraws only what changed.
  • ^C interrupts a long render.

Changes that need attention

1.1.0 2.0.0
-F, --follow -f, --follow. -F is now --quit-if-one-screen.
--no-frame -B, --no-border
f toggles the text-mode border B toggles it. f only moves forward one window.
? shows the help F1 or :h shows the help. ? searches backward.
Mouse wheel scrolls 1 line per step 2 lines per step (--wheel-scroll-step to change it)
Long lines in a text file are panned with h / l They wrap by default (-S or W to chop them instead)

Network access: a Markdown file loads images and stylesheets from local files
only, unless --remote-resources is given.

Thanks

Thanks to @teranisi for the Markdown source view and Mermaid diagram support.

See the README for details.


日本語

pdfless 2.0.0

pdflessは,ターミナル(iTerm2,WezTerm)上に文書を画像として表示する,less(1)風のページャです.
バージョン1.1.0で表示できたのは,PDF,画像,テキストファイルでした.
バージョン2.0.0では,Markdown,Office文書,SVGも表示できるようになり,目次,ページのサムネイル,連続表示が加わり,検索も大きく改善しました.

一部のオプションとキーが変わりました.下の「注意が必要な変更」を参照してください.

新しく対応した形式

  • Markdown:整形したページとして表示します.検索,クリック可能なリンク(ファイル内の見出しへのリンクを含む),見出しから作る目次に対応します.mermaidのフェンス付きコードブロックは図として描画します.tでソースを表示します.
  • Office文書:Word,Excel,PowerPoint,OpenDocumentをLibreOfficeで表示します.macOSでは,Pages,Numbers,KeynoteもQuick Lookで表示します.RTF,Visio,WMFにも対応します.
  • SVG:ヘッドレスのChromeまたはChromiumで描画します.
  • 画像:テキストモード(t)で画像の情報を表示します.大きさ,形式,露出設定などのEXIFデータ,地図にそのまま貼り付けられるGPS座標を確認できます.
  • パスワード付きのPDFとOffice文書は,パスワードを尋ねます.

これらの多くは追加のソフトウェアを必要とします.形式ごとに必要なものは,READMEの「追加の対応形式」の節にまとめています.
描画したページは,次回以降の実行のためにキャッシュします(--no-cache,--clear-cache).

文書内の移動

  • 目次(oまたはTAB):PDFのしおり,Markdownの見出し,Wordの見出し,PowerPointのスライドタイトルから,各節に移動できます.
  • ページのサムネイル(S,または-s / --sidebar):画面の左端にサムネイルを並べます.クリックするか,sを押してキーボードで選びます.
  • 連続表示(cまたは-c):ページを続けて表示し,ページをまたいでスクロールできます.
  • スクロールバー:クリックやドラッグで文書内を移動できます(rまたは--no-scrollbarで非表示).
  • ファイル一覧(O):コマンドラインで指定したファイルから選べます.{と}でもファイルを切り替えられます.
  • コマンドラインでディレクトリを指定すると,その直下のファイルを開きます.

検索

  • ?で逆方向に検索します./または?に続けてENTERを押すと,直前の検索を繰り返します.
  • Unicodeの表記の違い(全角と半角など),余分な空白,改行をまたいで一致します.
  • 正規表現は1行の中で一致します.入力中に^Tを押すと,改行をまたいで一致させられます.
  • 検索の入力欄にカーソルが表示され,readline風の編集ができます.
  • 検索中にqまたはESCを押すと,終了せずに検索を解除します.

テキストモード

  • 画像モードとテキストモードを切り替えても(t),読んでいた位置を保ちます.
  • Tで,コピーしやすい状態のテキストモードに入ります.枠,行末記号,行番号,スクロールバーを表示しません.
  • 切り替えられる項目が増えました:行番号(-N),行末記号(E),長い行の折り返し(W).
  • インライン画像に対応していないターミナルでは,エラーにせずテキストモードで起動します.

その他の追加機能

  • ページャとしての利用:ファイルを指定しないと標準入力から読み込むので,$PAGERとして使えます.
  • 追従モード(-f,または表示中にF):ファイルが更新されると再読み込みします.vを押すと,そのファイルをmacOSの既定のアプリで開き,追従モードを有効にします.
  • -F:文書が1画面に収まる場合は,表示してすぐ終了します(less -Fと同じ).
  • --doctor:pdflessが使う外部コマンドとライブラリのうち,どれがインストールされているか,不足しているものがあると何ができないかを表示します.
  • tmux:tmuxの中でも画像を表示できるようになりました(allow-passthrough onが必要).
  • 速度:次のページと次のファイルをバックグラウンドで準備します.スクロール時は,変わった部分だけを描き直します.
  • 時間のかかる描画を^Cで中断できます.

注意が必要な変更

1.1.0 2.0.0
-F,--follow -f,--follow.-Fは--quit-if-one-screenになりました.
--no-frame -B,--no-border
fでテキストモードの枠を切り替え Bで切り替えます.fは1画面先に進むだけになりました.
?でヘルプを表示 F1または:hでヘルプを表示します.?は逆方向の検索です.
マウスホイールは1ステップで1行スクロール 1ステップで2行(--wheel-scroll-stepで変更できます)
テキストファイルの長い行はh / lで横に移動して読む 既定で折り返します(-SまたはWで折り返さない表示にできます)

ネットワークへのアクセス:Markdownファイルは,--remote-resourcesを指定しない限り,画像とスタイルシートをローカルファイルからのみ読み込みます.

謝辞

Markdownのソース表示とMermaid図への対応は,@teranisi さんによるものです.ありがとうございます.

詳細はREADMEを参照してください.

pdfless v1.1.0

Choose a tag to compare

@ktabe ktabe released this 10 Sep 13:43

A less(1)-like pager for PDFs, images, and text files, for the terminal (works with iTerm2 / WezTerm's inline image protocol).

Highlights

  • View plain images (PNG/JPEG/whatever Pillow decodes) and plain text files, not just PDFs — detected by content, not extension
  • Open multiple files at once (pdfless a.pdf b.png c.txt) and switch between them with :n/:p (less(1)-style) or x/X/<N>x
  • PDF hyperlinks are clickable — external URLs open in your system browser, internal links jump within the document; [/] retraces where you jumped from
  • Mouse wheel scrolling (--wheel-scroll-step to change the step size)
  • g/G now match less(1)'s own semantics (top/bottom of the current page, or a line/page number with a count prefix); the old "first/last page of the document" role moved to </>/Home/End
  • ^Z suspends properly, including when launched via uv run
  • Scrollable help overlay (?)
  • Several bug fixes: a stray full-screen color after searching, invalid image files crashing mid-session, an invalid file among several given on the command line aborting the whole run

See the README for details.

pdfless v1.0.0

Choose a tag to compare

@ktabe ktabe released this 09 Sep 08:56

A less(1)-like PDF pager for the terminal (works with iTerm2 / WezTerm's inline image protocol).

Highlights

  • Browse a PDF using almost the same keys as less(1) — line/half-window/full-window scrolling, page jumps, and so on
  • Zoom and pan, with width/height fit toggles
  • Regex search across the whole document, jumping straight to each match
  • Toggle to a plain-text view of the current page (t)
  • -F/--follow to auto-reload when the file changes on disk

See the README for details.