LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   open a pdf file via terminal (https://www.linuxquestions.org/questions/linux-general-1/open-a-pdf-file-via-terminal-811060/)

jone kim 05-30-2010 07:19 AM

open a pdf file via terminal
 
Can I open a pdf file via terminal. Suppose I want to open a book named 18177059-wrox-beginning-linux-programming-ed2.pdf via terminal. How can I do that?

druuna 05-30-2010 07:30 AM

Hi,

If you are talking about starting a terminal from your window manager you can use something like:

acroread filename or xpdf filename

I'm not aware of a program that can read/show pdf files from runlevel 3 (= no window manager).

Hope this helps.

pixellany 05-30-2010 07:44 AM

What is the reason for wanting to do this?

You can start any program from the terminal, but a pdf file normally needs a graphical environment to display properly.

Perhaps there is a program that just shows the raw text---but it might be pretty hard to read without any formatting.

Tischbein 05-30-2010 05:32 PM

Most desktops have a command that's equivalent to double-clicking a file, e.g. on gnome:

Code:

gnome-open myfile
has the same effect as opening myfile by double-clicking. xfce has a similar one that I forget (I map the open command to just 'o' on each system I'm on so I forget quite quickly) and I would be very surprised if there wasn't one for KDE.

To convert a pdf to raw ascii I suppose you could use:

Code:

<infile pdf2ps | ps2txt | less

cola 06-01-2010 09:43 PM

Quote:

Originally Posted by jone kim (Post 3986181)
Can I open a pdf file via terminal. Suppose I want to open a book named 18177059-wrox-beginning-linux-programming-ed2.pdf via terminal. How can I do that?

Code:

evince 18177059-wrox-beginning-linux-programming-ed2.pdf

Raveolution 06-02-2010 01:53 AM

Quote:

Originally Posted by Tischbein (Post 3986715)
Most desktops have a command that's equivalent to double-clicking a file, e.g. on gnome:

Code:

gnome-open myfile
has the same effect as opening myfile by double-clicking. xfce has a similar one that I forget (I map the open command to just 'o' on each system I'm on so I forget quite quickly) and I would be very surprised if there wasn't one for KDE.

gnome-open, eh? Glad I read this. :)


All times are GMT -5. The time now is 08:13 AM.