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

    • over_clox@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      9
      ·
      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!

  • 2ndDegreeOWO@lemmy.world
    link
    fedilink
    English
    arrow-up
    17
    ·
    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.

  • book@lemmy.zip
    link
    fedilink
    English
    arrow-up
    17
    ·
    21 hours ago

    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

    • Brave Little Hitachi Wand@feddit.uk
      link
      fedilink
      English
      arrow-up
      4
      ·
      20 hours ago

      I’m doing alright with okular. Trying to figure out how to change the settings so that ctrl+w closes the window entirely instead of just the document inside it…

    • over_clox@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      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

  • lightrain@forum.storstad.net
    link
    fedilink
    English
    arrow-up
    10
    ·
    21 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)

  • tal@lemmy.today
    link
    fedilink
    English
    arrow-up
    8
    ·
    edit-2
    21 hours ago

    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.

    • over_clox@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      edit-2
      20 hours ago

      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!

      • tal@lemmy.today
        link
        fedilink
        English
        arrow-up
        3
        ·
        edit-2
        20 hours ago

        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.

        • over_clox@lemmy.worldOP
          link
          fedilink
          English
          arrow-up
          2
          ·
          20 hours ago

          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 👍

            • over_clox@lemmy.worldOP
              link
              fedilink
              English
              arrow-up
              2
              ·
              19 hours ago

              Yeah, not exactly the easiest thing to set up and arrange, but it’s definitely a bit of a Linux upskill challenge. I wouldn’t categorize Termux as any sort of serious big boy daily driver nor gamer, but for most typical tasks, it gets the job done at least.

              Here’s one of the tutorial videos I found explaining ways to set it up with a graphical desktop…

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

        • over_clox@lemmy.worldOP
          link
          fedilink
          English
          arrow-up
          1
          ·
          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 👍

    • over_clox@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      18 hours ago

      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 👍

    • mycodesucks@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      18 hours ago

      I second this. Once you know the navigation keys it’s as blazing fast as you feel in your soul like navigating pdfs SHOULD be.

  • palordrolap@fedia.io
    link
    fedilink
    arrow-up
    3
    ·
    20 hours ago

    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.

    • over_clox@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      20 hours ago

      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…

      • palordrolap@fedia.io
        link
        fedilink
        arrow-up
        2
        ·
        20 hours ago

        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.

        • over_clox@lemmy.worldOP
          link
          fedilink
          English
          arrow-up
          1
          ·
          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…

  • tal@lemmy.today
    link
    fedilink
    English
    arrow-up
    2
    ·
    19 hours ago

    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.

    • over_clox@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      edit-2
      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

    • over_clox@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      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…

  • Brickfrog@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    1
    ·
    20 hours ago

    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.

    • over_clox@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      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

    • over_clox@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      20 hours ago

      Easier said than done on Termux, that’s not exactly immediately supported and is gonna take jumping through a few extra hoops to get installed. Sigh, I’ll get to it one of these days…