CLI pdf viewer for Linux

Hey, quite a while, I'm looking for a command line PDF viewer.

As I like working without X on Linux and often working on a remote machine, I would like to have a tool for reading pdf files. There are quite a few really good graphics programs (evince, okular, acroread, ...) to do this work, so I decided there should be at least one decent text mode tool. But I don’t even know how crappy!

Currently, I either run X to read pdf files only, or to use pdftohtml + lynx. However, the latter does not give a very good result, and most documents are simply not readable, especially if they contain a mathematical formula.

Google is full of people who say this is not possible or the pdftohtml version is being offered.

I understand that this is not really a programming issue, but now I am considering the possibility of launching a project to implement such a program if there is no longer good.

Thanks for any suggestions.

+50
command-line linux pdf ncurses pdftotext
Aug 25 2018-10-10T00:
source share
7 answers

Hi, I think you do not need to write a program for your purpose. I mean reading the pdf file in console mode, because the less command already does this for you. So use it and enjoy it.

less "pdf file name"

+62
Mar 04 '12 at 7:14
source share

Well, you asked to know even "crappy". Here are two (decide for yourself about your respective nonsense):

First: txtwrite output txtwrite

  gs \ -dBATCH \ -dNOPAUSE \ -sDEVICE=txtwrite \ -sOutputFile=- \ /path/to/your/pdf 

Second: CLI utility> pdftotext (better than Ghostscript):

  pdftotext \ -f 13 \ -l 17 \ -layout \ -opw supersecret \ -upw secret \ -eol unix \ -nopgbrk \ /path/to/your/pdf - |less 

This will display a range of pages 13 ( f first page) to 17 ( l ast page), save the layout of the double-password protected PDF file name (using secret and super secret passwords of users and owners), with the Unix EOL agreement, but without inserting page breaks between PDF pages passed through less ...

pdftotext -h displays all available command line options.

Of course, both tools work only for the text parts of PDF files (if any). Oh, and the mathematical formula won't work too well either ...; -)




Edit: I incorrectly typed the command above (initially using pdftops instead of pdftotext ).

+13
Aug 30 '10 at 3:25
source share

There is also a green PDF viewer. There is a demo on YouTube .

+4
Aug 10 '13 at 18:15
source share

By the way, I am always in the same situation, and I use mc (midnight commander), which handles pdf text perfectly ... Just browse the file (F3) in mc

+4
Aug 29 '14 at 20:19
source share

fbpdf - PDF framebuffer viewer.

There is also a jfbpdf fork, but at the moment I cannot get it to work.

+3
Jun 06 '14 at 11:54 on
source share

This will only work if your PDF is structured, i.e. this is with pdf tags .

This is necessary to get the correct reading order of text objects in the document.

Marked PDF documents also allow you to re-document a document, although I don’t know about any tool that does this with command line output.

0
Aug 25 '10 at 10:18
source share



All Articles