broot icon indicating copy to clipboard operation
broot copied to clipboard

Use mutool draw for previewing PDFs

Open mizlan opened this issue 3 years ago • 2 comments

MuPDF's mutool draw command produces a decently high-resolution image form of a PDF. It can be specified to only produce an image of the first page, which would be nice for previewing PDFs.

Quick demo (after installing MuPDF):

$ mutool draw -o pdf-preview.png julia-1.5.0.pdf 1 # can add 2>/dev/null
page julia-1.5.0.pdf 1
$ kitty +kitten icat pdf-preview.png

Or directly through stdout:

mutool draw -o - julia-1.5.0.pdf 1 2>/dev/null | kitty +kitten icat

mizlan avatar Feb 06 '22 01:02 mizlan

PDF previews would allow me to use broot as my main file browser, I hope it can be added! In addition to mutool, the Kitty icat method may be of interest. It uses ImageMagick to open both images and pdfs. (For a pdf, one generally needs a white background.) kitty +kitten icat --background white stuff.pdf

xxyxxyxyx1 avatar Mar 02 '22 11:03 xxyxxyxyx1

PDF previews would allow me to use broot as my main file browser, I hope it can be added! In addition to mutool, the Kitty icat method may be of interest. It uses ImageMagick to open both images and pdfs. (For a pdf, one generally needs a white background.) kitty +kitten icat --background white stuff.pdf

Just discovered Broot. Amazing application. PDF previews are literately the only missing feature.

andrej1919 avatar Mar 15 '24 08:03 andrej1919