Reading PDFs on the command line (with misc/lesspipe)

Bertram Scharpf lists at
Wed Jun 29 12:16:10 UTC 2016

On Wednesday, 29. Jun 2016, 13:26:33 +0200, Ralf Mardorf via freebsd-questions wrote:
> > Since I use mutt to read emails on my server, I would like to
> > read PDFs on the command line. How can I do that?

> On Wed, 29 Jun 2016 12:29:45 +0200, Niklaas Baudet von Gersdorff wrote:
> >  $ less some.pdf
> I wonder how it is handled assumed "some.pdf" is just a scanned picture
> of text converted to pdf ;).

I do the following (from the shell, not yet from mutt):

  - Forward X to the desktop machine:

    xto() {
      local h l d
      l=`hostname -f`
      ssh $h "
        export DISPLAY=$d
        xhost $l 1>&2
        xauth extract - $d
      " | xauth -f ~/.Xauthority merge -
      export DISPLAY=$h$d

  - Run xpdf.

Of course, this requires xpdf and a lot of X client stuff to
be installed on the (anything but X) server.

You could also try to scp the PDF to the desktop and run
xpdf there via ssh.


Bertram Scharpf
Stuttgart, Deutschland/Germany

More information about the freebsd-questions mailing list