Score:1

How to read PDF files with no desktop?

ug flag

If use the system only with command line and do no desktop booted. How to read PDF files in such case? If Ubuntu 20.04 for desktops is used.

guiverc avatar
cn flag
Depending on the types of PDF files; you can `view` them as they're mostly just XML... the pictures & graphics can make certain PDF files a *pain* to view, but if you're *somewhat* familiar (*even if only marginally*) with the viewing of XML files it's pretty easy & use just search for what you want to read... (FYI: I've used this to extract data that was a *pain* on a GUI reader for copy/paste into replies in my gui). Providing your OS & release details may allow users of this site to offer more but we currently don't know if you're using a *deb* based or *snap* only based Ubuntu system?
Ya Y avatar
ug flag
@guiverc I'd use Ubuntu 20+.
Ya Y avatar
ug flag
@guiverc I use 20.04, conventional desktop version.
Paul avatar
us flag
@guiverc I have a feeling this really varies, as I just tried to read a bank statement that appears almost completely as text in a PDF viewer, but no useful information was viewable.
guiverc avatar
cn flag
Bank statements (*at least all I've received*) are usually encrypted, making it harder if not impossible to read using `view`. I would **not** attempt to read anything with encryption on it (*as I'd only expect enough detail that the type of file can be recognized; not that I can read the content within it*) but you are right. Depending on how sophisticated the PDF is, what features were used, tools used to create it - results can be great, or terrible.
guiverc avatar
cn flag
Bryan Lunduke wrote a series of articles years ago for a magazine, where the premise was *one month of using only terminal for everything* which covered PDFs, thus is likely where I'd go hunting for answers. As I recall he gave it away part way into it, by which time he'd worked out work-arounds for almost everything which likely included reading PDFs (*many of which weren't that fun*).
Score:0
cn flag

Do not expect to see graphics content of a PDF in a terminal, obviously. You can however view textual content of a PDF, if any, and provided the file is not encrypted. The standard less will already do a very decent job on its own:

less filname.pdf
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.