I'm running Termux with XFCE desktop on Android. I only just realized that the only program I currently have installed that can properly open PDFs is GIMP, and that's extreme overkill as I just want a lightweight reader, no need to manipulate them as images ya know.

Also, related side question, are there any lightweight Linux terminal programs that can export PDF as plain text? I'm kinda hoping to pipe the text output of George Orwell 1984 through espeak reader and have Linux read it out to me...

Edit: Plain text and speech engine questions solved, and rather simple no less. This is the refined version BTW, --stdin is necessary to make espeak read the entire document.

pdftotext go-1984.pdf -|espeak --stdin

all 38 comments

sorted by: hot top controversial new old
[–] 32 points 21 hours ago (1 child)
  • [–] [S] 8 points 20 hours ago*

    Well hot fucking damn, I'm posting from Firefox already, it never crossed my mind to try that, thanks!

    Meanwhile, I finally got it reading 1984 out loud...

    wget https://tinyurl.com/go-1984

    pdftotext go-1984

    cat go-1984.txt | espeak

    Now I just can't get the damn thing to shut up, short of force killing the speech engine LOL!

  • source
  • parent
  • [–] 16 points 20 hours ago (2 children)

    I like Okular, i'd say its medium resource usage though and it might require kde packages you dont already have. Still, might be woth checking out, its the default in Plasma and does everything i need.

    https://en.wikipedia.org/wiki/Okular

  • source
  • hideshow 2 child comments
  • [–] [S] 2 points 19 hours ago*

    I love all you awesome penguins, have a can of cool beans!

    Yeah, actually I do already have the KDE packages installed for a couple other apps, so Okular was a nothing burger to get installed, and works perfectly 👍

    Also, as far as speech, yeah that turned out pretty easy too...

    pdftotext go-1984.pdf -|espeak

  • source
  • parent
  • [–] 16 points 20 hours ago

    Another vote for Okular.

    KDE default, and it's always worked fantastic for me in the past. Actually, lol, I was just giving a presentation a couple weeks ago using it, and -- I am not making this up -- one of the people in the audience was so impressed he came up to ask me what program I was using.

  • source
  • [–] 9 points 20 hours ago*

    PDF Viewer/Reader: ever tried okular? (part of the KDE Project) Extract text from PDF via CLI: Use pdftotext (part of the poppler-utils package)

  • source
  • [–] 7 points 21 hours ago* (last edited 21 hours ago) (6 children)

    I view PDFs on Linux with evince or xpdf. Xpdf is lighter but has fewer features.

    are there any lightweight Linux terminal programs that can export PDF as plain text

    pdftotext

    EDIT: Xpdf probably also isn't Wayland-native, if that matters for you.

    EDIT2:

    https://en.wikipedia.org/wiki/Evince

    https://en.wikipedia.org/wiki/Xpdf

    https://en.wikipedia.org/wiki/Poppler_(software)

    (pdftotext is in the poppler-utils package in Debian)

    EDIT3: Oh, looks like Xpdf got ported to Qt, so it probably can do Wayland these days.

  • source
  • hideshow 6 child comments
  • [–] [S] 2 points 20 hours ago* (last edited 20 hours ago) (5 children)

    Fuck...

    E: Failed to fetch https://mirrors.hust.edu.cn/termux/apt/termux-x11/pool/main/x/xpdf/xpdf_4.06_aarch64.deb Could not connect to mirrors.hust.edu.cn:443 (222.20.97.213), connection timed out

    Also, apparently pdftotext must not have been recompiled for Termux. Apparently I was mistaken, part of the poppler tools, pdftotext already installed.

    Termux is kinda special like that, as its entire filesystem doesn't reside in / like normal Linux, it resides in /data/data/com.termux/files/, so every single program that even exists for it had to be specially recompiled just for it.

    Anyways, guess I'm about to try to install evince...

    Sucks though that xpdf exists for Termux but the server isn't responding right now :(

    Edit: Fuck²...

    E: Failed to fetch https://mirrors.sdu.edu.cn/termux/apt/termux-main/pool/main/libs/libsynctex/libsynctex_1:2026.0-2_aarch64.deb 404 Not Found [IP: 101.76.224.129 443]

    Edit 2: I'm a fucking idiot, the poppler tools are already installed, and I already have pdftotext installed. Stupid sexy apt install pdftotext didn't tell me that LMFAO!

  • source
  • parent
  • hideshow 5 child comments
  • [–] 3 points 20 hours ago* (last edited 20 hours ago) (4 children)

    Honestly, I didn't even know that one could do a graphical environment on Termux (as XFCE and GIMP would entail) with it. The Termux I know on Android is an app in F-Droid that provides a terminal-only environment. So I don't really know what-all is packaged for the environment you're using. Just saying that traditional Linux distros will have those.

    EDIT: You might run a pkg update in Termux to update the index of currently-available packages, then try installing it.

  • source
  • parent
  • hideshow 4 child comments
  • [–] [S] 2 points 20 hours ago (2 children)

    Yeah, same Termux app from F-Droid running the show, via VNC...

    Termux + vncserver + XFCE displayed through MultiVNC here, it was a fun journey getting it all set up, but yeah I've been running this as my main daily runner since July, and rather almost like it LOL!

    Not sure if you caught my edits, but aapparently the poppler tools were already installed, so I already have pdftotext 👍

  • source
  • parent
  • hideshow 2 child comments
  • [–] 2 points 19 hours ago (1 child)

    Ah, gotcha! Thanks for the explanation!

  • source
  • parent
  • hideshow 1 child comment
  • [–] [S] 1 point 19 hours ago

    I just caught your edit regarding pkg update, yeah that's like one of the first things I do before upgrading or installing any packages. Actually pkg is just an alias for apt anyways, same difference on Termux.

    Once the GUI is all set up, synaptic package manager is also a nice healthy option to install 👍

  • source
  • parent
  • [–] 3 points 20 hours ago* (3 children)

    Firefox can view PDFs so I assume Chrome also has that ability, and you're likely to already have one or the other if you're already using your computer for web browsing.

    If you need something stand-alone, one of the Evince family might also suit your purpose. Evince = GNOME Document Viewer and XFCE is GTK-based, which seems like a good match. There's also Atril which is a MATE fork and Xreader, which is a fork of Atril, from Linux Mint's Xapps project.

    LibreOffice, as mentioned by another respondent, has the ability to modify PDFs if not outright edit them, i.e. ability to place text boxes on top of the document, so you could theoretically use it to digitally complete a form you've been sent as a PDF and save it out as one. That may be worth jumping through the hoops if that sounds like a feature you might want.

  • source
  • hideshow 3 child comments
  • [–] [S] 2 points 20 hours ago (2 children)

    Yeah, I'm posting from Firefox right now, another commenter mentioned this just a few minutes ago. Honestly I'm not sure why the hell I didn't think to try that first LMFAO! Guess I'm a fucking idiot...

    Obligatory, fuck Chrome though, I ain't got the space for their stupid weights.bin file, and I rather like the uBlock Origins plugin...

  • source
  • parent
  • hideshow 2 child comments
  • [–] 2 points 19 hours ago (1 child)

    My bad. I didn't see the other post about Firefox.

    Not using Chrome solves the weights.bin problem, of course, but if I had no choice, I'd maybe replace weights.bin with a read-only zero-size file to see what happens.

  • source
  • parent
  • hideshow 1 child comment
  • [–] [S] 1 point 19 hours ago

    Hahaha! I like your train of thought, I'd love to know the results of a read-only zero-size weights.bin file!

    For realz though, I'm running Termux on a tablet with only 3GB RAM and barely able to keep ~3.5GB storage space free at any given moment, so Chrome ain't getting any of my attention ya know..

  • source
  • parent
  • [–] 3 points 19 hours ago (1 child)

    Hard to get lighter weight than https://en.wikipedia.org/wiki/MuPDF

    The frontend doesn't even really have a UI, just keyboard input.

  • source
  • hideshow 1 child comment
  • [–] 3 points 20 hours ago* (last edited 19 hours ago)

    PDF viewer

    https://gitlab.gnome.org/GNOME/evince

    For OCR maybe ocrpdf from

    https://github.com/uroesch/pdftools

    Edit: ah no, ocr not needed if it's text already. As someone else already said there's a tool for plain text extraction.

  • source
  • [–] 2 points 19 hours ago (3 children)

    pdftotext go-1984.pdf

    cat go-1984.txt | espeak

    Looks like pdftotext go-1984.pdf -|espeak should let you drop the temporary file, if you want.

  • source
  • hideshow 3 child comments
  • [–] [S] 2 points 19 hours ago

    WTF espeak? It stops at line 200, the last words it speaks are "little boy screaming with fright"

    Goddamnit, WTF espeak? Guess I need to look up the man/help file for espeak to convince it to read the whole document...

  • source
  • parent
  • [–] [S] 2 points 18 hours ago* (last edited 18 hours ago)

    Trying this right now, supposed to make espeak read the entire document...

    pdftotext go-1984.pdf -|espeak --stdin

    Edit: This works, reads the entire document and doesn't stop at line 200

  • source
  • parent
  • [–] 2 points 18 hours ago* (last edited 18 hours ago) (4 children)

    Check out lue: https://github.com/paulilaaso/lue

    terminal-based , TTS, various formats supported. I've used it and it works on my system. (edit: I see you're on android, so not sure if that's supported. It's python.)

  • source
  • hideshow 4 child comments
  • [–] [S] 2 points 18 hours ago (3 children)

    Oof, that's gonna be a no-go for me. Though Termux is on Android, and actually is a variation of Linux, it's a very hacked distro, as it doesn't have access to the true / root folder, everything is stored in /data/data/com.termux/files/

    So, every single program for Termux has to be modified and recompiled accordingly to comply. At least most mainline programs and packages are available and maintained, apparently lue isn't available, and I ain't in any hurry to modify and recompile it myself, but I probably could, if it was necessary.

    I've installed Okular though and that works fine, plus pdftotext works fine in the terminal as well.

    Thanks for the response and advice though 👍

  • source
  • parent
  • hideshow 3 child comments
  • [–] 2 points 18 hours ago (2 children)
  • [–] 2 points 20 hours ago

    reader

    Atril and xpdf, I guess? Honestly I had never sat down to think and search this before.

  • source
  • [+] 1 point 20 hours ago
    [–] 1 point 19 hours ago* (1 child)

    The default .pdf viewer in your Linux distro should be enough.. on Debian Trixie with GNOME it seems to be Evince and it works well and lightweight (especially compared to anything Adobe related!). I don't know too much about Termux but I guess if you can install Evince in there then it should be fine.

    Otherwise like others mentioned most web browsers nowadays can view .pdf files, people usually have a web browser already installed so that's probably the easiest solution unless you need/want something different.

  • source
  • hideshow 1 child comment
  • [–] [S] 1 point 19 hours ago

    Oh that's funny, Termux ain't your regular cup of penguin tea. Initially, it doesn't even come with nano, the terminal based text editor. Termux runs on top of Android, non-rooted, and the base install might as well be like booting a barebones Linux terminal off of a few floppy disks.

    So, there's no such thing as a default app that comes with the 'operating system', you basically gotta build it up yourself.

    It's a fun journey though...

    https://www.youtube.com/watch?v=I__bpMIBj30

  • source
  • parent
  • [–] 1 point 20 hours ago (3 children)